Skip to main content

Module endpoint

Module endpoint 

Source
Expand description

One-shot client Endpoint construction: relay + discovery resolution for the cdn/client/v1 and cdn/probe/v1 dial paths (#935/#936). Shared relay resolution for the one-shot client commands (fetch, probe).

Relays are environment configuration, not a per-invocation decision (#935): they come from the config file (network.relay_urls), exactly the field the node already consumes. --relay-url stays as an optional override that replaces the config list. An absent config file yields no relays, so a client that dials a direct --addr needs no config at all.

Functionsยง

client_discovery
Resolve [network.discovery] for a client command, tolerating a missing config exactly like resolve_relays: an explicit --config path that does not exist yields no discovery overrides (โ†’ presets::N0), so a client that dials a direct --addr needs no config at all.
client_endpoint
Build a one-shot client Endpoint that can resolve a target node by its iroh NodeId. With no [network.discovery] config we use presets::N0 (the n0-hosted pkarr/DNS lookup the node defaults to); with operator discovery configured we compose only the resolution legs onto presets::Minimal.
resolve_relays
Resolve the relay URLs for a client command. The --relay-url override (flag) wins; otherwise network.relay_urls from the config is used. An absent config file โ€” including an explicit --config path that does not exist โ€” resolves to an empty list rather than an error, so a client dialing a direct --addr needs no config at all.