Skip to main content

Development Setup

This guide covers establishing a local development environment for CoW Protocol Services, a Rust-based project requiring multiple tools and dependencies.

Prerequisites

  • Rust 2024 Edition - Install via rustup
  • Docker/Docker Compose - For PostgreSQL and other services
  • Foundry’s anvil - For network testing
  • cargo-nextest - For running tests
Do not use cargo test - always use cargo nextest run due to CI compatibility differences.

Optional Tools

  • Just - Convenient command shortcuts (just test-unit, just fmt, etc.)
  • Tombi - TOML formatting tool

Setup Steps

1. Clone the Repository

2. Build Dependencies

Dependencies are automatically resolved via Cargo:

3. Configure PostgreSQL

Start PostgreSQL using Docker Compose, which handles migrations automatically:

4. Set Environment Variables

For forked network testing, configure RPC endpoints:

IDE Configuration

VS Code

Recommended extensions:
  • rust-analyzer
  • Even Better TOML
  • CodeLLDB (for debugging)

JetBrains IDEs

  • Official Rust plugin
  • Configure nightly rustfmt in settings

Zed

  • Built-in Rust support
  • Tombi extension for TOML

Verification

Validate your setup by running:

Troubleshooting

Linker Errors

  • Linux: Install build-essential packages
  • macOS: Install Xcode command line tools (xcode-select --install)

Memory Constraints

Compilation can be memory-intensive. Ensure you have at least 8GB RAM available.

Port Conflicts

If PostgreSQL fails to start, check for existing instances on port 5432:
Last modified on March 4, 2026