Skip to content

refactor: Make Endpoint::node_addr sync and infallible, and add Endpoint::node_addr_initialized#3192

Closed
Frando wants to merge 6 commits into
mainfrom
Frando/node-addr-sync
Closed

refactor: Make Endpoint::node_addr sync and infallible, and add Endpoint::node_addr_initialized#3192
Frando wants to merge 6 commits into
mainfrom
Frando/node-addr-sync

Conversation

@Frando

@Frando Frando commented Feb 19, 2025

Copy link
Copy Markdown
Member

Description

This makes Endpoint::node_addr a synchronous, infallible function that always returns the current state of the endpoint's node address. Right after binding that node address might be empty, because neither the home relay nor our direct addresses are yet determined.

Therefore, we add a async fn node_addr_initialized(&self) that waits for either the home relay or the direct addresses to be initialized.

Alternative to #3190

Breaking Changes

  • Endpoint::node_addr now is sync and infallible. If you want to wait for the address to be initialized, await Endpoint::node_addr_initialized before.

Notes & open questions

Change checklist

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

@github-actions

github-actions Bot commented Feb 19, 2025

Copy link
Copy Markdown

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

Last updated: 2025-02-19T13:53:47Z

@github-actions

Copy link
Copy Markdown

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 5fd3cd7

@Frando

Frando commented Jun 23, 2025

Copy link
Copy Markdown
Member Author

This was implemented as part of #3279: Endpoint::node_addr now returns a Watcher.

@Frando Frando closed this Jun 23, 2025
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in iroh Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant