Prerequisites
Before you begin, ensure you have the following installed:Rust 2024 Edition
Install Rust using rustup. The project uses Rust 2024 Edition.Verify your installation:
Docker & Docker Compose
Required for running PostgreSQL and the playground environment.
- Docker Desktop: Install Docker Desktop
- Docker Engine (Linux): Install Docker Engine
Foundry (anvil)
Required for running forked network tests. Install Foundry which includes Verify
anvil:anvil is available:The
anvil binary path is configurable via the ANVIL_COMMAND environment variable. It defaults to "anvil" and must be in your PATH.Just (Optional but Recommended)
The project includes a View available commands:
Justfile with convenient commands.Clone the Repository
Install Dependencies
Rust dependencies are managed throughCargo.toml. They’ll be downloaded automatically during the first build:
The first build will take some time as it downloads and compiles all dependencies. Subsequent builds will be much faster thanks to cargo’s incremental compilation.
Database Setup
Many tests and local development require PostgreSQL.Start PostgreSQL with Docker Compose
- Start a PostgreSQL container on port
5432 - Automatically run database migrations
Access Database (Optional)
Environment Variables
For Forked Network Tests
To run E2E tests against forked networks, you need RPC endpoints:.env
Refer to Chainlist for Mainnet RPCs and Gnosis RPC Providers for Gnosis RPCs.
For Playground Development
See the Playground guide for playground-specific environment configuration.Building the Services
The workspace includes 25+ crates. Main binaries:
orderbook- HTTP API for ordersautopilot- Auction managerdriver- Solution executionsolvers- Internal solver enginerefunder- Handles refunds
IDE Setup Recommendations
Visual Studio Code
Recommended Extensions:- rust-analyzer - Rust language support
- Even Better TOML - TOML support
- Tombi - TOML formatter
- CodeLLDB - Debugger
JetBrains IDEs (IntelliJ IDEA, RustRover, CLion)
Plugins:- Rust - Official Rust plugin
- Tombi - TOML formatting
- Go to Settings → Languages & Frameworks → Rust → Rustfmt
- Set Toolchain to
nightly - Enable Run rustfmt on Save
Zed
Extensions:- Rust (built-in)
- Tombi
Verify Your Setup
Run these commands to ensure everything is working:Next Steps
Testing Guide
Learn how to write and run tests
Playground
Set up the full local development stack
Contributing
Guidelines for contributing code
Architecture
Understand the system architecture
Troubleshooting
Compilation Errors
Linker errors on Linux
Linker errors on Linux
Install build essentials:
Linker errors on macOS
Linker errors on macOS
Install Xcode command line tools:
Out of memory during compilation
Out of memory during compilation
Reduce parallel compilation:
Database Connection Issues
Port 5432 already in use
Port 5432 already in use
Stop any existing PostgreSQL instance:
Permission denied errors
Permission denied errors
Reset Docker volumes:
