Build

Self-hosting

Qorva runs on your machine with Node.js and nothing else: no database, no keys, no accounts. Every read goes to the public QoreChain testnet endpoints. Keys are only needed if you want to run the qorva-l2 testnet rollup.

Quickstart

shell
npm install
npm run dev                          # http://127.0.0.1:3098
npm run qorva:replay -- setoff-1     # replay a rollup from the terminal
npm test                             # Vitest, against the live testnet

Every npm script

ScriptRunsWhat for
devnext dev -p 3098 -H 127.0.0.1The app, bound to loopback only.
build / startnext build / next start -p 3098 -H 127.0.0.1Production build and server, loopback only; put a reverse proxy in front.
testvitest runThe test suite in tests/, against the live testnet.
test:drillsvitest run tests/watchtower-drills.test.tsThe fraud-proof and ML-KEM drills only.
qorva:replaytsx scripts/replay-rollup.mtsReplay one rollup (up to 400 batches).
qorva:cli / sentinel:clitsx scripts/sentinel-cli.tsWatchtower overview and audits in the terminal.
qorva:cli:buildnpm --prefix packages/qorva-cli run buildBundle the Rollup CI CLI.
qorva:operatortsx scripts/operator-key.mtsShow or (--new) create the testnet operator key.
qorva:watchertsx scripts/watcher-key.mtsShow or (--new) create the watchtower key.
qorva:demotsx scripts/testnet-demo.mtsThe resumable qorva-l2 runbook (--dry-run, --until).
qorva:evidencetsx scripts/evidence.mtsRegenerate EVIDENCE.md from the transaction log.
contracts:compiletsx scripts/compile-and-verify-contracts.tsCompile QorvaAnchorVerifier.sol with solc.

Environment variables

All optional. Copy .env.example (placeholders only) to .env.local, which is git-ignored. Next.js loads .env.local for the app; the scripts load it themselves (scripts/_env.ts), and existing environment values win.

VariableDefaultWhat it does, and what happens when unset
QORE_NETWORKtestnetWritten by qorva:operator and listed in .env.example. Qorva's own code does not read it: every client is created for the testnet. It is read by the @qorechain/rdk-cli package.
QORE_MNEMONICunsetThe operator account. Builds the hybrid L1 signer and derives the ML-DSA-87 key. Unset (and no private key): the testnet sequencer is off, GET /api/testnet says configured: false, POST actions fail with "No operator key".
QORE_OPERATOR_PRIVATE_KEY_HEXunsetAlternative to the mnemonic. Then an ML-DSA-87 source is required: QORE_PQC_SEED_HEX.
QORE_PQC_SEED_HEXunsetA raw 32-byte ML-DSA-87 seed. Unset: derived from the mnemonic. The SDK refuses a seed that is not 32 bytes.
QORE_GAS_PRICE0.15uqorGas price for the operator's and the watchtower's transactions.
QORVA_ROLLUP_IDqorva-l2The rollup the testnet sequencer, demo and evidence script drive; its state file is .qorva/testnet-<id>.json.
QORVA_WATCHER_MNEMONICunsetThe watchtower's own account for the challenge drill; must differ from the operator. Unset: the challenge action fails with "No watchtower key".
QORVA_ALLOW_REMOTE_CONTROLunsetSet to 1 to let POST /api/testnet answer on a non-localhost Host. The Origin check still applies. Leave it unset.
NEXT_PUBLIC_QORVA_URLunsetBase URL used in the badge snippets on /network. Unset: the page's own origin.

Used outside the app:

VariableUsed by
QORVA_REST_URLThe qorva CLI: default for --rest.
GITHUB_ACTIONS, GITHUB_STEP_SUMMARYThe qorva CLI: annotations and the job summary.
NO_COLORThe qorva CLI: plain output.
QORVA_EVIDENCE_OUTscripts/evidence.mts: output path (default EVIDENCE.md).
QORVA_TEST_ROLLUPtests/watchtower-drills.test.ts: the live rollup to test (default vigil-pay-1).

Where state lives

  • .env.local: keys, if any. Written with mode 600 by the key scripts, which print only addresses.
  • .qorva/ (mode 700, git-ignored): health.json (last network board), pqc-hygiene.json (hygiene cache), testnet-<rollup>.json (L2 seeds and transaction log, mode 600).
  • Server memory: replay forks, debugger checkpoints, API caches and the whole local sandbox. Lost on restart.

Deploying

npm run build then npm start serves the app on 127.0.0.1:3098. To serve it publicly, follow deploy/README.md: Caddy in front for HTTPS, Docker or systemd behind it, and no operator key on the server. Copy only .qorva/testnet-qorva-l2.public.json (made by npm run qorva:public-state) so the site can show qorva-l2. Production enables per-IP rate limits on every API route.

Things that will bite you

  • Operator keys. The testnet control route's Host and Origin checks can be forged by any non-browser client. Keep operator keys on your own machine, never on a server others can reach.
  • The first board sweep is slow. It replays every rollup from genesis; a large one took 222 s on 2026-11-30. Later sweeps reuse unchanged results and finished in about 7 s.
  • /api/replay stops at 400 batches and 300 s. Use the CLI for rollups bigger than that.
  • The transaction index. Replay needs the REST provider to still serve every post and deposit since genesis; a gap turns the rest of the rollup into skips.
  • Tests hit the live testnet and fail when it is unreachable.
  • The CLI needs Node.js 20 or newer (engines in its package.json).

Repository map

tree
src/app/                 pages (/, /console, /network, /receipt, /docs, /badge) and API routes (src/app/api)
src/components/          console views, network board, receipt view, hygiene view, docs shell, ui.tsx
src/lib/replay-engine.ts     inbox reader + replay (shared by everything below)
src/lib/batch-debugger.ts    step one batch, no-op reasons
src/lib/network-health.ts    board sweep, receipts, badges data
src/lib/pqc-hygiene.ts       nine-check score
src/lib/qore-sentinel-engine.ts  fleet overview, dual-lane audit, QoreSeal demos
src/lib/watchtower.ts        independent fraud proof from chain
src/lib/testnet-sequencer.ts qorva-l2 operator (unfunded)
src/lib/qorva-appchain-node.ts  local in-memory sandbox
contracts/QorvaAnchorVerifier.sol   lane-B verifier (run by eth_call, not deployed)
packages/qorva-cli/      CLI (src/cli.ts, build.mjs) and GitHub Action (action/action.yml)
scripts/                 replay, keys, demo runbook, evidence, contract compile
tests/                   Vitest suites (debugger, hygiene, sentinel, watchtower drills)
docs/                    ROLLUP_CI.md, ci/qorva-replay.yml, upstream/ (two SDK bug drafts)
.github/workflows/qorva-self-check.yml   Qorva replaying testnet rollups in its own CI