max-mapper / dhtkv

CLI for storing arbitrary key/value data in the bittorrent mainline DHT
63 stars 6 forks source link

[Question] but... where the hell the data is stored? #4

Closed Kikobeats closed 8 years ago

Kikobeats commented 8 years ago

I'm trying to understand how Bittorrent protocol and DHT works.

I understand that DHT is distributed between peers, but, in this case, where is the data stored? who are the peers?

bittorrent-dht dependency have a default tracker declared?

It's fuck*ng my brain!

max-mapper commented 8 years ago

Heres the technical explanation http://www.bittorrent.org/beps/bep_0044.html

paulkernfeld commented 8 years ago

@Kikobeats bittorrent-dht does have default bootstrap nodes.

Kikobeats commented 8 years ago

Now more clear! Thank you guys :-)

Kikobeats commented 8 years ago

@paulkernfeld one extra question: The bootraps nodes are trackers?

I'm thinking in a scenario that I connect to the DHT for first time to download something and I don't have a list of associated nodes that can serve me the file. What happens? Bootstraps node give me a start list?

It's in this initial step where I feel lost.

paulkernfeld commented 8 years ago

@Kikobeats I wouldn't say that the bootstrap nodes are actually "trackers;" they just give you information to connect to the rest of the DHT. Since the BitTorrent hash table is decentralized, there aren't really trackers in this case. For more about how you connect to other nodes once you know the first node, you might want to look up Kademlia, the DHT that BitTorrent uses.

Kikobeats commented 8 years ago

@paulkernfeld I think that your comment is aligned with this: https://en.wikipedia.org/wiki/Mainline_DHT#Torrents

and also https://en.wikipedia.org/wiki/Bootstrapping_node

https://stackoverflow.com/questions/1181301/how-does-a-dht-in-a-bittorent-client-get-bootstrapped https://superuser.com/questions/592238/in-simple-terms-how-does-a-bittorrent-client-initially-discover-peers-using-dht

thanks again!

paulkernfeld commented 8 years ago

Exactly!