Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Frando
Copy link
Member

@Frando Frando commented Feb 19, 2025

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.

Copy link

github-actions bot commented Feb 19, 2025

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

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

1 participant