@rail402.dev/facilitator
v0.1.0
Published
x402 facilitator service for Stellar: verify, settle, supported.
Readme
@rail402.dev/facilitator
The Rail402 x402 facilitator for Stellar: verify, settle, supported, plus /health,
/metrics, and the co-deployed Bazaar discovery endpoints. Built on @x402/stellar, non-custodial,
fee-sponsoring, and free on testnet with no API key.
Run the service
One command, zero config. On testnet it generates an ephemeral signer and friendbot-funds it for you, with no keypair, no faucet and no flags:
npx @rail402.dev/facilitator
# ephemeral signer GAWE... funded via friendbot (not for production)
# listening on http://0.0.0.0:4022 /supported /verify /settle /discoveryFor a real deployment, pass your own funded signer and persist the catalog:
npx @rail402.dev/facilitator --secret S... --port 8080 --catalog-db ./catalog.db--help lists every flag. You can also use the hosted testnet facilitator at
https://facilitator.rail402.dev, or the container (Bazaar co-deployed):
docker build -t rail402-facilitator .
docker run -p 8080:8080 -e FACILITATOR_STELLAR_SECRET=S... -v rail402-catalog:/data rail402-facilitatorDefaults are zero-fee and open, so testnet is usable without friction. Full configuration reference:
.env.example and the
operator guide.
Use it as a library (self-facilitation)
Run verify and settle in-process for your own services, with no external facilitator and no network hop:
import { buildFacilitator, loadConfig } from "@rail402.dev/facilitator";
import { x402ResourceServer } from "@x402/core/server";
const { facilitator } = buildFacilitator(loadConfig(process.env));
const localFacilitator = {
verify: facilitator.verify.bind(facilitator),
settle: facilitator.settle.bind(facilitator),
getSupported: async () => facilitator.getSupported(),
};
const server = new x402ResourceServer([localFacilitator]);Exports
buildFacilitator, loadConfig, describeConfig, createApp, createRateLimiter. The HTTP server
entrypoint is available at @rail402.dev/facilitator/server.
Part of Rail402. Apache-2.0. Testnet only by construction.
