Interaction and ordering of Kademlia, Identfiy and AutoNAT behaviors #3906
-
Assume these three behaviors: Kademlia, Identify and AutoNAT. Adding peers to the Kademlia routing table happens based on the The addresses that get broadcast with Am I going about this in the wrong way? In essence, what I am trying to prevent is a node behind NAT trying to join the Kademlia network. I am assuming that will be detrimental to the health of that network, as the node can not be dialed (assuming we are not yet using relays). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Kademlia will only ever add a node to the routing table if it successfully dialed that node: rust-libp2p/protocols/kad/src/behaviour.rs Lines 2050 to 2057 in 541eba3 The addresses we receive from identify will be use to attempt to connect to a node if we don't have a connection yet: rust-libp2p/protocols/identify/src/behaviour.rs Lines 330 to 343 in 541eba3 which gets populated by: rust-libp2p/protocols/identify/src/behaviour.rs Lines 286 to 293 in 541eba3 Does this help? |
Beta Was this translation helpful? Give feedback.
-
You mentioned that peers only get added when they are dialed by us:
Though, this seems to be overwritten of course if we manually call Now, how would we approach leaving this to the Kademlia protocol. Does Kademlia add all nodes that support the |
Beta Was this translation helpful? Give feedback.
Kademlia will only ever add a node to the routing table if it successfully dialed that node:
rust-libp2p/protocols/kad/src/behaviour.rs
Lines 2050 to 2057 in 541eba3
The addresses we receive from identify will be use to attempt to connect to a node…