Skip to content

TheGreatAxios/watchtower

Repository files navigation

Watchtower

Stand-alone Agent0 endpoint monitoring service.

Quick Start

# Install
bun install

# Configure
cp .env.example .env
# Edit .env with your values

# Run
bun run dev

Configuration

All config via environment variables. Required:

CHAINS=11155111,84532
RPC_URL_11155111=https://...
RPC_URL_84532=https://...
SECRETS_PRIVATE_KEY=0x...

Storage Adapters

  • postgres - Production PostgreSQL
  • sqlite - Local development
  • memory - Testing (no persistence)
  • redis - High throughput
STORAGE_ADAPTER=postgres
STORAGE_POSTGRES_URL=postgresql://...
STORAGE_IDEMPOTENCY_WINDOW_DAYS=7

Metrics Adapters

  • prometheus - Prometheus metrics on port 9090
  • cloudwatch - CloudWatch EMF logs
  • statsd - StatsD UDP
  • none - Disabled
METRICS_ADAPTER=prometheus
METRICS_PROMETHEUS_PORT=9090

Secrets Adapters

  • env - Environment variable
  • file - JSON/text file
  • vault - HashiCorp Vault
  • aws - AWS Secrets Manager
SECRETS_ADAPTER=env
SECRETS_PRIVATE_KEY=0x...

Scheduling

  • once - Single run and exit
  • cron - Cron expression
  • interval - Fixed interval
  • manual - HTTP API
SCHEDULE_MODE=cron
SCHEDULE_CRON="0 0 * * 0"

Docker

docker-compose -f docker/docker-compose.yml up -d

Railway

railway login
railway init
railway up

Health Checks

  • GET /health - Liveness check
  • GET /health/ready - Deep check with database
  • GET /metrics - Prometheus metrics (when enabled)

Architecture

Modular adapter system:

  • Storage: PostgreSQL, SQLite, Memory, Redis
  • Metrics: Prometheus, CloudWatch, StatsD
  • Secrets: Environment, File, Vault, AWS
  • Schedule: Cron, Interval, Manual, Once

Development

bun run typecheck
bun run build
bun run db:migrate

License

MIT

About

Agent0 Modular Watchtower in Typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published