The basic command-line user interface we're initially experimenting with.
The high-level programming interface for using BitTorrent, encapsulating all of the details.
Utilities and simple data types that shared used by everthing else.
Implemenetation of BitTorrent's TCP peer protocol.
Client/read-only implementation BitTorrent's BEP-5 UDP Distributed Hash Table protocol.
dotnet in the shell (maybe with Visual Studio Code)
./install will install our dependencies (locally).
./ditto will build and run our main command-line application. Run it to see a description of available subcommands.
test/all runs whatever tests we have.
test-peer/stop will start and stop our test rTorrent Docker image using data from
./test-peer/state/. Our example/test programs may require this peer or use it for bootstrapping. You can control it directly through the web interface at http://localhost:8042. If you want to commit updated data/state, you need to
test-peer/stop && rm -rf ./test-peer/state/ && mv ./test-peer/active-state/ ./test-peer/state/.
Using Visual Studio
Since this assumes Windows, you won't be able to use the above commands by default. I suggest using Docker Toolbox to get a Docker instance running. In the Docker Command Prompt, copy and paste the commands from
.\test-peer\start. This should get you set up with our test rTorrent/ruTorrent Docker image, using data from
.\test-peer\data\. Once this is set up, I recommend Kitematic, a nice GUI that will let you start and stop the Docker image, manage ports, etc.
Beyond that, you'll want to set up your Docker instance's IP Address as a command line argument in Visual Studio. Once you do that, you can run it like normal or with the debugger without ill effect.
- Official Index of BitTorrent Enhancement Proposals (Specifications)
- BitTorrent Protocol and Bencoding (BEP 3)
Clients read the bencoded torrent file, use its HTTP tracker URL to get/update list of other clients (peers), and exchange data with them over TCP.
- Unofficial BitTorrent Specification
Alternative description that may help understanding of certain parts.
- My brief summary of how decentralized torrents work
- Multiple Tracker Metadata Extension (BEP 12)
Small extension to allow multiple trackers in torrent file.
- BitTorrent Extension Protocol (BEP 10)
Standard for non-conflicting extensions to peer protocol.
- Web Seeding (BEP 19)
Standard for downloading torrent data from normal HTTP servers.
- UDP Tracker Protocol (BEP 15)
More-efficient UDP version of tracker protocol.
- Compact Peer Lists (BEP 23)
Minor optimization to HTTP tracker protocol.
- Peer Exchange (BEP 11)
Extension allowing peers to exchange others peers addresses, so the tracker isn't required once connected to other torrent peers.
- Canonical Peer Priority (BEP 40)
Defines a peer selection algorithm to slightly improve swarm security and efficiency.
- Metadata Exchange and Magnet Links (BEP 9)
Extension allowing peers to exchange torrent file info directly, so the torrent file isn't required in advance.
- Mainline DHT Protocol (BEP 5)
Distributed index of peers on a secondary P2P network, used to find initial torrent peers without any tracker.
- Read-only DHT Nodes
Allows DHT nodes to indicate that they're read/client-only, and should not be queried.
- Kademlia Protocol (Maymounkov and Mazières 2002)
Fuller description of the protocol on which the mainline DHT protocol is based.
- Magnet URI Web Seeding Draft Proposal
De-facto description of additional magnet link parameters including web seeds.