Overview
This quickstart guide will help you launch a complete local CoW Protocol environment using Docker Compose. You’ll have a full stack including orderbook, autopilot, driver, solver, and a forked blockchain ready for testing and development.The playground runs in fork mode, meaning it forks a live network (like Ethereum mainnet) using a local Anvil node. This gives you access to real token contracts and liquidity while maintaining an isolated testing environment.
Prerequisites
Before you begin, ensure you have the following installed:Docker & Docker Compose
Rust Toolchain (Optional)
Only needed if you want to modify and rebuild the services locally. Install via rustup:
Setup Instructions
Configure Environment Variables
Copy the example environment file and edit it with your RPC endpoint:Edit
.env and set your RPC URL:.env
Chain IDs: Mainnet (1), Gnosis (100), Arbitrum (42161), Base (8453), Polygon (137)
Launch the Playground
Start all services with Docker Compose:Limit Services (Optional)You can start only specific services:The first build will take several minutes as it compiles all Rust services.
- Linux
- macOS / Windows
Use the standard fork compose file with live reload:
Access Services
Once the playground is running, you can access the following services:CoW Swap UI
http://localhost:8000The main trading interface for placing orders
CoW Explorer
http://localhost:8001View transaction history and order status
Orderbook API
http://localhost:8080HTTP API for order submission and queries
Adminer (Database UI)
http://localhost:8082Browse the PostgreSQL database
- Server: postgres
- User: postgres
- Password: 123
- Database: api
Otterscan (Block Explorer)
http://localhost:8003Local block explorer with transaction traces
Anvil RPC
http://localhost:8545Local forked Ethereum node endpoint
Configure Your Wallet
To interact with CoW Swap, configure your web3 wallet to use the local network:- Rabby Wallet (Recommended)
- MetaMask
- Install Rabby Wallet
- Add a custom network:
- RPC URL:
http://localhost:8545 - Chain ID:
1(or your configured chain)
- RPC URL:
- Import a test account using one of the private keys below
- Connect to CoW Swap at http://localhost:8000
Test Accounts
The playground uses a well-known test mnemonic. All accounts start with 10,000 ETH:Submit Your First Order
Wrap ETH to WETH
CoW Protocol trades ERC-20 tokens. Wrap some ETH first:
- Go to http://localhost:8000
- Connect your wallet (select the local network)
- Click “Wrap” in the interface
- Wrap some ETH (e.g., 1 ETH)
Place a Swap Order
- Select tokens to swap (e.g., WETH → USDC)
- Enter an amount
- Review the quote from the orderbook
- Sign and submit the order
- Wait for the order to be included in an auction
Monitor the Auction
Watch the service logs to see the order lifecycle:
- Orderbook: Receives and validates the order
- Autopilot: Includes the order in the next auction (~12-15 seconds)
- Driver + Solver: Compute the best execution
- Driver: Submits the winning solution on-chain
- Anvil: Mines the settlement transaction
View in Explorer
Check the settlement in:
- CoW Explorer: http://localhost:8001
- Otterscan: http://localhost:8003 (view full transaction traces)
Resetting the Playground
To reset the entire environment:Reset Your Wallet
Clear pending transactions to avoid nonce issues:
- Rabby: Settings → “Clear pending” (More section)
- MetaMask: Settings → Advanced → Reset Account
Switching Networks
To test on a different network (e.g., Gnosis Chain):-
Edit
playground/.env: -
Reset and restart:
- Update your wallet to the new chain ID
Next Steps
Architecture
Learn how the services work together
API Reference
Explore the Orderbook API
Development Guide
Set up for service development
Testing
Run unit and E2E tests
Troubleshooting
Services fail to start
Services fail to start
- Check that Docker has enough resources (at least 4GB RAM)
- Verify your RPC endpoint is accessible
- Look for error messages in the logs
- Try rebuilding:
docker compose -f docker-compose.fork.yml up --build --force-recreate
Slow compilation on macOS/Windows
Slow compilation on macOS/Windows
Use the non-interactive compose file:This disables live reload which can be slow on non-Linux platforms.
Orders not settling
Orders not settling
- Check that you wrapped ETH to WETH first
- Ensure your token has sufficient balance and approval
- Watch the autopilot logs for auction creation
- Verify the solver found a valid solution
RPC rate limiting
RPC rate limiting
If you see RPC errors in the logs:
- Use a local node (Reth, Geth, etc.) for best performance
- Upgrade to a paid RPC plan
- Reduce the RPC load by disabling some services
Wallet nonce issues
Wallet nonce issues
After resetting the playground, always reset your wallet’s pending transactions:
- Rabby: “Clear pending”
- MetaMask: “Reset Account”
For more detailed development instructions, see the Development Setup guide.
