Declarative Manifests & CRDs ============================== Fleetmesh embraces declarative configuration patterns familiar to Kubernetes and cloud-native operators. Instead of configuring imperative shell scripts or stateful database flags, infrastructure is defined as version-controlled YAML manifests using the normative API group: .. code-block:: yaml apiVersion: fleetmesh.org/v1alpha1 Manifest Resources ------------------ The repository defines six core Custom Resource Definitions (CRDs) located in ``schema/manifests/``: .. list-table:: :widths: 25 75 :header-rows: 1 * - Resource Kind - Purpose * - **``MeshNode``** - Primary node declaration specifying identity keys, listening endpoints, storage backends, and enabled sidecars. * - **``Peering``** - Bilateral peering declaration defining target peer DIDs, transport preference ladders, and bandwidth rate caps. * - **``GrantPolicy``** - Automated capacity allocation rules, token pricing schedules, and credit thresholds. * - **``ComputeProvider``** - Verifiable execution node advertisement declaring supported runtimes (Wasm, ZK, Docker), hardware resources, and memory limits. * - **``InferenceRouter``** - Decentralized AI inference routing rules matching prompts to distributed model providers (Routstr integration). * - **``WorkloadRouter``** - Generic task dispatching rules routing asynchronous jobs to verified worker pools. MeshNode Specification ---------------------- The `MeshNode` resource defines a host daemon's operating parameters. .. code-block:: yaml apiVersion: fleetmesh.org/v1alpha1 kind: MeshNode metadata: name: node-bristol-anchor namespace: default spec: class: anchor storage: engine: sqlite path: /var/lib/fleetmesh/store.sqlite transports: - type: iroh bind: "0.0.0.0:11801" - type: ws bind: "0.0.0.0:7777" sidecars: - name: grasp type: git-http endpoint: "https://git.fleetmesh.org" - name: blossom type: blob endpoint: "https://blob.fleetmesh.org" policy: max_event_bytes: 262144 enforce_signatures: true Peering Specification --------------------- The `Peering` resource manages a bilateral connection to a specific peer identity. .. code-block:: yaml apiVersion: fleetmesh.org/v1alpha1 kind: Peering metadata: name: peer-london-edge spec: peer: "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK" transports: - iroh - ws ingress: max_rate_bytes: 10485760 allowed_kinds: [11801, 21801, 31801, 30801] egress: max_rate_bytes: 10485760 budget: sat_ceiling: 50000 window_seconds: 3600 GrantPolicy Specification ------------------------- The `GrantPolicy` resource automates capacity provisioning, granting credit to peers that satisfy specific criteria. .. code-block:: yaml apiVersion: fleetmesh.org/v1alpha1 kind: GrantPolicy metadata: name: default-grant-policy spec: tiers: - tier: T0 name: "Bootstrap" max_credit_sats: 1000 allowed_kinds: [11801, 21801] - tier: T1 name: "Standard Peer" max_credit_sats: 50000 settlement_interval_hours: 24 pricing: base_relay_msat_per_kb: 10 paid_fetch_msat: 100 ComputeProvider Specification ----------------------------- Advertises a node's availability to execute sandboxed computation for network participants: .. code-block:: yaml apiVersion: fleetmesh.org/v1alpha1 kind: ComputeProvider metadata: name: provider-wasm-zk spec: runtimes: - name: wasm engine: wasmtime max_memory_mb: 512 timeout_sec: 30 - name: zk-snark engine: groth16 curves: [bn254, bls12-381] pricing: msat_per_second: 50 Validating Manifests -------------------- All YAML manifests can be validated against formal JSON schemas using `scripts/check-manifests.py`: .. code-block:: sh python3 schema/scripts/check-manifests.py