Gossipsub - How does it work without peer discovery?

I am having an issue understanding a fundamental concept.

For a scalable network, using a DHT based peer discovery seems like a good (probably the best) approach.

I was looking at py-libp2p and it explicitly does not list any peer discovery layers as implemented. For content-routing, only gossipsub (and floodsub, which is not interesting to me). I understand this means there is also no KadDHT implemented?

How would gossipsub work then if there’s no peer discovery? Does it mean I would have to build the network manually (I understand py-libp2p is not ready for prime time, but I would like to run an experiment), by establishing the network via direct libp2p connections?

Hello holisticode,

Welcome to the libp2p project! You’re right about py-libp2p not having a KadDHT implementation yet. The py-libp2p project was just recently revived after a few years of being dormant and currently only has two maintainers working very part time on it. TBH I would love it if you could help implement some of py-libp2p…specifically KadDHT.

The implementations of libp2p that do have full KadDHT capabilities are go-libp2p, js-libp2p, rust-libp2p, nim-libp2p, and I think jvm-libp2p, cpp-libp2p, and .net-libp2p as well.

You’re right that peer discovery is best done over KadDHT. At least that’s what it is used for mostly in other implementations. We also have the rendezvous protocol for creating “bootstrapper peers” that allow new peers to quickly discover all other peers in the distributed network.

I hope this helps.

Cheers! :beers:
Dave