Skip to content

Conversation

dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented Oct 10, 2025

Description

Closes #3470

Breaking Changes

  • removed
    • iroh::endpoint::Builder::n0_discovery
    • iroh::endpoint::Builder::discovery_dht
    • iroh::endpoint::Builder::discovery_local_network
    • iroh::endpoint::Builder::discovery
    • iroh::discovery::DiscoveryContext
    • iroh::endpoint::Builder::default
  • added
    • iroh::Endpoint::bind - this allows to immediately create an Endpoint with the defaults and binds it
    • iroh::endpoint::Endpoint::empty_builder
    • iroh::endpoint::presets - new module, defining a trait on how to preconfigure and Endpoint
    • iroh::endpoint::Builder::new - creates a new builder with the N0 preset
    • iroh::endpoint::Builder::preset
    • iroh::endpoint::Builder::empty - creates a new builder, completely empty (no discovery, no relay map)
  • changed
    • iroh::'Endpoint::add_discovery is now called just discovery
    • iroh::discovery::IntoDiscovery now takes an Endpoint instead of a DiscoveryContext

@dignifiedquire dignifiedquire self-assigned this Oct 10, 2025
@dignifiedquire dignifiedquire added this to the v0.94 milestone Oct 10, 2025
Copy link

github-actions bot commented Oct 10, 2025

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

Last updated: 2025-10-14T09:04:49Z

Copy link

github-actions bot commented Oct 10, 2025

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: 981c63e

@n0bot n0bot bot added this to iroh Oct 10, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Oct 10, 2025
/// Defines a preset
pub trait Preset {
/// Applies the configuration to the passed in [`Builder`].
fn apply(self, builder: Builder) -> Builder;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for preset to take self and not &self?

Imagine you had a complex preset, you would have to clone it to apply it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing specific, I was just expecting them to be use once only

@dignifiedquire dignifiedquire marked this pull request as ready for review October 14, 2025 08:54
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.

replace iroh::endpoint::Builder::discovery_n0 with a more declarative API

2 participants