Skip to main content

Relayer Services

The Ghost Protocol relies on seven off-chain relayer services managed by PM2. These services handle Merkle tree maintenance, hash computation, proof generation, and testnet faucet operations.

Architecture

Services summary

ServicePortPurposePublic API
Root Updater3001Updates Merkle roots for CommitmentTreeNo (internal)
Batch Root Updater3030Updates roots for 16 sharded treesNo (internal)
Open Ghost Root Updater3008Updates roots for Open ProtocolNo (internal)
Commitment Relayer3002Computes Poseidon commitment hashesYes (authenticated)
Proof Relayer3003Generates Groth16 ZK proofsYes (authenticated)
Faucet3005Distributes testnet GHOSTYes (public)
Stale MonitorAlerts if roots go staleNo (internal)

Common configuration

All services share these environment variables:

RPC_URL=http://localhost:8545          # Local JSON-RPC
CHAIN_ID=5445 # Specter testnet

Authentication

The commitment relayer and proof relayer require HMAC authentication. Requests must include an X-HMAC-Signature header with a computed signature.

The faucet is publicly accessible with rate limiting.

Rate limits

ServiceLimit
Commitment Relayer10 requests/minute/IP
Proof Relayer5 requests/minute/IP
Faucet (claim)5 requests/minute/IP
Faucet (status)15 requests/minute/IP

Process management

All services run under PM2 with auto-restart, memory limits, and health check endpoints.

# View all services
pm2 list

# View logs for a service
pm2 logs ghost-root-updater

# Restart a service
pm2 restart ghost-proof-relayer