HTTP server for generating Asteroids replay proofs from raw .tape bytes.
- Single-flight proving (
concurrency = 1). - Async job API with polling.
- Optional API key auth on
/api/*for submit/read paths. - Destructive API action (
DELETE /api/jobs/{job_id}) is disabled unlessAPI_KEYis configured.
GET /healthPOST /api/jobs/prove-tape/rawGET /api/jobs/{job_id}DELETE /api/jobs/{job_id}
If API_KEY is set, /api/* requires either:
x-api-key: <API_KEY>Authorization: Bearer <API_KEY>
/health is always open.
If API_KEY is not set:
POST /api/jobs/prove-tape/rawandGET /api/jobs/{job_id}remain accessible.DELETE /api/jobs/{job_id}returns401 unauthorized.
JOB_ID=$(curl -sS \
-X POST 'http://127.0.0.1:8080/api/jobs/prove-tape/raw?receipt_kind=groth16&segment_limit_po2=21&verify_mode=policy&seed_id=0&claimant=GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF' \
--data-binary @../test-fixtures/test-medium.tape \
-H 'content-type: application/octet-stream' \
-H 'x-api-key: YOUR_API_KEY' | jq -r '.job_id')Poll:
curl -sS -H 'x-api-key: YOUR_API_KEY' "http://127.0.0.1:8080/api/jobs/${JOB_ID}" | jqPOST /api/jobs/prove-tape/raw rejects zero-score tapes with:
- status:
400 error_code: "zero_score_not_allowed"
See .env.example for the full list.
API_BIND_ADDR: listen address (default0.0.0.0:8080)API_KEY: shared secret for/api/*auth (required to enable DELETE)RISC0_DEV_MODE:1for local dev receipts,0for secure provingDATA_DIR: persistent job DB/log root (./dataif unset)MAX_TAPE_BYTES,MAX_JOBS,JOB_TTL_SECS,JOB_SWEEP_SECSMAX_FRAMES,MIN_SEGMENT_LIMIT_PO2,MAX_SEGMENT_LIMIT_PO2RUNNING_JOB_TIMEOUT_SECS,TIMED_OUT_PROOF_KILL_SECSHTTP_MAX_CONNECTIONS,HTTP_KEEP_ALIVE_SECS,HTTP_WORKERSCORS_ALLOWED_ORIGIN(optional)CLOUDFLARE_TUNNEL_TOKEN(used by supervisord tunnel config)
- Keep
RISC0_DEV_MODE=0in production. - Set
API_KEYin production. - Keep
verify_mode=policyunless you explicitly need prover-side verification. - Run under a supervisor (supervisord/systemd/container restart policy) to recover from intentional abort-on-timeout behavior.
DATA_DIR/jobs.db is operational state for async jobs and is treated as ephemeral.
- Schema evolution policy: on incompatible schema changes, wipe and recreate
jobs.db. - Use
kalien-verifier/deploy/reset-prover-state.shfor destructive resets. - Cloudflare Wrangler/D1 migrations do not manage this DB; it is local SQLite owned by
api-server.
For host-level deployment/runbook details, see ../README.md.