Local Setup

1. Build Circuits

./build-circuits.sh

This compiles all Noir circuits, generates Solidity verifiers, and creates TypeScript FFI bindings.

2. Start Hardhat Node

cd contracts
npm install
npm run start

3. Deploy Contracts

In a separate terminal:

cd contracts
npm run deploy

4. Start Web Services

cd web
pnpm install
pnpm dev:hardhat       # Starts all apps configured for local Hardhat

Individual services can be started separately:

5. HTTPS Setup (Required)

The frontend requires HTTPS for secure cookies. Use Caddy as a reverse proxy.

Install Dependencies

Generate SSL Certificates

Add Domain to Hosts

Create Caddyfile

Create ~/Caddyfile:

Update Environment Files

web/apps/app/.env:

web/apps/rpc-proxy/.env:

Start Caddy

Verify

Open https://nullmask.local.dev in your browser.

Troubleshooting

  • Certificate not trusted: Run mkcert -install again and restart your browser

  • Port 443 permission denied: sudo setcap cap_net_bind_service=+ep $(which caddy)

  • LMDB stale data after Hardhat restart: Run ./wipe-lmdb.sh and restart web services

Last updated