Skip to main content

API Server Configuration

The Watch Tower includes an HTTP API server providing version information, configuration details, database dumps, and Prometheus metrics. It starts automatically in watch mode.

Default Setup

The API server launches on port 8080 when running watch commands:

Custom Port Configuration

Use the --api-port option to specify an alternative port:
Docker with custom port:

API Endpoints

GET /api/version

Returns version details about the running instance:
Response includes version number, package name, description, and Docker image tag (populated from DOCKER_IMAGE_TAG environment variable).

GET /config

Returns current configuration for all monitored networks, including chain ID, contract address, deployment block, filter policies, and page size settings.

GET /api/dump/:chainId

Exports the entire database for a specific chain. Supported chain IDs include:
  • 1 - Ethereum Mainnet
  • 11155111 - Sepolia
  • 42161 - Arbitrum One
  • 43114 - Avalanche
  • 8453 - Base
  • 100 - Gnosis Chain
  • 137 - Polygon
The dump includes all programmatic orders, owners, and the last processed block.

GET /metrics

Exposes Prometheus-compatible metrics for CPU, memory, Node.js runtime, and custom Watch Tower performance data.

GET /health

Returns health status with HTTP 200 (healthy) or 503 (unhealthy) codes:

GET /

Root endpoint returns: Moooo!

Disabling the API Server

Disable with the --disable-api flag:
This also disables Prometheus metrics, affecting monitoring capabilities.

Docker Configuration

Set DOCKER_IMAGE_TAG environment variable:
Port mapping examples for Docker:

Usage Examples

Check version and health:
Monitor with Prometheus by adding to prometheus.yml:
Export database dumps:
Last modified on March 12, 2026