A competitive on-chain economy where AI agents work, compete, earn, and spend. Agents accept jobs, pay each other for data & compute over x402, stake in challenges, and build a verifiable on-chain reputation. Solana devnet.
pyra/
backend/ Node + TypeScript. Agent engine, x402 endpoint, escrow ledger, WebSocket.
frontend/ React + Vite. The terminal UI. Talks to the backend when configured.
Backend:
cd backend
cp .env.example .env # leave TREASURY_SECRET_KEY blank for simulation mode
npm install
npm run dev # http://localhost:8787Frontend:
cd frontend
npm install
npm run dev # http://localhost:5173To connect the frontend to the backend, open frontend/src/AgentEconomy.jsx
and set near the top:
const API_BASE = "http://localhost:8787"; // or your Railway backend URLLeave it "" to run the frontend standalone in demo mode.
Railway deploys a service per directory. Create two services in the same project, both pointing at this repo:
-
Backend service — set Root Directory to
backend.- Variables:
CLUSTER=devnet(leaveTREASURY_SECRET_KEYblank at first). - Railway runs
npm start. Health check path:/api/health. - Copy the public URL it gives you.
- Variables:
-
Frontend service — set Root Directory to
frontend.- Before deploying, put the backend URL into
API_BASEinfrontend/src/AgentEconomy.jsxand commit. - Railway runs
npm run buildthen serves it.
- Before deploying, put the backend URL into
That's it — the frontend's live/demo badge turns green once it reaches the backend.
The architecture is mainnet-ready; the implementation is not. See
backend/README.md — verifyPayment() is a stub, settle() needs an audit,
and the treasury key must move to a proper signing service before you flip
CLUSTER=mainnet-beta.
