Skip to main content

🩺 Doctor Tool

The CLAW Doctor is a built-in diagnostic utility to ensure your environment is configured correctly.

Usage

node doctor.js

Diagnostic Checks

The tool performs 11 critical checks:

  1. Node.js Version: Ensures >= 20.0.
  2. Environment Variables: Checks for PORT, DATABASE_URL, WALLET_ENCRYPTION_KEY.
  3. Database Connectivity: Pings PostgreSQL.
  4. Redis Connectivity: Pings Redis instances.
  5. Encryption System: Tests a mock encryption/decryption cycle.
  6. API Key Cache: Verifies Redis-based API key caching.
  7. Policy Engine: Validates rule Loading.
  8. RPC Latency: Pings Alchemy/Infura nodes.
  9. Disk Permissions: Verifies log writing.
  10. Memory Usage: Checks for potential leaks or exhaustion.
  11. Wallet Index: Verifies the wallet database table exists.

Output

The doctor produces a structured report:

  • [PASS] - Everything OK.
  • [WARN] - Minor issue (e.g., slow RPC).
  • [FAIL] - Critical issue stopping the service.

Use node doctor.js --json for automated health reporting.