Dump Database Command
Export the Watch Tower database as JSON for analysis and debugging. Thedump-db command exports the Watch Tower’s internal database state as JSON to standard output. This is useful for debugging, analysis, and data migration.
Usage
Options
Chain ID to dump from the database. This is a required parameter.Example:
--chain-id 1 (for Ethereum mainnet) or --chain-id 100 (for Gnosis Chain)Path to the database directory to read from.Environment variable:
DATABASE_PATHLog level for the dump operation. Controls the verbosity of logging output.Environment variable:
LOG_LEVELOutput format
The command outputs JSON to standard output (STDOUT), containing the complete registry state for the specified chain ID. The output includes:- Registered conditional orders
- Order owners and their associated contracts
- Order execution state and history
- Chain-specific registry data
Examples
Basic usage
Dump the database for Ethereum mainnet (chain ID 1):Save to file
Redirect the output to a JSON file:Custom database path
Dump from a database in a custom location:With debug logging
Enable verbose logging during the dump:Pretty-print output
Usejq to format the JSON output: