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
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 testnetEvery npm script
| Script | Runs | What for |
|---|---|---|
| dev | next dev -p 3098 -H 127.0.0.1 | The app, bound to loopback only. |
| build / start | next build / next start -p 3098 -H 127.0.0.1 | Production build and server, loopback only; put a reverse proxy in front. |
| test | vitest run | The test suite in tests/, against the live testnet. |
| test:drills | vitest run tests/watchtower-drills.test.ts | The fraud-proof and ML-KEM drills only. |
| qorva:replay | tsx scripts/replay-rollup.mts | Replay one rollup (up to 400 batches). |
| qorva:cli / sentinel:cli | tsx scripts/sentinel-cli.ts | Watchtower overview and audits in the terminal. |
| qorva:cli:build | npm --prefix packages/qorva-cli run build | Bundle the Rollup CI CLI. |
| qorva:operator | tsx scripts/operator-key.mts | Show or (--new) create the testnet operator key. |
| qorva:watcher | tsx scripts/watcher-key.mts | Show or (--new) create the watchtower key. |
| qorva:demo | tsx scripts/testnet-demo.mts | The resumable qorva-l2 runbook (--dry-run, --until). |
| qorva:evidence | tsx scripts/evidence.mts | Regenerate EVIDENCE.md from the transaction log. |
| contracts:compile | tsx scripts/compile-and-verify-contracts.ts | Compile 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.
| Variable | Default | What it does, and what happens when unset |
|---|---|---|
| QORE_NETWORK | testnet | Written 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_MNEMONIC | unset | The 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_HEX | unset | Alternative to the mnemonic. Then an ML-DSA-87 source is required: QORE_PQC_SEED_HEX. |
| QORE_PQC_SEED_HEX | unset | A raw 32-byte ML-DSA-87 seed. Unset: derived from the mnemonic. The SDK refuses a seed that is not 32 bytes. |
| QORE_GAS_PRICE | 0.15uqor | Gas price for the operator's and the watchtower's transactions. |
| QORVA_ROLLUP_ID | qorva-l2 | The rollup the testnet sequencer, demo and evidence script drive; its state file is .qorva/testnet-<id>.json. |
| QORVA_WATCHER_MNEMONIC | unset | The 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_CONTROL | unset | Set to 1 to let POST /api/testnet answer on a non-localhost Host. The Origin check still applies. Leave it unset. |
| NEXT_PUBLIC_QORVA_URL | unset | Base URL used in the badge snippets on /network. Unset: the page's own origin. |
Used outside the app:
| Variable | Used by |
|---|---|
| QORVA_REST_URL | The qorva CLI: default for --rest. |
| GITHUB_ACTIONS, GITHUB_STEP_SUMMARY | The qorva CLI: annotations and the job summary. |
| NO_COLOR | The qorva CLI: plain output. |
| QORVA_EVIDENCE_OUT | scripts/evidence.mts: output path (default EVIDENCE.md). |
| QORVA_TEST_ROLLUP | tests/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 (
enginesin its package.json).
Repository map
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