Self-hosting
Run your own facilitator with Docker, Node or Vercel. Turn a chain on by adding its key.
The code is MIT licensed on GitHub.
Docker
git clone https://github.com/BelgacemElbar/amnt-x402-facilitator
cd amnt-x402-facilitator
docker build -t amnt-x402-facilitator .
docker run -p 3000:3000 -v "$PWD/data:/app/data" \
-e HEDERA_FACILITATOR_ID=0.0.12345 \
-e HEDERA_FACILITATOR_KEY=302e... \
-e HEDERA_NETWORK=hedera:testnet \
amnt-x402-facilitatorNode
git clone https://github.com/BelgacemElbar/amnt-x402-facilitator
cd amnt-x402-facilitator
npm install
cp .env.example .env # add at least one fee-payer key
npm startOr without cloning: npx github:BelgacemElbar/amnt-x402-facilitator.
Vercel
The repo deploys as-is. Add your keys as environment variables. Set DATABASE_URL to a Postgres database, because Vercel's disk doesn't keep a SQLite file.
Turning chains on
A chain is on when its fee-payer key is set.
| Variable | Chain |
|---|---|
HEDERA_FACILITATOR_ID + HEDERA_FACILITATOR_KEY | Hedera (HEDERA_NETWORK picks testnet or mainnet) |
EVM_FACILITATOR_KEY | EVM (EVM_NETWORKS, default eip155:84532) |
SOLANA_FACILITATOR_KEY | Solana (SOLANA_NETWORK, default devnet) |
Hedera keys are checked against the ledger at startup. A key that doesn't control the account stops the server with one clear line, instead of failing every payment later with INVALID_SIGNATURE.
Storage
- SQLite by default, at
./data/facilitator.db. Nothing to set up. - Postgres when
DATABASE_URLis set.
The log feeds /stats, /transactions and the replay guard.
Dashboard
Open /dashboard on your instance. It reads your own /stats and /transactions.
Before you run it on mainnet
A public facilitator pays the network fee on every payment anyone sends it, including spam between two wallets someone else controls. Set MIN_AMOUNT_ATOMIC, keep an eye on /health, and use PAY_TO_ALLOWLIST if you only settle for your own servers.