sjaensch / storrent Goto Github PK
View Code? Open in Web Editor NEWTrying to write a torrent client to learn Go (and about bittorrent).
License: GNU General Public License v3.0
Trying to write a torrent client to learn Go (and about bittorrent).
License: GNU General Public License v3.0
Once we have saved the routing table to disk (#7) we should try to load it on startup.
Currently, the second argument passed on the command line is the path and file name where the downloaded data of the torrent passed as argument one are written to. The second argument should be a directory instead, and inside the directory the files and subdirectories according to the torrent metadata should be created and written to.
A trackerless torrent does not have an announce
key, instead it has a nodes
key. Let's use it to initialize our DHT. From the BEP:
nodes = [["<host>", <port>], ["<host>", <port>], ...]
nodes = [["127.0.0.1", 6881], ["your.router.node", 4804], ["2001:db8:100:0:d5c8:db3f:995e:c0f7", 1941]]
From the BEP:
Upon inserting the first node into its routing table and when starting up thereafter, the node should attempt to find the closest nodes in the DHT to itself. It does this by issuing find_node messages to closer and closer nodes until it cannot find any closer.
We'll need to do #4 for this.
We should save the routing table to disk when exiting the application.
We need to track the status of all nodes in our DHT. That means keeping track of when nodes answered queries we sent it, and being able to actively ping a node to make sure it's good.
This ticket does not involve making sure we give priority to good nodes.
Before tackling storing partial data on disk instead of just in memory, let's first write the data to multiple files at the end. We need to properly assign pieces of data to the correct files.
When looking for peers for a given infohash we need to walk the DHT and find the closest node (the node which ID most closely matches the torrent infohash). We need to do this by repeatedly calling find_node
on the closest nodes in our routing table, and adding the results to our table.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.