Skip to main content

Module lazy_iroh

Module lazy_iroh 

Source
Expand description

Lazy-connecting iroh RPC transport (optional NAT-traversing dial).

Mirrors LazyQuinnTransport: the dial factory is synchronous, so this holds the dial target (the peer’s EndpointId + addresses) and connects on the first send(), caching the session — preserving sync, zero-I/O construction.

§The shared client endpoint

Unlike quinn (where connect_pinned_sha256 builds its own one-shot client), iroh dials from a long-lived [iroh::Endpoint] that holds its transport secret and bound sockets. There is exactly one client endpoint per process; it is installed once at startup via install_iroh_client_endpoint (the daemon provisions it during bootstrap), the same install-once pattern as the inproc registry and the envelope verify config. Until it is installed, the iroh dial arm errors loudly rather than silently falling back.

§Target integrity

iroh binds the connection to the peer’s EndpointId (its Ed25519 public key), proving the dial reached the configured carrier address. This is path integrity only. It does not authenticate a DID, admission subject, assurance level, response key, or authorization identity (#1031).

Re-dial/self-heal semantics match LazyQuinnTransport: a per-request timeout keeps the session; a transport-fatal error drops it so the next call re-dials. Refined liveness-based re-dial + backoff is #156’s job.

Structs§

LazyIrohTransport
An iroh RPC transport that connects on first use and caches the session.

Enums§

IrohPeerUnavailable
Availability failures before a request is dispatched. This deliberately excludes malformed addresses, missing client setup, peer authentication, ALPN rejection, and all errors after connection establishment.

Functions§

install_iroh_client_endpoint
Install the process-global client iroh endpoint used to originate outbound RPC dials. First-write-wins (mirrors install_verify_config); returns Err(endpoint) if one is already set.