Create own DHT bootstrap node


I was playing around with the go version of the P2P chat with rendevouz and noticed that the bootstrap peer is an external server.

How do I create a libp2p node that functions as a bootstrap node for a DHT network?

Any DHT router node (node running the dht in router mode / means it serves requests for other users) works as a bootstrap node.

You don’t need to do anything special, just setup an IPFS node, be sure it’s running dht server (the way to check is to see if you have many peers naturally flowing into you and lots of CPU usage after 5 or 10 minutes of time running).
And you can use this one.

1 Like

So any node that was created using the NewDHT function will work as a DHT bootstrap node?

Yes pretty much.
I don’t use PL’s bootstrap nodes because of centralisation and stuff (eventually a persistant peerstore is gonna fix that in the future) I’ve just crawled the network for all quic nodes since and just use that list, I have like 50 nodes in there and just works fine.

1 Like

Interessting approach
Is the network crawling similar to network flooding as used in Gnutella for example?

I’ve just logged all peers on a few days (running a cron job dumping the connected peers each 5 sec) and assumed the DHT turn around is good enough.
I’ve also filtered for temporary nodes by trying to redial them later and only keeping the one that stayed online.

1 Like

So you run every peer in a docker container and then dump every container’s peer address?

No, I have one systemd managed one, and just append ipfs swarm peers | grep "/udp/quic/" to a single file each 5 sec, then uniq it and then try to connect with bash magic.

1 Like

Ah interessting
Thank you very much for your time and help!

note, this way of doing things is superseeded by something else.

GitHub - dennis-tra/nebula-crawler: 🌌 A libp2p DHT crawler. it’s using a quirk in how the DHT works to ask nodes their neighbors and gives really similar results as my old way of doing it but in like 2 minutes of running.

1 Like