Peer discovery with kademlia for gossipsub #2447
-
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
In case you just want to discover any nodes within the network, I recommend doing a random walk (FIND_NODE with a random peer ID) on the DHT.
Note, that any supported Let me know if this helps @Frederik-Baetens. |
Beta Was this translation helpful? Give feedback.
-
The documentation of /// A peer has connected for whom no listen address is known.
///
/// If the peer is to be added to the routing table, a known
/// listen address for the peer must be provided via [`Kademlia::add_address`]. I am guessing that 2 connects to 1. Given that 1 does not know the listen address (but only the ephemeral dial address) of 2, 1 does not add 2 to its routing table. Given that 1 does not add 2 to its routing table, 1 can not return 2 to 3 when 3 queries 1. For now I recommend doing the following: Use |
Beta Was this translation helpful? Give feedback.
The documentation of
UnroutablePeer
might help:I am guessing that 2 connects to 1. Given that 1 does not know the listen address (but only the ephemeral dial address) of 2, 1 does not add 2 to its routing table. Given that 1 does not add 2 to its routing table, 1 can not return 2 to 3 when 3 queries 1.
For now I recommend doing the following: Use
libp2p-identify
to discover a remotes listen address. Once discovered, add the remote to the Kademlia routing table with tha…