How does bootstrapping work in rust-libp2p 's Kademlia implementation? #2244
-
Hi, My test is setup in the following manner: They are connected in the following manner (and, sequence):
The result I expect from this is that However, this is not happening. // Connect A --> B, B --> C.
for i in 1..3 {
let peerid = peeraddr[i].0.clone();
let addr = peeraddr[i].1.clone();
clients[i - 1].dial(peerid, addr).await;
}
// Connect D --> E.
for i in 4..5 {
let peerid = peeraddr[i].0.clone();
let addr = peeraddr[i].1.clone();
clients[i - 1].dial(peerid, addr).await;
}
// Connect A --> D.
let peerid = peeraddr[3].0.clone();
let addr = peeraddr[3].1.clone();
clients[0].dial(peerid, addr).await;
// A should find E.
clients[0].bootstrap().await;
let known_peers = clients[0].known_peers().await;
let peerid = peeraddr[4].0.clone();
assert!(known_peers.contains(&peerid)); Do I need to enable any config flag of some kind without which the routing tables won't get updated? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So, apparently, one needs to wait for all the pending bootstrap requests to finish, meaning we need |
Beta Was this translation helpful? Give feedback.
So, apparently, one needs to wait for all the pending bootstrap requests to finish, meaning we need
QueryResult::BootStrap
where thenum_remaining = 0
.