🩺 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:
- Node.js Version: Ensures >= 20.0.
- Environment Variables: Checks for
PORT,DATABASE_URL,WALLET_ENCRYPTION_KEY. - Database Connectivity: Pings PostgreSQL.
- Redis Connectivity: Pings Redis instances.
- Encryption System: Tests a mock encryption/decryption cycle.
- API Key Cache: Verifies Redis-based API key caching.
- Policy Engine: Validates rule Loading.
- RPC Latency: Pings Alchemy/Infura nodes.
- Disk Permissions: Verifies log writing.
- Memory Usage: Checks for potential leaks or exhaustion.
- 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.