docs: use preset.client_builder in examples - #100
Open
okdistribute wants to merge 7 commits into
Open
Conversation
|
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
okdistribute
force-pushed
the
examples-use-preset-client-builder
branch
from
August 11, 2026 18:55
fafa280 to
24fe9a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 gotMissing remote endpoint to dialwhich 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.
preset.client_builder(&endpoint). net_diagnostics no longer parses anApiSecretseparatelyiroh::endpoint::presets::N0and defaults to the public n0 relay map, so leavingrelaysunset is plainN0plus a project access token. Nothing said this before.No API changes.
client_builderalready existed, the examples just didn't use it.