The /health Endpoint
Every Paychainly instance exposes a GET /health endpoint that returns the status of all critical subsystems:
{
"status": "ok",
"db": "connected",
"rpc": { "active": "https://bsc-dataseed.binance.org/", "pool": 6 },
"gasWallet": { "bnb": "0.127", "status": "ok" },
"queues": {
"block-filter": { "waiting": 2, "active": 5 },
"tx-process": { "waiting": 0, "active": 1 }
}
}
This endpoint skips rate limiting so your uptime monitor can poll it freely.
Setting Up Telegram Alerts
Create a Telegram bot via @BotFather and add to your .env:
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_or_group_id
TELEGRAM_LARGE_PAYMENT_USDT=500 # alert threshold
What Triggers Alerts
- Startup — confirmation that the service booted successfully.
- Crash —
uncaughtException,unhandledRejection,SIGTERMtrigger immediate notifications. - Large payment — any deposit above
TELEGRAM_LARGE_PAYMENT_USDT(default $500). - Queue depth —
block-filterqueue exceeds 500 waiting jobs (checked every 60 seconds). - Gas wallet low — BNB balance drops below
GAS_WALLET_MIN_BNB(default 0.05 BNB).
Integrating with External Uptime Services
Point UptimeRobot, Better Stack, or Grafana Cloud to https://api.yoursite.com/health with a 60-second interval. Alert on non-200 responses or response time above 3 seconds.
Bull Board Queue UI
The built-in Bull Board is available at /admin/queues (JWT-protected). Use it to inspect failed jobs, retry stuck sweeps, and monitor queue throughput in real time.