3

According to Libp2p documentation DHT can be used for peer discovery.

Also, Filecoin claims that they are using libp2p Kademlia DHT for discovering peers in go.

So far I have not been able to find any working examples of how to set it up in JS.

When I specify DHT for peerDiscovery:

  modules: {
        transport: [TCP],
        streamMuxer: [MPLEX],
        connEncryption: [SECIO],
        peerDiscovery: [KadDHT],
        dht: KadDHT,
        pubsub: GossipSub,
      },

I get an error in the log:

 Error: libp2p-kad-dht requires an instance of Dialer

Can anyone help please?

0 Answers0