iroh icon indicating copy to clipboard operation
iroh copied to clipboard

feat(iroh-net): add Endpoint::watch_node_addr

Open Frando opened this issue 1 year ago • 2 comments

Description

This adds Endpoint::watch_node_addr which returns a stream that yields NodeAddr.

We have Endpoint::direct_addresses and Endpoint::watch_home_relay. In #2731 what I needed, and what I suspect apps will oftenly need, is the combination of both: Give me a stream that yields the endpoint's NodeAddr whenever it changes, either due to a change in our home relay, or due to a change in our discovered addresses.

Breaking Changes

Notes & open questions

  • A test would be good to add still

Change checklist

  • [x] Self-review.
  • [x] Documentation updates following the style guide, if relevant.
  • [ ] Tests if relevant.
  • [x] All breaking changes documented.

Frando avatar Sep 16 '24 13:09 Frando

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2732/docs/iroh/

Last updated: 2024-09-16T14:21:28Z

github-actions[bot] avatar Sep 16 '24 13:09 github-actions[bot]

Assigning to myself as @Frando is now OOO

flub avatar Sep 17 '24 09:09 flub

Closing this, as we now have the watcher based API

dignifiedquire avatar Dec 16 '24 11:12 dignifiedquire

FWIW, we do have the watcher-based API, but it's only in #3045 where I actually introduce an API that allows waiting for changes to the whole NodeAddr, instead of having to consolidate changes in direct_addresses and home_relay yourself.

matheus23 avatar Dec 16 '24 13:12 matheus23