All money is local test SOL. Never use funded wallets.
Prerequisites
- Node.js 20+ and pnpm
- Rust and the Solana CLI, including
cargo build-sbfandsolana-test-validator - Docker with the daemon running
1
Start the validator
In its own terminal:Then point the Solana CLI at localnet:
2
Generate local keys
Create Solana keypairs for the operator, the escrow program, the provider’s recipient wallet, the protocol fee wallet, and a caller wallet:Then generate node signing keys and
.env values for the caller, provider, and operator. This writes caller.env, provider.env, and operator.env into .keys/local-e2e/ without printing secrets:3
Configure and build the escrow program
The escrow program has the operator’s address and the protocol fee wallet compiled in. Print both:Set them in Build it:
programs/escrow_program/src/lib.rs:4
Fund wallets and deploy
The operator pays for the deploy and escrow setup. The recipient and fee wallets are prefunded so small payments don’t fail the rent check:
5
Create .env files
Copy values from the generated files in
.keys/local-e2e/ into each app.PROTOCOL_FEE_RECIPIENT must match the address compiled into the program.6
Start the services
7
Create and fund the caller's escrow
Ask the operator to create an escrow for the caller’s Fund it from the caller wallet:
USER_ADDRESS:Response
8
Run a paid request
Call the caller node, which routes to the paid resource on the resource node:Settlement runs after the result is returned, so check the operator logs and the recipient’s balance to confirm payment. A
Response
returnValue alone doesn’t prove the payment settled.Troubleshooting
If a request fails, check each.env file, then rerun docker compose up -d --build.
For a deeper, source-audited walkthrough including on-chain verification, see
docs/local-e2e.md in the repository.