Skip to content

docs: use preset.client_builder in examples - #100

Open
okdistribute wants to merge 7 commits into
mainfrom
examples-use-preset-client-builder
Open

docs: use preset.client_builder in examples#100
okdistribute wants to merge 7 commits into
mainfrom
examples-use-preset-client-builder

Conversation

@okdistribute

@okdistribute okdistribute commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The preset already holds the API secret, but the examples reached for Client::builder(&endpoint), which starts blank. So you had to pass the secret twice, and if you didn't, you got Missing remote endpoint to dial which was confusing. This will get more confusing with multitenant relays.

By moving to this, the multitenant relays are just a copy/paste to replace the endpoint and preset creation.

  • quickstart and net_diagnostics: build a preset, bind, then preset.client_builder(&endpoint). net_diagnostics no longer parses an ApiSecret separately
  • relays: the public-relay preset is now the runnable default. The custom-relay path needed real URLs pasted in before it would work, so it becomes the commented variant.
  • preset docs: note that the preset applies iroh::endpoint::presets::N0 and defaults to the public n0 relay map, so leaving relays unset is plain N0 plus a project access token. Nothing said this before.

No API changes. client_builder already existed, the examples just didn't use it.

@okdistribute
okdistribute requested review from Arqu, Frando and b5 August 11, 2026 18:53
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

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

Last updated: 2026-08-11T18:57:38Z

The preset already carries the API secret (and the iroh-services endpoint
address inside it), but the examples reached for `Client::builder`, which
starts blank — so users had to pass the secret a second time, and got
"Missing remote endpoint to dial" if they didn't.

- quickstart & net_diagnostics: build a preset, bind, then
  `preset.client_builder(&endpoint)`
- relays: make the public-relay preset the runnable default; custom relays
  (which needed real URLs pasted in) become the commented variant
- document that the preset applies `presets::N0` and defaults to the public
  n0 relay map, so leaving `relays` unset is N0 plus a project token

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013v7ddeybubCTeoMrC8KPpS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant