Skip to content

decdn fetch/probe: source iroh relay URLs from config, not a CLI flag #935

Closed

Description

@alpergundogdu

Summary

The client-side one-shot commands (decdn fetch, #391; decdn probe) take --relay-url as a per-invocation flag. The relay set is environment configuration, not a per-call decision — it should come from the config file, with the flag (if kept) demoted to an override.

Context

  • The config schema already models this: relay_urls: Option<Vec<String>> (with a deprecated single-relay_url alias), resolved into ResolvedConfig.relay_urls: Vec<String> — empty means "n0 default relays", non-empty swaps in self-hosted relays via RelayMode::Custom. The node already consumes it (crates/common/src/config/{types,resolved}.rs).
  • The client commands don't: probe and the new fetch build RelayMode from the --relay-url flag alone and never read config.

Proposal

  • decdn fetch and decdn probe load relay_urls from the resolved config (honoring the global --config), building RelayMode::Custom from the list (or Disabled / n0-default when empty), mirroring the node.
  • Keep --relay-url only as an optional override (or drop it — TBD), and drop it from the required --addr | --relay-url ArgGroup once config can supply the relay.
  • Multiple relays already work in config; this issue is just making the client commands consume them.

Out of scope

  • Client-side multi-relay failover/health policy (the node already warns-and-continues; revisit only if clients need more).

Activity

  1. added
    kind:feature
    prio:medium
    area:cli
    on Jun 17, 2026
  2. thiras commented on Jun 20, 2026

    @thiras
    Contributor

    Closing as already implemented. The client one-shot commands now source relay URLs from config exactly as proposed here — delivered by #938 (standalone decdn fetch + config-sourced relays, commit b842846) with the client-discovery follow-up #936.

    Acceptance points verified against the current tree:

    Proposal point Evidence
    fetch + probe load relay_urls from resolved config, honoring --config crates/cli/src/commands/client_endpoint.rs resolve_relays(flag, config_path); called by probe.rs and fetch.rs
    RelayMode::Custom from the list, disabled/n0-default when empty client_endpoint.rs relay_mode() + endpoint builder
    Deprecated singular relay_url folded into the list client_endpoint.rs (net.relay_urls else net.relay_url.into_iter().collect())
    --relay-url demoted to optional override crates/common/src/cli/{probe,fetch}.rs — relay_url: Option<String>
    Dropped from the required --addr | --relay-url ArgGroup crates/common/src/cli/probe.rs / fetch.rs: relay presence is "validated at runtime rather than by a clap ArgGroup, because the relay can also come from config (#935)"

    cargo build -p decdn-cli and cargo nextest run -p decdn-cli -p decdn-common pass. No remaining work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clikind:featureprio:medium

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions