Health & Stats API

System endpoints for monitoring node status and network statistics.

Health Check

GET /api/health

Returns the node's current status.

Response

{
  "status": "ok",
  "chain_id": "rougechain-devnet-1",
  "height": 12345
}
FieldTypeDescription
statusstring"ok" if the node is healthy
chain_idstringThe chain identifier
heightnumberCurrent block height

Use Cases

  • Monitoring node uptime
  • Checking sync status (compare height with peers)
  • Load balancer health checks

Network Statistics

GET /api/stats

Returns network-wide statistics.

Response

{
  "blockHeight": 12345,
  "totalTransactions": 98765,
  "totalWallets": 432,
  "totalValidators": 15,
  "totalStaked": 150000.0,
  "totalBurned": 5000.0,
  "totalPools": 8,
  "chainId": "rougechain-devnet-1"
}
FieldTypeDescription
blockHeightnumberCurrent block height
totalTransactionsnumberTotal transactions processed
totalWalletsnumberUnique wallets on the network
totalValidatorsnumberActive validators
totalStakednumberTotal XRGE staked
totalBurnednumberTotal XRGE burned
totalPoolsnumberNumber of AMM liquidity pools
chainIdstringChain identifier

Burn Stats

GET /api/burned

Get burned token statistics.

Response

{
  "totalBurned": 5000.0,
  "burnAddress": "XRGE_BURN_0x000000000000000000000000000000000000000000000000000000000000DEAD"
}

Examples

Monitoring Script

#!/bin/bash
while true; do
  HEIGHT=$(curl -s http://127.0.0.1:5100/api/health | jq '.height')
  echo "$(date): Block height = $HEIGHT"
  sleep 10
done

Compare with Testnet

LOCAL=$(curl -s http://127.0.0.1:5100/api/health | jq '.height')
TESTNET=$(curl -s https://testnet.rougechain.io/api/health | jq '.height')
echo "Local: $LOCAL, Testnet: $TESTNET, Behind: $((TESTNET - LOCAL))"