P2P Mode (Beta)Run an API Node

P2P API Node Readiness

There is no supported partner/API-node distribution yet. Production grid-core runs a centralized FastAPI coordinator backed by PostgreSQL and Redis. The grid_api/services/p2p package is a default-off source prototype; setting P2P_ENABLED=true does not turn a host into a trusted production Grid node or move the live queue onto P2P.

What Exists

  • libp2p host, gossipsub topics, DHT/relay configuration, and direct-stream scaffolding;
  • an experimental Redis/P2P hybrid queue module;
  • in-memory job and claim tracking;
  • environment parsing for P2P_ENABLED, listen address, bootstrap peers, topic, DHT, relay, claim timeout, and job TTL.

What Is Missing

A partner-node release is blocked on:

  1. Persistent node keys that are actually loaded from P2P_PRIVATE_KEY_PATH.
  2. Base-backed operator/node authorization and key rotation.
  3. Signed canonical jobs, claims, results, and replay protection.
  4. Durable, shared billing/reservation and exactly-once settlement semantics across coordinators.
  5. A consistent worker/validator membership view rather than peer self-declaration.
  6. Protection against duplicate dispatch, conflicting claims, poison jobs, stale results, and split-brain operation.
  7. Multi-node integration, partition, reconnect, and malicious-peer tests.
  8. A versioned binary/container release, upgrade policy, monitoring, and incident runbook.

Safe Development Boundary

Local experiments must use synthetic, non-billed jobs and isolated Redis and PostgreSQL instances. Do not connect a prototype node to production, copy production credentials, advertise it as trusted, or route user traffic through it.

The authoritative implementation boundary is grid-core/grid_api/services/p2p/AGENTS.md. When the gates above are closed, this page can become a real install/configure/run guide for a signed release.