Skip to main content

Module config

Module config 

Source
Expand description

Peer node configuration.

Structs§

Config
ConfigArgs
ConfigPaths
ConfigPathsArgs
ConfigPathsIter
GatewayConfig
GlobalExecutor
Global async executor abstraction for spawning tasks.
GlobalRng
Global RNG abstraction for deterministic simulation testing.
GlobalSimulationTime
Global simulation time configuration for deterministic testing.
GlobalTestMetrics
Global test metrics for tracking events across the simulation network.
InlineGwConfig
NetworkApiConfig
NetworkArgs
SecretArgs
Secrets
Persisted secrets bundle (transport keypair + the legacy cipher/nonce fields kept for read-side decrypt of pre-#4140 blobs).
SeedGuard
RAII guard that clears the GlobalRng seed when dropped.
SimulationIdleTimeout
Extended idle timeout for simulation connections.
SimulationTransportOpt
Opt-in transport timer optimization for large-scale simulations.
TelemetryArgs
TelemetryConfig
WebsocketApiArgs
WebsocketApiConfig
WsApiExposure
How this boot decided the client API’s exposure, for reporting once logging exists. RUNTIME-ONLY (#[serde(skip)], like WebsocketApiConfig::secrets_dir): it describes this boot’s resolution, not operator-authored TOML.

Enums§

Address
A gateway address as it appears in gateways.toml.
KekBackendKind
Tag identifying which backend currently holds the KEK. Persisted in the node config so a transient outage of a stronger backend cannot silently demote to a weaker one. To change backends, operators run freenet secrets kek-migrate --to <kind>.
KekError
WsApiAddressSource
How [resolve_ws_api_address] arrived at the client-API bind address.

Constants§

DEFAULT_GATEWAY_PORT
Default UDP port a gateway listens on.
DEFAULT_MAX_CONNECTIONS
Default maximum number of connections for the peer.
DEFAULT_MAX_HOPS_TO_LIVE
Default maximum number of hops to live for any operation (if it applies, e.g. connect requests).
DEFAULT_MIN_CONNECTIONS
Default minimum number of connections for the peer.
DEFAULT_RANDOM_PEER_CONN_THRESHOLD
Default threshold for randomizing potential peers for new connections.
DEFAULT_TELEMETRY_ENDPOINT
Default telemetry endpoint (nova.locut.us OTLP collector). Using domain name for resilience to IP changes.
KEK_SIZE
Length of the node KEK in bytes. Matches XChaCha20-Poly1305 key size so the KEK can directly key the HKDF input.

Traits§

KekBackend
Behavior every KEK backend MUST implement. load returns Ok(None) when no KEK exists yet (first start); the resolver then calls store to seed one.

Functions§

default_network_api_port
default_webapp_cache_dir
Default directory for unpacked web-contract bundles.
ensure_kek_loaded
End-to-end KEK acquisition. On first start (no marker present) this runs the fallback resolver, persists the chosen backend kind, and returns the KEK. On subsequent starts it reads the marker and loads strictly from the recorded backend — a load failure here is a hard boot error.
load_from_backend
Load the KEK from a pre-selected backend. Used on every start after the first. A failure here MUST be surfaced as a hard error — the caller (config layer) must not silently fall back to another backend, since that would re-derive different DEKs and make every existing delegate secret unreadable.
read_backend_marker
Read the persisted backend choice from secrets_dir/kek_backend. Returns Ok(None) if the marker does not exist yet (first-start flow). Returns an error if the marker exists but contains an unrecognized value, so a corrupt marker fails the boot rather than silently demoting to file backend.
replace_backend_marker
Atomically replace the persisted backend marker with kind. Used by freenet secrets kek-migrate after the target backend has successfully stored the migrated KEK. Writes to a sibling .tmp file with the same 0o600 perms + sync_all discipline as write_backend_marker, then renames onto the live marker (atomic on POSIX, MoveFileExW MOVEFILE_REPLACE_EXISTING on Windows).
resolve_first_start
Walk the preferred backend chain and return the first one that successfully loads an existing KEK, OR the first one that successfully stores a freshly generated one. The selected backend is returned along with the KEK so the caller can persist the KekBackendKind in node config.
set_logger
write_backend_marker
Write the chosen backend kind to secrets_dir/kek_backend. Uses OpenOptions::create_new so a pre-existing marker is preserved — callers performing migration are expected to go through replace_backend_marker, which handles atomic overwrite.