> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cow.bleu.builders/llms.txt
> Use this file to discover all available pages before exploring further.

# Locally testing a solver with the CoW Protocol orderflow

> CoW Protocol infrastructure is a lot of services running together in herd harmony, which is a bit intimidating at the beginning. Before proceeding, it would be advisable to read the architectural overview to get a better understanding of how CoW Protocol works and its entities.

In order to test a solver against CoW Protocol's orderflow, one needs to locally run the following components

* autopilot, which will be configured to point, for example, to the production orderbook and to send the auctions to a local driver.
* driver, which will receive auctions from the autopilot and forward them to the solver engine
* the solver engine that is meant to be tested, run as a local http server able to receive `/solve` requests from the driver and respond to them.

<Warning>
  It is assumed you have rust setup correctly with `rustup`.
</Warning>

The repository where all the backend services can be found is this one: [https://github.com/cowprotocol/services](https://github.com/cowprotocol/services). Here are the main instructions to run the autopilot and the driver.

For the autopilot, we run

```
    cargo run --bin autopilot -- --native-price-estimators "Driver|baseline|http://driver/baseline" --skip-event-sync true --node-url $NODE_URL --shadow https://barn.api.cow.fi/mainnet --drivers "mysolver1|http://localhost:11088|0x0000000000000000000000000000000000000000|0"
```

where one needs to set the NODE\_URL appropriately (e.g., a free Infura endpoint).

<Warning>
  CoW Protocol services infrastructure can be very heavy on RPC resource consumption. Be careful if using with post-paid plans, it's recommended to keep a close eye on RPC resource consumption.
</Warning>

For the driver, we run

```
    cargo run -p driver -- --config driver.config.toml --ethrpc $NODE_URL
```

where one needs to configure driver.config.toml to point to their solver engine. A sample such file can be found [here](https://github.com/cowprotocol/services/blob/main/crates/driver/example.toml).

Once the above are set up and running, one can then start testing their solver engine against one of the following orderbooks:

| Orderbook URL                                                                         | Network      | Environment |
| ------------------------------------------------------------------------------------- | ------------ | ----------- |
| [https://barn.api.cow.fi/mainnet/api](https://barn.api.cow.fi/mainnet/api)            | Mainnet      | Staging     |
| [https://api.cow.fi/mainnet/api](https://api.cow.fi/mainnet/api)                      | Mainnet      | Production  |
| [https://barn.api.cow.fi/xdai/api](https://barn.api.cow.fi/xdai/api)                  | Gnosis Chain | Staging     |
| [https://api.cow.fi/xdai/api](https://api.cow.fi/xdai/api)                            | Gnosis Chain | Production  |
| [https://barn.api.cow.fi/arbitrum\_one/api](https://barn.api.cow.fi/arbitrum_one/api) | Arbitrum One | Staging     |
| [https://api.cow.fi/arbitrum\_one/api](https://api.cow.fi/arbitrum_one/api)           | Arbitrum One | Production  |
| [https://barn.api.cow.fi/base/api](https://barn.api.cow.fi/base/api)                  | Base         | Staging     |
| [https://api.cow.fi/base/api](https://api.cow.fi/base/api)                            | Base         | Production  |
| [https://barn.api.cow.fi/avalanche/api](https://barn.api.cow.fi/avalanche/api)        | Avalanche    | Staging     |
| [https://api.cow.fi/avalanche/api](https://api.cow.fi/avalanche/api)                  | Avalanche    | Production  |
| [https://barn.api.cow.fi/polygon/api](https://barn.api.cow.fi/polygon/api)            | Polygon      | Staging     |
| [https://api.cow.fi/polygon/api](https://api.cow.fi/polygon/api)                      | Polygon      | Production  |
| [https://barn.api.cow.fi/bnb/api](https://barn.api.cow.fi/bnb/api)                    | BNB          | Staging     |
| [https://api.cow.fi/bnb/api](https://api.cow.fi/bnb/api)                              | BNB          | Production  |
| [https://barn.api.cow.fi/linea/api](https://barn.api.cow.fi/linea/api)                | Linea        | Staging     |
| [https://api.cow.fi/linea/api](https://api.cow.fi/linea/api)                          | Linea        | Production  |
| [https://barn.api.cow.fi/plasma/api](https://barn.api.cow.fi/plasma/api)              | Plasma       | Staging     |
| [https://api.cow.fi/plasma/api](https://api.cow.fi/plasma/api)                        | Plasma       | Production  |
| [https://barn.api.cow.fi/ink/api](https://barn.api.cow.fi/ink/api)                    | Ink          | Staging     |
| [https://api.cow.fi/ink/api](https://api.cow.fi/ink/api)                              | Ink          | Production  |
| [https://barn.api.cow.fi/sepolia/api](https://barn.api.cow.fi/sepolia/api)            | Sepolia      | Staging     |
| [https://api.cow.fi/sepolia/api](https://api.cow.fi/sepolia/api)                      | Sepolia      | Production  |
