Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dht implementation details & code completion status? #34

Closed
soul9 opened this issue Oct 26, 2015 · 2 comments
Closed

dht implementation details & code completion status? #34

soul9 opened this issue Oct 26, 2015 · 2 comments

Comments

@soul9
Copy link

soul9 commented Oct 26, 2015

Hello,
I would like to use your library in a project of mine, but I'm not sure as to the completion status of your project. You say it is running in production, but the DHT library seems to be incomplete. It is not capable, for example, of announcing itself as a possible source for a torrent. I am not sure how much more is missing from it.
Would you be interested if I tried to implement announce_peer so the DHT client can be completed? how much do you think is missing? It seems there is also some code missing for infohash storage, and infohash to peerid mapping.
I am stressing on the DHT implementation since I can not rely on external DHT nodes for this project.

@anacrolix
Copy link
Owner

I believe announce_peer does occur during an announce, which is the main functionality I've implemented. You could additionally expose it directly on the Server type if you wished. The DHT does not store peers for nearby infohashes as it should at present. The latter implementation would be welcomed. It would be desirable if you exposed the storage as an interface or using a SQL handle so it can be done using an in memory SQLite or external database. Just a thought. I'm away for a few days then I can address any queries more specifically.

@anacrolix
Copy link
Owner

If you look at announce.go:190, you'll see that if a get_peers response contains a token, we immediately announce with the granted token. The function announcePeer exists on Server also, but is private, as I didn't foresee a use case where a user has an useful token except during an Announce. It's worth noting that Server.Announce is an operation that traverses the DHT space toward peers responsible for the desired info hash, returning peer addresses, and announcing as it goes.

If you look in Server.handleQuery, you'll see the handling of get_peers and announce_peer are very poor. There's work to be done there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants