feat(iroh-net): add Endpoint::watch_node_addr
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.
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
Assigning to myself as @Frando is now OOO
Closing this, as we now have the watcher based API
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.