Storage and configuration
The implementation selects local storage only when bothTSN_RECEIVER_STORE=file and TSN_ALLOW_LOCAL_JSON_STORE=true. TSN_RECEIVER_LOCAL_FILE selects the local JSON file. Firebase operation requires FIREBASE_PROJECT_ID, FIREBASE_CLIENT_EMAIL and FIREBASE_PRIVATE_KEY; configure those server-side through the deployment environment. The local implementation supports controlled development and does not establish shared, multi-process production durability.
TSN_RECEIVER_COLLECTION and TSN_RECEIVER_STATE_COLLECTION identify work and Node state collections. TSN_RECEIVER_NODE_API_KEY authenticates Node work/state requests. TSN_NODE_VERIFICATION_PUBLIC_KEY verifies Node decisions, while TSN_RECEIVER_NODE_PAYLOAD_KEY protects stored Node envelopes. These roles are separate: an API key does not make a decision signature valid. Node primary/fallback URLs, the selected RPC and existing program ID must agree with the worker and chain configuration.
Use the existing environment example for variable names and the storage-mode runbook for deployment constraints. Example URLs and IDs describe configuration, not verified current availability. Keep private keys, payload keys and service tokens out of browser builds and logs.
Build, tests and launch
These commands are existing root scripts; execute the launch command only when operating the intended environment:Observe and diagnose
After repairing root-selected snapshots or the TCAP asset-layout preflight,POST /api/internal/node/work/retry can requeue a settlement rejected with GPRU_HIDDEN_HEAD_WITNESS_UNAVAILABLE: or the exact reason TCAP settlement asset is unavailable or its reserve binding is invalid. It requires TSN_RECEIVER_NODE_API_KEY and JSON {id, expectedVersion}. Receiver requires the original confirmed funding, deterministic settlement lineage and unchanged payload commitment, rejects execution state or other rejection reasons, preserves the rejection in retryHistory and wakes Node for fresh independent verification. The endpoint never requeues funding. Its local isolated-store/authentication tests passed; a live recovery submission remains unverified.
The root utility scripts/retry-settlement-snapshot.py covers those two repaired verification reasons, defaults to read-only inspection and reads the configured Node credential without printing it. Adding --execute explicitly requeues settlement and can lead to Cranker submission. Reconcile known signatures before recovery, load corrected services and preserve confirmed funding; do not edit the live JSON store or deposit again to repair settlement verification.
GET /api/health, GET /api/work and GET /api/work-status/[id] provide health or sanitized coordination views. Retain work ID, status, state version, reason and transaction signature when diagnosing failures. Avoid exporting the raw database or decrypted Node payload. A healthy process does not imply that the prover, recipient schema or chain accounts are ready.
Node workers lease through /api/internal/node/work; Crankers authenticate through their wallet challenge/session flow and claim through /api/cranker/work. Receiver checks the signed Node execution projection before verified work is executable. Cranker lease requests have a specific implemented rate limit; this does not imply that every public Receiver endpoint has the same protection. Read the service API boundaries for request/error behavior.
For an HTTP 409, check expected state version, lease owner/expiry and the Node attestation projection against current source. Do not turn a rejected decision into VERIFIED by editing stored state. For missing funding confirmation, inspect the original chain signature before reconstructing work; a sender-signed deposit with an expired blockhash needs fresh sender approval. Settlement root changes require Node re-verification against the current root.