-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libp2p-kad: provide a way to get known addresses of a peer from address book #3633
Comments
I can agree that there should be some way in going about it since |
I read our and rust-libp2p code for a bit, and it seems that we do not depend on addresses being available in I'll try and see how our tests are feeling, and get back with results! |
Hey @folex were you able to get the results you were looking for? |
Thanks for the detailed report. I always considered the |
Hey, @mxinden I work with @folex
into Kademlia impl and reuse it into handle_pending_outbound_connection. |
I am curious. Is there anything about |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
It seems that address inside the Query Iterator are crucial: we were not able to do a discovery based on |
Related: #4101. |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
This issue was closed because it is missing author input. |
Description
Since Kademlia is basically an address book of peers (aka routing table), it would be great to be able to actually read from that address book. Check whether peer is presented in that address book or not.
For example, one might (and we do, see for example our fn discover_peer) use Kademlia to discover Peer address, establish connection, and exchange some messages.
But since
addresses_of_peer
is deprecated, andKademlia::kbucket
is private, how to read from the address book?There's
handle_pending_outbound_connection
which is proposed to replaceaddresses_of_peer
, but it implies an effect, since it signifies that a new connection happened. So it is a bad fit for the goal of "read address from Kademlia address book".That being said, what are alternatives that you see viable?
Motivation
We need to read addresses from the Kademlia by PeerId, because we use Kademlia as a peers' addresses discovery mechanism.
In addition, I think it makes sense to separate "read model" from effectful methods like
handle_pending_outbound_connection
.Current Implementation
We've relied on
addresses_of_peer
, but it is now removed from Kademlia completely.Are you planning to do it yourself in a pull request?
Maybe, but need a guidance on the design and alignment with rust-libp2p team's vision.
Let's discuss!
I'm happy to provide more information on our use-case and discuss different design approaches.
Thank you for fast-paced development of rust-libp2p, it is a tremendous effort, and I really appreciate the complexity you are tackling! ❤️
The text was updated successfully, but these errors were encountered: