Local Development
Run the entire Cortex agentic commerce protocol stack locally in under 5 minutes.
Prerequisites
- Docker — for Anvil + Postgres containers
- Foundry —
forge,cast,anvil - Node.js >= 18
- PostgreSQL client tools —
psql,pg_isready
Quick Start
make install # first time only — installs all deps
make e2e # starts infra, deploys, launches services, runs demoStep-by-Step
1. Install Dependencies
make install2. Start Infrastructure
Starts Anvil (local EVM on port 8545) and Postgres (port 5433) via Docker Compose.
make up3. Deploy Contracts
Deploys AgentRegistry, IntentBook, and PolicyModule to Anvil. Writes addresses and keys to ops/.env.deployed.
make deploy4. Start Services
Starts the indexer, solver, and API as background processes.
make services- Indexer — polls Anvil for contract events, writes to Postgres
- Solver — watches for open intents, simulates and fills them
- API — REST server on
http://localhost:3000
Logs: ops/indexer.log, ops/solver.log, ops/api.log
5. Run the Demo
make demoThe demo:
- Registers an agent identity
- Sets spend limit and target allowlist policies
- Submits an EIP-712 signed swap intent
- Waits for the solver to fill the intent
- Queries all API endpoints and prints results
6. Tear Down
make down # stop services + infra
make clean # also remove volumes and generated filesUseful Commands
| Command | Description |
|---|---|
| make up | Start Anvil + Postgres |
| make deploy | Deploy contracts |
| make services | Start indexer/solver/API |
| make demo | Run end-to-end demo |
| make down | Stop everything |
| make clean | Full cleanup |
| make logs | Tail all service logs |
| make e2e | Full end-to-end in one shot |
Ports
| Service | Port |
|---|---|
| Anvil (RPC) | 8545 |
| Postgres | 5433 |
| REST API | 3000 |
Troubleshooting
- Anvil not starting: Check if port 8545 is in use (
lsof -i :8545). - Postgres connection refused: Ensure Docker is running and port 5433 is free.
- Solver not filling intents: Check
ops/solver.log. Needs validINTENT_BOOK_ADDRESS. - API returns empty results: Indexer may need a few seconds to catch up. Check
ops/indexer.log.