Skip to main content
These steps take a fresh machine to a verified checkout. Everything after them, running the service or reproducing the evidence, starts from here.
The latest release of the service is v0.2.1 (changelog), also published as the container image ghcr.io/tolgayayci/rail402:0.2.1 (Docker); it serves exact only. The newest GitHub release, upto-contract-v1.0.0, publishes the WASM of the upto settlement contract. The npm packages are at 0.5.7, with upto, the agent tools and the browser entries of the SDK, safe-fetch and the MCP tools: @rail402.dev/facilitator, bazaar, search, store-postgres, stellar, errors, upto, sdk, mcp, cli, safe-fetch and x402-index.The Playground is hosted at playground.rail402.dev and also runs from a checkout. A checkout built with the steps below has all of it.

Prerequisites

The pinned versions live in mise.toml, .node-version (used by CI) and the packageManager field of package.json.

Clone and install

pnpm install resolves from pnpm-lock.yaml. Install scripts are denied unless the workspace allows them; onnxruntime-node ships its CPU binaries in the package, so its download script is deliberately not run.

Verify

pnpm verify runs, in order, and stops at the first failure: CI (.github/workflows/ci.yml) runs the same command on every push to main and on every pull request, followed by pnpm build.

Build

This compiles every workspace package to its dist/ directory. The service entry points are then apps/rail402/dist/main.js (the HTTP service), apps/rail402/dist/channels.js (the channel commands) and apps/rail402/dist/upto.js (the upto contract and authority commands).

Integration tests

Integration tests run against Postgres and a private Stellar network with 1-second ledgers, real accounts and a real token contract. They need the embedding model on disk.
The upto archival test starts a second, disposable network of its own with Docker, whose contracts archive within seconds (test/stellar/short-ttl.json), and removes it afterwards. It is skipped when Docker is unavailable or RAIL402_TEST_ARCHIVAL=0 is set. The private network runs with the testnet passphrase so the unmodified @x402/stellar scheme works against it. It resets whenever its container is recreated. Stop everything with docker compose --profile stellar down.

Run the service from source

To run the service without the container image, fetch the model, start Postgres and set the three required variables. The Docker page shows how to create and fund a testnet sponsor account.
Run it from the repository root: the model directory defaults to .models, relative to the working directory (SEARCH_MODEL_DIR). On first start the service applies its database migrations and, on testnet, creates its channel accounts. Check it with curl localhost:8080/ready.

Reproduce the published results