Skip to content

feat(iroh)!: add MdnsDiscoveryBuilder::service_name method#3482

Merged
ramfox merged 5 commits intomainfrom
ramfox/mdns-service-name
Oct 1, 2025
Merged

feat(iroh)!: add MdnsDiscoveryBuilder::service_name method#3482
ramfox merged 5 commits intomainfrom
ramfox/mdns-service-name

Conversation

@ramfox
Copy link
Copy Markdown
Member

@ramfox ramfox commented Sep 30, 2025

Description

Changes the default service name to irohv1 as well as changing the provenance name to simply mdns.

Adds an MdnsDiscoveryBuilder::service_name method to allow users to use their own service name for their mDNS records.

This commit also narrows down the options to create an MdnsDiscovery service. Now you can only use MdnsDiscovery::builder (or MdnsDiscoveryBuilder::default()) to create an MdnsDiscoveryBuilder, then use the build() method to create the MdnsDiscovery service.

closes #3184

Breaking Changes

  • API changes
    • removed
      • MdnsDiscovery::new is now private
      • MdnsDiscoveryBuilder::new is now private
        • Use MdnsDiscovery::builder() to create an MdnsDiscoveryBuilder
        • Use MdnsDiscoveryBuilder::default() to create an MdnsDiscoveryBuilder
    • added MdnsDiscoveryBuilder::service_name()
  • wire breaking changes
    • Default service name changed from iroh.local.swarm to irohv1
    • Provenance field name in DiscoveryItem changed from local.swarm.discovery to mdns

Notes & open questions

  • Are we down with irohv1 or is iroh.v1 prettier 😂 ?
  • I removed the MdnsDiscovery::new method from the public API, so there are only two ways to build an MdnsDiscovery now, which are:
MdnsDiscovery::builder().build()
MdnsDiscoveryBuilder::default()::build()

My question is: is MdnsDiscovery::builder().build() too ugly? Or am I just being extra in not loving it? Should I add the MdnsDiscovery::new() method back?

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.

“ramfox” added 2 commits September 29, 2025 22:13
This commit also narrows down the options to create an `MdnsDiscovery` service.
Now you must use `MdnsDiscovery::builder` to create an `MdnsDiscoveryBuilder`,
then use the `build()` method to create the `MdnsDiscovery` service.

This also changes the default service name to `irohv1` as well as changing the
provenance name to simply `mdns`.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 30, 2025

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

Last updated: 2025-09-30T16:14:28Z

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 30, 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: 117ae17

@n0bot n0bot bot added this to iroh Sep 30, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Sep 30, 2025
@ramfox ramfox self-assigned this Sep 30, 2025
@ramfox ramfox moved this from 🏗 In progress to 👀 In review in iroh Sep 30, 2025
@ramfox ramfox added this to the v0.99.0 milestone Sep 30, 2025
@ramfox ramfox linked an issue Sep 30, 2025 that may be closed by this pull request
@dignifiedquire
Copy link
Copy Markdown
Contributor

  • Are we down with irohv1 or is iroh.v1 prettier 😂 ?

no strong preference from my side

@Frando
Copy link
Copy Markdown
Member

Frando commented Oct 1, 2025

I think irohv1 is good, the domain separation with a dot is more noisy IMO. And builder only is fine IMO.

@ramfox ramfox added this pull request to the merge queue Oct 1, 2025
Merged via the queue into main with commit 9a88cc5 Oct 1, 2025
52 of 55 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in iroh Oct 1, 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.

Review swarm name for local swarm discovery

3 participants