Pluggable Protocol Packages (``fleetmesh_node.protocols``) ================================================ The ``fleetmesh_node.protocols`` package provides a modular runtime architecture enabling Fleetmesh nodes to speak multiple decentralized protocol dialects without monolithic coupling. Every protocol suite implements the :class:`fleetmesh_core.wire.interfaces.ProtocolPackage` contract, decoupling protocol-specific ingress, storage adapters, transport rungs, and identity models from the meshnode host daemon. Protocol Lifecycle & Extension Points ------------------------------------- A protocol package exposes the following capabilities to the node host: 1. **Declarative Configuration**: Activated via the ``protocol_suites`` block in ``config.json``. A disabled protocol consumes zero ports, zero threads, and zero storage. 2. **Ingress Mounting**: Mounts HTTP and WebSocket routes onto :class:`fleetmesh_node.transport.host.ProtocolHost` via longest-prefix path matching. 3. **Transport Ladder Rung**: Contributes an outbound delivery rung to :class:`fleetmesh_node.transport.router.TransportRouter`. 4. **Storage Adapter**: Attaches native event, CAS blob, or append-only log databases. 5. **Identity Adapter**: Translates Fleetmesh node keys (secp256k1, X25519, Ed25519) into native author identities. 6. **Descriptor Capabilities**: Advertises native capabilities (e.g. ``["c", "p2panda"]``, ``["c", "rhio"]``) on the node's signed descriptor. .. list-table:: :widths: 20 20 20 40 :header-rows: 1 * - Protocol Suite - Standards - Transport Rank - Primary Features * - ``p2panda`` - ``p2panda-v0.4.0`` - 15 (Log Chain) - Append-only operation logs, canonical CBOR encoding, Ed25519 signatures, HTTP/CBOR ingress. * - ``rhio`` - ``rhio-nats-v1``, ``bao-tree-hash`` - 12 (Cluster Sync) - Micro-datacenter cluster replication, Bao Merkle tree CAS storage, NATS JetStream sidecar bridge, MinIO/S3 sync. * - ``nostr`` - NIP-01..77, BUD-01..04 - 30 (Relay Fallback) - Embedded relay server, event persistence, Blossom media storage, peer table synchronization. * - ``atproto`` - ATProto v1, MST - 20 (XRPC) - XRPC HTTP endpoints, Merkle Search Trees, DID resolution (``did:plc``, ``did:web``), repo subscriptions. * - ``activitypub`` - W3C ActivityPub, LD-Signatures - 25 (Fediverse) - Actor model, WebFinger discovery, ActivityStreams 2.0 JSON-LD, HTTP Signatures. * - ``ssb`` - SSB SHS, Box Stream - 18 (P2P Log) - Secret Handshake (SHS), MuxRPC over TCP, append-only feed validation. Package Registry & Manager -------------------------- .. automodule:: fleetmesh_node.protocols :members: :undoc-members: :show-inheritance: p2panda Protocol Suite (``fleetmesh_node.protocols.p2panda``) --------------------------------------------------- .. experimental:: The ``p2panda`` package integrates the p2panda peer-to-peer protocol into Fleetmesh: * **Package & Ingress**: :class:`fleetmesh_node.protocols.p2panda.package.P2PandaProtocolPackage` mounts ``GET /p2panda/status`` and ``GET / POST /p2panda/operations`` (supporting JSON and CBOR, as well as REST permalinks ``/p2panda/operations/`` and ``/p2panda/operations/``). * **Operation Log Store**: :class:`fleetmesh_node.protocols.p2panda.store.P2PandaLogStore` manages thread-safe SQLite persistence for operation headers, monotonic sequence numbers, and payload bodies. * **Identity Adapter**: :class:`fleetmesh_node.protocols.p2panda.identity.P2PandaIdentityAdapter` translates the node's Ed25519 transport key to a 64-character hex author ID. * **Transport Rung**: :class:`fleetmesh_node.protocols.p2panda.rung.P2PandaRung` delivers messages wrapped as signed p2panda operations at rank 15 in the transport ladder. .. automodule:: fleetmesh_node.protocols.p2panda.package :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.p2panda.store :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.p2panda.identity :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.p2panda.rung :members: :undoc-members: :show-inheritance: Rhio Protocol Suite (``fleetmesh_node.protocols.rhio``) --------------------------------------------- .. experimental:: The ``rhio`` package integrates HIRO MicroDataCenters Rhio cluster synchronization: * **Package & Ingress**: :class:`fleetmesh_node.protocols.rhio.package.RhioProtocolPackage` mounts ``GET /rhio/status``, ``GET / POST /rhio/blobs`` (supporting streaming binary blobs, base64 JSON, and permalinks ``/rhio/blobs/``), and ``GET /rhio/sync``. * **CAS Blob & Tree Sync**: :class:`fleetmesh_node.protocols.rhio.store.RhioBlobSync` manages local Content-Addressable Storage (CAS) with SQLite metadata and S3/MinIO cluster synchronization state. * **Bao Merkle Tree Hashing**: :class:`fleetmesh_node.protocols.rhio.store.RhioBaoTree` computes hierarchical chunked Merkle trees (1024-byte chunks) compatible with Bao for streaming verification. * **Transport Rung**: :class:`fleetmesh_node.protocols.rhio.rung.RhioRung` delivers messages to remote cluster peers via NATS JetStream pub/sub at rank 12. .. automodule:: fleetmesh_node.protocols.rhio.package :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.rhio.store :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.rhio.rung :members: :undoc-members: :show-inheritance: Nostr Protocol Suite (``fleetmesh_node.protocols.nostr``) ----------------------------------------------- .. automodule:: fleetmesh_node.protocols.nostr.package :members: :undoc-members: :show-inheritance: AT Protocol Suite (``fleetmesh_node.protocols.atproto``) ---------------------------------------------- .. experimental:: .. automodule:: fleetmesh_node.protocols.atproto.package :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.atproto.repo :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.atproto.xrpc :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.atproto.firehose :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.atproto.metering :members: :undoc-members: :show-inheritance: ActivityPub Protocol Suite (``fleetmesh_node.protocols.activitypub``) ----------------------------------------------------------- .. experimental:: .. automodule:: fleetmesh_node.protocols.activitypub.package :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.activitypub.actor :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.activitypub.federation :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.activitypub.inbox :members: :undoc-members: :show-inheritance: Secure Scuttlebutt Suite (``fleetmesh_node.protocols.ssb``) ------------------------------------------------- .. experimental:: .. automodule:: fleetmesh_node.protocols.ssb.package :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.protocols.ssb.muxrpc :members: :undoc-members: :show-inheritance: Protocol Sidecar Daemons (``sidecar``) -------------------------------------- .. automodule:: fleetmesh_node.sidecar.fleetmesh_rhio :members: :undoc-members: :show-inheritance: .. automodule:: fleetmesh_node.sidecar.fleetmesh_ssb :members: :undoc-members: :show-inheritance: