Skip to content

Conversation

@Officialhomie
Copy link

Summary

Adds a new “doctor” diagnostics command to help self-hosters quickly validate configuration and runtime prerequisites (env, DB, migrations, RPC connectivity) and reduce maintainer support burden.

Commands

  • From repo root: pnpm of:doctor
  • From server package: pnpm -C packages/server run of:doctor

What it checks

  • Environment
    • Verifies critical secrets are present (does not print secret values)
    • Flags common misconfigs with actionable fixes (URLs, treasuries for /stats, etc.)
  • Database
    • Non-invasive: does not create a DB file
    • If DB exists: checks connectivity, migrations table presence, and reports pending migrations by comparing against src/db/migrations/*.ts
  • Network connectivity
    • Solana RPC health via JSON-RPC getHealth
    • EVM RPC health for any explicitly configured *_RPC_URL env vars via eth_blockNumber
    • Warns on slow endpoints

JSON output + CI friendliness

  • Supports --json for structured output.
  • Exits non-zero only when failures are present (warnings do not fail).

Files changed

  • package.json: add root of:doctor script
  • packages/server/package.json: add server of:doctor script
  • packages/server/scripts/doctor.ts: implement diagnostics tool (safe secret handling, script-relative migration discovery, bounded timeouts)

Test plan

  • Run pnpm of:doctor
  • Run pnpm of:doctor -- --json

- package.json: add root `of:doctor` script to run server diagnostics from repo root.
- packages/server/package.json: add `of:doctor` script (tsx) to run `scripts/doctor.ts`.
- packages/server/scripts/doctor.ts: implement non-invasive doctor tool (env + DB + migrations + RPC checks) with `--json` output and safe secret handling.
@vercel
Copy link

vercel bot commented Jan 19, 2026

@Officialhomie is attempting to deploy a commit to the Ben's Team Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant