Configuration file
The Watch Tower requires aconfig.json file. You can use the provided example as a starting point:
Configuration schema
The configuration file follows this structure:Network configuration
Each network in thenetworks array supports the following options:
Required fields
Network identifier (e.g.,
mainnet, sepolia, arbitrum_one, gnosis_chain, base)RPC endpoint URL. Supports both HTTP/HTTPS and WebSocket connections.Examples:
https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEYwss://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEYhttps://sepolia.drpc.org
Block number where the ComposableCoW contract was deployed. The Watch Tower only processes events from this block onwards to optimize performance.Deployment blocks by network:
- Mainnet:
17883049 - Sepolia:
8468184 - Arbitrum One:
343493668 - Gnosis Chain:
40394915 - Base:
31084679 - Avalanche:
63235114 - Polygon:
72315184 - Linea:
25028604 - Plasma:
4810535 - Ink:
37142449
See Deployed Contracts for the complete list.
Defines filtering rules for conditional orders. See Filter policy below.
Optional fields
Custom OrderBook API endpoint URL. If not specified, uses the default CoW Protocol API for the network.
Number of blocks to fetch per request when querying historical events (
eth_getLogs).- Default:
5000(Infura’s maximum) - Set to
0to fetch all blocks in one request (useful for private RPC nodes)
Timeout in milliseconds for the watchdog timer. If no new blocks are received within this time, the Watch Tower will alert.
Throttle block processing to only process every N blocks.
1- Process every block (default)2- Process every other block10- Process every 10th block
Filter policy
The filter policy controls which conditional orders are processed by the Watch Tower.Structure
Filter actions
Default action for items not explicitly listed in filters.
ACCEPT- Process the order (recommended)DROP- Ignore the orderSKIP- Skip processing temporarily
Map of conditional order IDs to filter actions. Use this to block or allow specific order IDs.
Map of transaction hashes to filter actions. Use this to filter orders from specific transactions.
Map of handler contract addresses to filter actions. Use this to filter orders by their handler contract.
Map of owner addresses (safes) to filter actions. Use this to filter orders by the owning address.
Example configurations
Multi-network setup
Development setup (Sepolia)
With custom filtering
Configuration via environment variables
You can override the configuration file path using theCONFIG_PATH environment variable:
Important notes
The
deploymentBlock setting is critical for performance. Setting it too low will cause unnecessary historical event queries, while setting it too high will miss orders.Next steps
After configuring the Watch Tower:- Run the Watch Tower locally
- Learn about deployment options