Meshnode Host Daemon (``node``) ================================ The ``node`` package (packaged as ``fleetmesh-node`` and executed as ``meshnode``) is the production host daemon. It coordinates 29 decoupled compartments across six architectural planes, orchestrates multi-rung network transport, manages local cryptographic enclaves, and hosts the control socket interface. Core Architectural Principles ----------------------------- * **Decoupled Compartments**: The node is not a monolithic application. Every capability lives inside an isolated compartment declaring explicit ``PARAMS``, ``CHANNELS``, ``METRICS``, ``COMMANDS``, and ``STORES``. * **Six Planes**: Compartments are arranged in six functional planes: * **Identity**: Announce, Discovery, Linked IDs, and Presence. * **Peering**: Session Handshake, Budgeting, Capacity Shedding, Reporter, Strain, and Trust. * **Operations**: Task Scheduler and Software Updates. * **Services**: Settlement, Paid Fetch, Sidecars, Compute Sandboxing, Compute Wire, DVM Gateways, Gossip, and nsite. * **Store**: Sync Reconciliation, Retention Policy, Blob Wire, and Blob Replication. * **Transport**: Link Watchdog, LAN Probing, P2P NAT Traversal, Sidecar Bridge, and Circuit Mediation. * **Multi-Rung Transport Ladder**: Traffic moves through a prioritized ladder of transports: 1. *FIPS/DoD Rung* (Rank 5): FIPS 140-3 TLS / mTLS and datagram peering. 2. *Iroh Rung* (Rank 10): High-speed direct QUIC connections with NAT hole punching. 3. *Rhio Rung* (Rank 12): NATS JetStream cluster synchronization via the Rhio sidecar. 4. *P2Panda Rung* (Rank 15): Peer-to-peer delivery over signed append-only operation chains. 5. *Relay Rung* (Rank 30): Standard Nostr relays via WebSockets (NIP-59 gift-wrap fallback). * **Control Socket & UCAN Authorization**: Local and remote control through Unix domain sockets with fine-grained capability checks. Meshnode Subsystems ------------------- .. list-table:: :widths: 25 75 :header-rows: 1 * - Subsystem - Documentation * - :doc:`Application Host ` - Host lifecycle, configuration assembler, control socket server, and systemd integration. * - :doc:`The Six Planes ` - Compartment implementations for Identity, Peering, Operations, Services, Store, and Transport planes. * - :doc:`Transport Subsystem ` - Router, multi-rung ladder, relay client/server, Iroh QUIC rung, and FIPS rung. * - :doc:`Storage Subsystem ` - SQLite, PostgreSQL, content locator, grant indexing, and accounting ledgers. * - :doc:`Pluggable Protocols ` - Pluggable protocol packages (``fleetmesh_node.protocols``) for p2panda, Rhio, Nostr, ATProto, ActivityPub, and SSB. * - :doc:`Nostr Protocol Layer ` - Relay client, peer tables, event storage, Blossom media server, and descriptor parsing. * - :doc:`Command Dispatcher ` - UCAN-gated CLI and RPC commands, subsystem command adapters, and execution context. * - :doc:`Compartment Framework ` - Component lifecycle (wired -> configured -> running -> teardown), needs, refusals, and stores. * - :doc:`Configuration System ` - Typed parameter blocks, hierarchical overrides, and atomic config change stores. * - :doc:`Channels & Metrics ` - In-memory event pub/sub bus, event journaling, Prometheus metrics, and status faces. * - :doc:`Keystore & Enclave ` - Master key derivation, seed generation, hardware enclave bindings, and signers. * - :doc:`Interfaces ` - Shared abstract interfaces and protocol boundaries. * - :doc:`CLI & Runner ` - Command-line parser, subcommands, and daemon management. Module Documentation -------------------- .. automodule:: node :members: :undoc-members: :show-inheritance: