Self-hosting & operations

Monitoring & backups

Health checks, what to alert on, logs, and how to back up and restore DATA_DIR safely.

Last updated 1 min readv1.0

#Health checks

Shell
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)
SignalMeaningAction
HTTP non-200 / timeoutServer downRestart; check logs
market: "stale"Last HYPE price is oldCheck outbound access to Hyperliquid
market: "down"No usable priceQuotes and swaps fail with market_unavailable until it recovers
mode is not live, or requestedMode / modeReason presentLive configuration refused (missing address, wrong chain id or no contract code)Fix the environment and restart
status: "degraded" or chain.degraded: trueRPC failing or the indexer more than 300 blocks behind headCheck RPC_URL and outbound access; the API keeps serving while it catches up
chain.indexedBlock not advancingIndexer stalledCheck 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.

Shell
# 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

  1. Stop the server

    So it does not overwrite files on shutdown.

  2. Replace DATA_DIR

    Extract the backup into the data directory (or volume).

  3. 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