Running a Verifier
Running a Verifier
While AMP starts as a managed network, the protocol is designed for decentralization. Studios or third-party infrastructure providers can run their own AMP Verifiers to earn fees and support the network.
Warning: Running a verifier is currently in Alpha. The instructions below are for advanced users and developers looking to test the infra locally or on Fuji.
Hardware Requirements
- CPU: 4+ Cores (High clock speed preferred for
ASYNC_VERIFIERreplays). - RAM: 8GB minimum.
- Disk: NVMe SSD (for sled-backed settlement queue and transcript logging).
- Network: Low latency, stable IP.
Configuration
The Verifier (amp-server) is configured via environment variables:
| Variable | Description | Default |
|---|---|---|
AMP_LISTEN_ADDR | TCP listen address for Cap'n Proto RPC | 0.0.0.0:5555 |
AMP_AVAX_RPC | Avalanche RPC endpoint | https://api.avax-test.network/ext/bc/C/rpc |
AMP_REGISTRY_ADDR | AMPRegistry contract address | (required) |
AMP_VERIFIER_KEY | Private key for signing attestations (hex) | (required) |
AMP_MATCH_TICK_MS | Matchmaker tick interval in ms | 50 |
AMP_MATCH_TTL_MS | Match time-to-live in ms | 3600000 (1h) |
AMP_MAX_ACTIVE_MATCHES | Maximum concurrent matches | 10000 |
AMP_LOG_LEVEL | Log level (trace/debug/info/warn/error) | info |
RUST_LOG | Standard Rust log filter | amp_server=info |
From Source
# Build
cargo build --release --bin amp-server
# Run
AMP_LISTEN_ADDR=0.0.0.0:5555 \
AMP_AVAX_RPC=https://api.avax-test.network/ext/bc/C/rpc \
AMP_REGISTRY_ADDR=0x27E02ebA98D2A50Cd1079b0a611320b05A278005 \
AMP_VERIFIER_KEY=0x... \
./target/release/amp-server
With Docker
docker build -t amp-server -f amp-server/Dockerfile .
docker run -d \
-e AMP_LISTEN_ADDR=0.0.0.0:5555 \
-e AMP_AVAX_RPC=https://api.avax-test.network/ext/bc/C/rpc \
-e AMP_REGISTRY_ADDR=0x27E02ebA98D2A50Cd1079b0a611320b05A278005 \
-e AMP_VERIFIER_KEY=0x... \
-p 5555:5555 \
amp-server
Local Development (Anvil)
For local testing, use the provided script to spin up a local Avalanche fork:
./scripts/start-localnet.sh
This starts Anvil with the AMP contracts deployed and configures default verifier keys.
Settlement Relayer
The amp-relayer runs alongside the verifier to submit settled outcomes on-chain. It features:
- Sled-backed queue: Persistent settlement queue survives restarts.
- EIP-1559 gas: Dynamic gas pricing with automatic fee bumping.
- Nonce tracking: Per-account nonce management for concurrent transactions.
- Retry with backoff: Failed transactions are retried up to 5 times with exponential backoff (500ms -- 4s).
- Dead-letter queue: Permanently failed settlements are logged for manual intervention.
- Graceful shutdown: In-flight transactions complete before the process exits.
cargo build --release --bin amp-relayer
AMP_RELAYER_RPC=https://api.avax-test.network/ext/bc/C/rpc \
AMP_RELAYER_REGISTRY=0x27E02ebA98D2A50Cd1079b0a611320b05A278005 \
AMP_RELAYER_KEY=0x... \
./target/release/amp-relayer