Expand description
Peer node configuration.
Structs§
- Config
- Config
Args - Config
Paths - Config
Paths Args - Config
Paths Iter - Gateway
Config - Global
Executor - Global async executor abstraction for spawning tasks.
- Global
Rng - Global RNG abstraction for deterministic simulation testing.
- Global
Simulation Time - Global simulation time configuration for deterministic testing.
- Global
Test Metrics - Global test metrics for tracking events across the simulation network.
- Inline
GwConfig - Network
ApiConfig - Network
Args - Secret
Args - Secrets
- Persisted secrets bundle (transport keypair + the legacy cipher/nonce fields kept for read-side decrypt of pre-#4140 blobs).
- Seed
Guard - RAII guard that clears the GlobalRng seed when dropped.
- Simulation
Idle Timeout - Extended idle timeout for simulation connections.
- Simulation
Transport Opt - Opt-in transport timer optimization for large-scale simulations.
- Telemetry
Args - Telemetry
Config - Websocket
ApiArgs - Websocket
ApiConfig - WsApi
Exposure - How this boot decided the client API’s exposure, for reporting once logging
exists. RUNTIME-ONLY (
#[serde(skip)], likeWebsocketApiConfig::secrets_dir): it describes this boot’s resolution, not operator-authored TOML.
Enums§
- Address
- A gateway address as it appears in
gateways.toml. - KekBackend
Kind - 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
- WsApi
Address Source - 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.
loadreturnsOk(None)when no KEK exists yet (first start); the resolver then callsstoreto 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. ReturnsOk(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 byfreenet secrets kek-migrateafter the target backend has successfully stored the migrated KEK. Writes to a sibling.tmpfile with the same 0o600 perms +sync_alldiscipline aswrite_backend_marker, thenrenames onto the live marker (atomic on POSIX,MoveFileExW MOVEFILE_REPLACE_EXISTINGon 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 successfullystores a freshly generated one. The selected backend is returned along with the KEK so the caller can persist theKekBackendKindin node config. - set_
logger - write_
backend_ marker - Write the chosen backend kind to
secrets_dir/kek_backend. UsesOpenOptions::create_newso a pre-existing marker is preserved — callers performing migration are expected to go throughreplace_backend_marker, which handles atomic overwrite.