Monitoring & backups
Health checks, what to alert on, logs, and how to back up and restore DATA_DIR safely.
#Health checks
curl -fsS https://<host>/api/health
# {"ok":true,"status":"ok","mode":"live","at":1796299900000,"store":{"ok":true,"error":null},"market":"ok","chain":{"chainId":99901,"rpcOk":true,"degraded":false,"lagBlocks":3,"…":"…"}} (abridged)| Signal | Meaning | Action |
|---|---|---|
| HTTP non-200 / timeout | Server down | Restart; check logs |
market: "stale" | Last HYPE price is old | Check outbound access to Hyperliquid |
market: "down" | No usable price | Quotes and swaps fail with market_unavailable until it recovers |
mode is not live, or requestedMode / modeReason present | Live configuration refused (missing address, wrong chain id or no contract code) | Fix the environment and restart |
status: "degraded" or chain.degraded: true | RPC failing or the indexer more than 300 blocks behind head | Check RPC_URL and outbound access; the API keeps serving while it catches up |
chain.indexedBlock not advancing | Indexer stalled | Check logs; restart the process (it resumes from its cursor) |
#Logs
The server writes structured log lines (e.g. api.unhandled, store.read_failed) to stdout and stderr. Under Docker use docker compose logs; under PM2 they go to logs/out.log and logs/err.log.
#Backups
All off-chain state is in DATA_DIR (the protocol state itself is on-chain, and the indexer can rebuild from the chain). Writes are atomic (temp file, then rename), so a copy taken at any moment is consistent per file. Back up at least hourly and before every deploy.
# host directory
tar czf em-data-$(date +%F-%H%M).tgz -C /srv/elysium-morning data
# docker volume
docker run --rm -v em-data:/data -v "$PWD":/backup alpine \
tar czf /backup/em-data-$(date +%F-%H%M).tgz -C /data .#Restore
- Stop the server
So it does not overwrite files on shutdown.
- Replace DATA_DIR
Extract the backup into the data directory (or volume).
- Start and verify
Check
/api/health, then the app's Today page.
Something unclear or wrong on this page? Report it.Updated Dec 1, 2026 · v1.0