stbuehler/node-dht

Question

aredridel opened this issue · 4 comments

How might you bootstrap a network that starts with no nodes?

You need to find at least one node in a different way - for torrents this usually involves a traditional tracker. You ask it for other peers for a torrent, and then check whether those peers have dht support (afaik).
See http://bittorrent.org/beps/bep_0005.html#bittorrent-protocol-extension

Hm. I'm actually working with something other than BitTorrent, so I'm trying to figure out how to stuff enough code in via the API to let a network form.

You still can use BitTorrent trackers if you want, just pick a random 160-bit string (sha1sum of some identifier for your project for example), and make your peers announce it on some trackers to find each other.
Or, if you have a standard listening port, scan for peers on certain ip ranges (this only works for a large number of peers in an ipv4 network, for small networks or ipv6 this is probably just insane).

Hrm. I'll have to delve deeper -- I'm hoping to set up one or some of my nodes with enough pre-configured information to form a swarm without external resources.