Hacker News new | ask | show | jobs
by mixmastamyk 927 days ago
How does one learn how to develop BT clients and servers? Or use libBT at a competent level?

Every time I’ve looked for a book or in-depth tutorials I get swamped with user articles.

2 comments

For rqbit at least, there were only a few things necessary to start off with:

1. The bittorrent protocol specification: https://www.bittorrent.org/beps/bep_0003.html

2. Wireshark dumps of some existing BitTorrent clients to write unit-tests for RPC serialization/deserialization. I used qBittorrent, but you can use any other existing client.

3. (kind of optional) DHT protocol: https://www.bittorrent.org/beps/bep_0005.html. This actually came later, you can download torrents using just #1. But if you try to do so, you'll discover that most peer information is stored in DHT, and not in trackers.

Everything else was heuristics, observing real network behaviour, and tweaking the code accordingly.

That said, I'm not exactly the go-to expert on "how to develop BT clients and servers", as rqbit isn't as fully featured as the more mature clients. But given that the above links got me that far, I'm sure they can give a very decent start.

Thank you.
Take a watch of Jon Gjengset's vids on this (there's a codecrafters challenge for building out a bittorent protocol that he's going through).

- https://www.youtube.com/watch?v=jf_ddGnum_4

- https://www.youtube.com/watch?v=r0srf3kfZbs