DOME Docs

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

RoutePurpose
GET /healthRPC reachability + indexer status
GET /configPool limits and addresses for SDK
GET /merkle/rootCurrent Merkle root
GET /get_encryptedPaginated encrypted UTXO scan
POST /commitment/Merkle path for proof generation
POST /screen_addressOptional deposit screening
POST /check_encrypted_outputConfirm indexed outputs
POST /relayer/withdrawRelayer withdraw submission
POST /rpcJSON-RPC proxy to Base
POST /dev/fundLocal faucet (chain 31337 only)

Quick start (local)

cd dome-backend
npm install
cp .env.example .env
npm start

Full local stack (Hardhat + deploy + backend):

bash scripts/dev/up.sh

See Local Development.

Base Sepolia / production

VariableNotes
DOME_DEPLOY_FILEPool addresses and deploymentBlock
DOME_BASE_RPC_UPSTREAMAlchemy or other Base RPC
DOME_RELAYER_PRIVATE_KEYFunded relayer — never Hardhat default on testnet
DOME_RELAYER_SECRETAuth header for public relayer
DOME_DEV_FAUCETfalse on public networks
DOME_DATABASE_URLPostgres (testnet/prod)
DOME_SQLITE_PATHSQLite (local)
DOME_RATE_LIMIT_RPC_PER_MINDefault 240 local, tune down public
DOME_RATE_LIMIT_RELAYER_PER_MINDefault 20 local, tune down public

Copy dome-backend/.env.sepolia.example for a testnet template.

Start with Cloudflare Tunnel:

bash scripts/cloudflare/up-sepolia.sh

Detailed testnet steps: Base Sepolia Testnet.
Public HTTPS: Cloudflare Tunnel.

Indexer behavior

On startup the backend:

  1. Validates pool contract bytecode on the configured RPC
  2. Syncs NewCommitment logs from deploymentBlock to chain head
  3. Persists lastIndexedBlock and 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 | jq

Expect:

  • ok: true
  • chainId: 84532 (Sepolia)
  • Non-zero lastIndexedBlock after pool activity

Relayer gas:

bash scripts/testnet/check-relayer-balance.sh

Security

  • Bind to 127.0.0.1 when using Cloudflare Tunnel — only cloudflared needs access
  • Set DOME_RELAYER_SECRET before exposing /relayer/withdraw publicly
  • Do not commit sepolia.env, relayer keys, or tunnel credentials

On this page