Upgrading from 0.50.0
to 0.52.3
#4674
Replies: 2 comments 8 replies
-
All good! This is what discussions are for :)
Correct. All APIs on There is an open issue and ongoing effort about sharing peer addresses across For the moment, it is unfortunately only possible to be notified about the addresses you get connected to. What function does your |
Beta Was this translation helpful? Give feedback.
-
Closing here. Seems resolved. Please let us know if you have more questions. |
Beta Was this translation helpful? Give feedback.
-
We are currently upgrading our
libp2p
version and I thought I would start a discussion here for any ongoing questions we have in the process. LMK if there would be a better way of organizing our questions.It is possible that our architecture is also out of date/wrong. Hopefully this will also be an opportunity to update the architecture as well.
I'm not sure of all the issues we are going to have; we have already successfully converted a lot of the code. But I'll start with the current problem:
Background
We have a custom network behavior
PeerReportBehavior
whichon_swarm_event
, will take thepeer_id
from aFromSwarm::ConnectionEstablished
and lookup the addresses of thatpeer_id
usingaddresses_of_peer
which under the hood is:Obviously,
addresses_of_peer
is no longer available fromPeerReportBehavior
oridentify::Behavior
, so I thought maybeidentify::Behavior
might expose a getter fordiscovered_peers
which is what the oldaddresses_of_peer
used to do here. It doesn't.Question
What is the correct way of getting those peer addresses?
I could just hit
handle_pending_outbound_connections
which will return the desired addresses as seen here. It just has a bunch of additional (albeit unused in this case) parameters, which makes me feel like this isn't the intended use.I would appreciate your perspective and guidance avoiding any pitfalls here :)
Beta Was this translation helpful? Give feedback.
All reactions