IrohEndpointConfig

Configuration for the shared per-instance iroh endpoint (key-addressed QUIC: peers dial the endpoint’s public key — its NodeId — rather than an ip:port; reachability via hole-punching with relay fallback). Setup is idempotent: the first configuration wins, and every field is optional — unset fields fall back to the NORSK_IROH_* environment, then to defaults (fresh unpersisted identity; inbound rejected until an allow-list is set).

Field

Type

Repeated

Description

secret_key_file

string

Path to the identity key file (32-byte secret, hex-encoded). Load-or-generate: if the file doesn’t exist a fresh key is created there (mode 0600), so a stable NodeId survives restarts.

relay_mode

string

"default" (relays + discovery — publicly reachable) or "disabled" (direct paths only: loopback/LAN).

allowed_peers

string

Verified remote NodeIds (64-char hex) allowed to connect inbound.

allow_any_peer

bool

Explicit opt-in to accept ANY peer (never the default).

allowed_peers_file

string

Path to an allow-list file (one hex NodeId per line, # comments).

relay_urls

string

Self-hosted relay server URLs (https). Setting these uses YOUR relays and disables n0’s discovery services entirely — peers are then reached via addr hints (iroh://<node_id>?addr=<relay_url>). Wins over relay_mode; combining with relay_mode "disabled" is an error.

Argument of

Method

Description

SetupIrohEndpoint

Start (or return) the shared per-instance iroh endpoint — the key-addressed QUIC identity every default iroh dial presents and remote peers dial into (iroh://<node_id>). Idempotent: if the endpoint is already running its info is returned and the new config is ignored (first configuration wins). Endpoint-level connection events arrive on the status channel (NorskStatusEvent.iroh_endpoint_event).