Skip to content

Peer address discovery through bootstrap node #5704

Answered by dariusc93
depechec0de asked this question in Q&A
Discussion options

You must be logged in to vote

First, Is Kademlia the correct protocol for this?

It is one of many protocols that can do this, but yes you can use kademlia to discover peers

What are the events that I should listen from Kademlia in order to do this? In which steps?

You can call Behaviour::get_closest_peers, which would get the closest peer.

In my understanding node A should learn C's Multiaddrs and choose one to connect. Should A query manually for this info or I just need to listen to events from Kademlia?

When the peer is discovered, its addressed is stored in the kbucket, which would make it dialable via Spawn::dial, though to get the address from the behaviour for the peers, you would need to use Behaviour::f…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@depechec0de
Comment options

@drHuangMHT
Comment options

Answer selected by depechec0de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants