Backend & Indexer
Running and configuring @dome/backend for local, testnet, and production.
The Dome backend (@dome/backend) is the off-chain service for shielded wallet flows: indexer, relayer, optional RPC proxy, and (local only) dev faucet.
HTTP routes
| Route | Purpose |
|---|---|
GET /health | RPC reachability + indexer status |
GET /config | Pool limits and addresses for SDK |
GET /merkle/root | Current Merkle root |
GET /get_encrypted | Paginated encrypted UTXO scan |
POST /commitment/ | Merkle path for proof generation |
POST /screen_address | Optional deposit screening |
POST /check_encrypted_output | Confirm indexed outputs |
POST /relayer/withdraw | Relayer withdraw submission |
POST /rpc | JSON-RPC proxy to Base |
POST /dev/fund | Local faucet (chain 31337 only) |
Quick start (local)
cd dome-backend
npm install
cp .env.example .env
npm startFull local stack (Hardhat + deploy + backend):
bash scripts/dev/up.shSee Local Development.
Base Sepolia / production
| Variable | Notes |
|---|---|
DOME_DEPLOY_FILE | Pool addresses and deploymentBlock |
DOME_BASE_RPC_UPSTREAM | Alchemy or other Base RPC |
DOME_RELAYER_PRIVATE_KEY | Funded relayer — never Hardhat default on testnet |
DOME_RELAYER_SECRET | Auth header for public relayer |
DOME_DEV_FAUCET | false on public networks |
DOME_DATABASE_URL | Postgres (testnet/prod) |
DOME_SQLITE_PATH | SQLite (local) |
DOME_RATE_LIMIT_RPC_PER_MIN | Default 240 local, tune down public |
DOME_RATE_LIMIT_RELAYER_PER_MIN | Default 20 local, tune down public |
Copy dome-backend/.env.sepolia.example for a testnet template.
Start with Cloudflare Tunnel:
bash scripts/cloudflare/up-sepolia.shDetailed testnet steps: Base Sepolia Testnet.
Public HTTPS: Cloudflare Tunnel.
Indexer behavior
On startup the backend:
- Validates pool contract bytecode on the configured RPC
- Syncs
NewCommitmentlogs fromdeploymentBlockto chain head - Persists
lastIndexedBlockand encrypted outputs (SQLite or Postgres)
After a long downtime, catch-up can take several minutes on Sepolia before /health reports ready.
Health check
curl -s https://api.getdome.app/health | jqExpect:
ok: truechainId: 84532(Sepolia)- Non-zero
lastIndexedBlockafter pool activity
Relayer gas:
bash scripts/testnet/check-relayer-balance.shSecurity
- Bind to
127.0.0.1when using Cloudflare Tunnel — onlycloudflaredneeds access - Set
DOME_RELAYER_SECRETbefore exposing/relayer/withdrawpublicly - Do not commit
sepolia.env, relayer keys, or tunnel credentials