rustlibp2ppeer-discovery

Implementing peer discovery in libp2p


Is peer discovery in libp2p (e.g. peers telling each other about peers they know about, and managing lists of connected nodes) in Rust controlled entirely at the level of a NetworkBehavior?

It looks like one option is to use Kademlia which looks like it does this (in the rust version) by defining a NetworkBehavior.

Is it correct that if you don't want to use Kademlia to implement peer discovery, you do this by defining peer discovery as part of your NetworkBehavior?

I'm trying to avoid a situation whereby I start to implement code to do this, but then I find that libp2p is actually doing this for me under the covers.


Solution

  • You have several alternatives, but of course you have to implement a behavior (or combination of behaviors) to discover peers:

    Some of my colleagues are preparing a tutorial series to be published soon, to share our experience with libp2p in Rust.