Skip to content

Commit

Permalink
fix: rendezvous identify example
Browse files Browse the repository at this point in the history
This pr closes #5388 by explicitly adding the local observed address, noting this is out of protocol behaviour in non-example cases

Pull-Request: #5496.
  • Loading branch information
EdwardJES authored Jul 16, 2024
1 parent 8e28edf commit e2e98ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/rendezvous/src/bin/rzv-identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ async fn main() {
}
// once `/identify` did its job, we know our external address and can register
SwarmEvent::Behaviour(MyBehaviourEvent::Identify(identify::Event::Received {
info,
..
})) => {
// Register our external address. Needs to be done explicitly
// for this case, as it's a local address.
swarm.add_external_address(info.observed_addr);
if let Err(error) = swarm.behaviour_mut().rendezvous.register(
rendezvous::Namespace::from_static("rendezvous"),
rendezvous_point,
Expand Down

0 comments on commit e2e98ad

Please sign in to comment.