Rename the --transport n0 value to relay and say what n0 means

"n0" is Number 0, the company behind iroh, and the name leaked from iroh's
own preset into this project's user interface, where it explains nothing.
The value is now --transport relay, which says what it does; n0 stays as an
accepted alias.

Also spells out, in the CLI help, the README, the threat model and the
TransportPolicy docs, whose infrastructure is involved: address records are
published to and resolved from dns.iroh.link, and the fallback relays are
Number 0's, in the US, EU and Asia-Pacific.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
tsunagi
2026-09-21 12:17:01 +01:00
co-authored by Claude Opus 5
parent 5cc92d7067
commit fae62892e0
4 changed files with 35 additions and 24 deletions
+10 -8
View File
@@ -72,17 +72,19 @@ impl PathArgs {
/// How much external connectivity machinery the endpoint may use.
///
/// `direct` and `n0` publish this endpoint's addresses, keyed by its endpoint
/// id, to Number 0's public lookup service, and resolve peers through it.
/// That is what makes `--peer <endpoint-id>` work without an address.
/// `direct` and `relay` publish this endpoint's addresses, keyed by its
/// endpoint id, to the public lookup service run by Number 0 — the company
/// behind iroh — at `dns.iroh.link`, and resolve peers through it. That is
/// what makes `--peer <endpoint-id>` work without an address.
#[derive(Debug, Clone, Copy, ValueEnum)]
enum Transport {
/// Loopback and the local network only. Publishes nothing.
Local,
/// Public address lookup, but no relays.
/// Public address lookup, direct paths only, no relays.
Direct,
/// iroh's defaults: public address lookup plus the public n0 relays.
N0,
/// Public address lookup plus public relay fallback. The default.
#[value(alias = "n0")]
Relay,
}
impl From<Transport> for TransportPolicy {
@@ -90,7 +92,7 @@ impl From<Transport> for TransportPolicy {
match value {
Transport::Local => TransportPolicy::LocalOnly,
Transport::Direct => TransportPolicy::DirectOnly,
Transport::N0 => TransportPolicy::N0Defaults,
Transport::Relay => TransportPolicy::N0Defaults,
}
}
}
@@ -122,7 +124,7 @@ struct UpArgs {
hostname: Option<String>,
/// How much external connectivity to use.
#[arg(long, value_enum, default_value_t = Transport::N0)]
#[arg(long, value_enum, default_value_t = Transport::Relay)]
transport: Transport,
/// A peer to contact, as `<endpoint-id>` or `<endpoint-id>@<ip:port>,...`.
+12 -5
View File
@@ -89,12 +89,19 @@ pub enum TransportPolicy {
/// Suitable for tests and for fully local deployments.
#[default]
LocalOnly,
/// No relays, but the n0 DNS/pkarr address lookup is enabled.
DirectOnly,
/// iroh's standard behaviour, including the public n0 relays.
/// Public address lookup, but no relays.
///
/// Public relays are fine for development; they carry no availability
/// guarantee.
/// Enables iroh's DNS/pkarr address lookup against the public service run
/// by Number 0 (the company behind iroh) at `dns.iroh.link`. This endpoint
/// publishes a signed record of its own addresses there, so peers can dial
/// it by endpoint id alone.
DirectOnly,
/// iroh's standard behaviour: public address lookup plus public relays.
///
/// Maps to iroh's own `presets::N0`. As well as the address lookup above,
/// it uses Number 0's public relay servers as a fallback when a direct
/// path cannot be hole punched. They are fine for development and carry no
/// availability guarantee.
N0Defaults,
}