Skip to main content

Dump Database Command

Export the Watch Tower database as JSON for analysis and debugging. The dump-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

number
required
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)
string
default:"./database"
Path to the database directory to read from.Environment variable: DATABASE_PATH
string
default:"INFO"
Log level for the dump operation. Controls the verbosity of logging output.Environment variable: LOG_LEVEL

Output format

The command outputs JSON to standard output (STDOUT), containing the complete registry state for the specified chain ID. The output includes:
  • Registered programmatic orders
  • Order owners and their associated contracts
  • Order execution state and history
  • Chain-specific registry data
The exact structure depends on the internal registry format used by the Watch Tower.

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

Use jq to format the JSON output:

Environment variables

You can configure the dump using environment variables:

Use cases

Debugging

Examine the current state of the Watch Tower’s database to debug issues:

Backup

Create a backup of the database state:

Analysis

Analyze order execution patterns across different chains:
Last modified on March 12, 2026