Build

HTTP API

Every page in Qorva is a thin client over a handful of JSON routes under /api, and you can call them directly. There is no authentication: every route is public and reads public chain data. In production each IP gets 120 requests a minute, and 20 a minute on routes that re-execute rollups or build transactions (429 with Retry-After beyond that). The public deployment at qorva.dev holds no operator key, so nothing on it can sign.

All routes

RouteMethodPurpose
/api/replayGETStream a replay as NDJSON.
/api/debugGETStep one batch, or list a rollup's batches.
/api/health-boardGETThe network health board.
/api/health-board/<id>GETOne rollup's health report.
/api/pqc-hygieneGETPQC hygiene scores.
/api/receiptGET, POSTBuild and verify, or verify a given receipt.
/api/sentinelGET, POSTWatchtower overview, dual-lane audit, identity, local demos.
/api/pulseGETChain liveness from CometBFT /status.
/api/testnetGET, POSTqorva-l2 status; POST sends testnet transactions (localhost only).
/api/appchain/rpcGET, POSTJSON-RPC 2.0 for the local sandbox sequencer.
/badge/<id>.svg | .jsonGETREADME badges (see Network board & badges).

Rollup ids are checked against ^[a-z0-9][a-z0-9._-]{2,63}$ by /api/replay, /api/debug, /api/health-board/<id>, /api/pqc-hygiene, /api/receipt and the badges; an invalid id is a 400. /api/sentinel does not apply this check. Long-running routes declare maxDuration 300 s (replay, debug, health board, hygiene, testnet), 120 s (one rollup's health) or 60 s (badges).

GET /api/replay

ParamMeaning
rollupRequired, a rollup id.
maxBatches to replay, clamped to 1 to 400; default 200.
fresh=1Skip the 120 s cache of finished, error-free runs (kept per rollup and max).

The response is application/x-ndjson, one JSON event per line, flushed as each batch is checked:

typeFields
startrollupId, executionVm, sequencing, batchCount, creator
batchbatchIndex, inboxStart, inboxEnd, entries, deposits, transfers, withdrawals, rejected, chainTxCount, chainStateRoot, replayedStateRoot, match, inboxVerified (true | false | null), submittedAt, accounts, ms
skipbatchIndex, reason
donerollupId, batchesReplayed, matched, diverged, skipped, accounts (first 50: accountIdHex, balanceQor, nonce), finalStateRoot, ms
errormessage
example
curl -sN 'http://127.0.0.1:3098/api/replay?rollup=veil-pay-1&max=8' | head -2

GET /api/debug

?rollup=<id> returns { ok, data: { rollupId, batches: [{ batchIndex, inboxStart, inboxEnd, entries, txCount, status, submittedAt }] } }. Add &batch=<n> (digits only) to step that batch: data then holds the batch's range and status, inboxVerified, the parent, step, whole-batch and chain roots with parentAgrees and rootsAgree, the three withdrawals roots with withdrawalsRootsAgree, counts, and steps[] (seq, l1Height, poster, kind, decoded, effect, reason, reasonLabel, reasonDetail, note, diff, withdrawal, rootAfter), plus ms and cached. Errors: 400 for bad input, 404 for an unknown rollup or batch or a non-qledger-v1 rollup, 502 otherwise.

GET /api/health-board

Returns { ok, board, ageMs, stale, refreshing, progress, source, lastError }. board holds chainId, generatedAt, sweepMs, rollups[] and totals (rollups, qledgerRollups, batches, replayed, matched, diverged, skipped, inboxVerified, rollupsReproduced, rollupsDiverged, rollupsErrored, receiptsValid, receiptsChecked). ?fresh=1 forces a sweep and waits for it; ?wait=0 returns at once even if no board exists yet (then board is null and progress shows the sweep). /api/health-board/<id> returns { ok, rollup } for one rollup (404 if it does not exist), with ?fresh=1 to bypass its 60 s reuse. Each report carries the verdict, counters (null when not measured), divergedBatches, skipReason, latestBatch, receipt, checkedAt, replayedAt, reused, replayMs and note.

GET /api/pqc-hygiene

Without parameters: { measuredAt, ms, weights, rollups, errors } for every rollup, sorted by score. With ?rollup=<id>: one result, { rollupId, creator, executionVm, status, score, grade, unmeasured, checks[], measuredAt, ms, stale? }, where each check has id, label, group, weight, earned, status, ratio, evidence, extra, why and error. fresh=1 re-measures; replay=0 skips the replay check (it then reports unknown). Results are cached for 10 minutes.

GET and POST /api/receipt

GET ?rollup=<id>&batch=<n> builds a receipt from chain state and verifies it. POST takes a receipt as the body (bare or { "receipt": … }), rejects anything that fails receiptSchemaError with a 400, and verifies it. Both return { ok, receipt, verification: { valid, mode, checks, signBytesVersion, … }, tampered: { valid, checks }, ms }, or { ok: false, error } with status 422 when the chain refuses (for example, no anchor).

example
curl -s 'http://127.0.0.1:3098/api/receipt?rollup=setoff-1&batch=113' > r.json
curl -s -X POST -H 'content-type: application/json' --data @r.json http://127.0.0.1:3098/api/receipt

GET and POST /api/sentinel

CallWhat it runs
GET ?action=overview [&fresh=1]fetchLiveSentinelOverview: network heights, PRISM (0x0C01) params, PQC policy, telemetry, cross-VM status, x/rdk params, and rollups[] with anchorStatus. Cached 15 s, one fetch in flight.
GET|POST verify-batch (rollupId, batchIndex)The dual-lane audit. rollupId defaults to ledgerpump; batchIndex to the latest batch, and an absent index is an error.
GET|POST inspect-identity (address)inspectPqcIdentityAndEvmWindow: the account's PQC key via 0x0A02, the EVM authorisation window, and a proof-of-possession check on 0x0A01.
POST qoreseal-incidentSeals an incident report with QoreSeal to keys generated in the same request and opens it again. A local demonstration.
POST simulate-rdksimulateRdkRollupAndQledgerBatch: builds a rollup config from an RDK preset and a qledger batch in memory, signs its anchor with a fresh ML-DSA-87 key and checks it on 0x0A01 by eth_call, then shows checkQledgerFraud upholding a tampered root. No transaction is sent.

Responses are { ok: true, data }; an unknown action is a 400, any failure a 500 with error.

GET /api/pulse

Reads https://rpc-testnet.qore.host/status with a 6 s timeout and returns { reachable, network, height, blockTime, blockHash, appHash, catchingUp, latencyMs, source }. On failure it returns { reachable: false, error, latencyMs, source }, still with status 200, and never a made-up height.

GET and POST /api/testnet

GET returns the qorva-l2 status: configured, watcherConfigured, network, rollupId, live params, operator and watcher balances and PQC registration, what is still needed, the rollup and its batches, L2 accounts, drills and the transaction log. ?replay=1 re-executes the rollup first so L2 balances are current.

POST takes { action, account?, to?, amountQor?, batchIndex?, withdrawalIndex?, postTx? } and sends real testnet transactions signed by the operator key. Allowed actions, from the code: setup, deposit, transfer, withdraw, batch, claim, cheat, challenge, kem-register, sealed-post, kem-open. Returns { ok, records, report, data }, or 422 with the error and the failed record.

Guards, in order

  • The Host header must be localhost, 127.0.0.1 or ::1, unless QORVA_ALLOW_REMOTE_CONTROL=1 is set (403 otherwise).
  • An Origin header must be present and name the same host (403 otherwise). Browsers always send it on a POST, so a missing one means a script.
  • The action must be in the list above; account and to must be A or B; batchIndex a non-negative integer; postTx a 64-hex hash; amounts at most 6 decimals (deposits at least 1 QOR). Actions run one at a time.

GET and POST /api/appchain/rpc

JSON-RPC 2.0 for the in-memory sandbox (local only). GET supports ?method=qorva_getChainState (the default) and qorva_getMerkleWitness&accountIdHex=. POST supports qorva_getChainState, qorva_createAccount, qorva_faucetDeposit, qorva_sendTransaction, qorva_initiateWithdrawal, qorva_produceAnchoredBatch, qorva_getMerkleWitness, qorva_executeDappTemplate and qorva_deployDapp. Unknown methods return error -32601, failures -32603.

example
curl -s 127.0.0.1:3098/api/appchain/rpc -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"qorva_produceAnchoredBatch"}'