Blockchain Monitoring

Production engineering guide for blockchain monitoring in Web3 and blockchain systems.

Blockchain Monitoring is the practice of continuously observing the health, performance, and behavior of blockchain systems — from nodes and consensus layers to transaction lifecycles and smart contract execution. It matters when a blockchain is live and critical: when users expect finality, when applications depend on timely confirmations, when failures ripple across multiple services. Monitoring is not a luxury; it is the first line of defense when a node fails to sync, a validator misses a slot, or a transaction stalls at the mempool.

Observing Node Health

A blockchain node is the bedrock of any chain. To monitor it effectively, focus on uptime, sync status, and resource utilization.

The primary signal is node_syncing. A node is syncing when latest_block_number > current_block_number. This can be observed via the JSON-RPC eth_syncing method:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "startingBlock": 1000000,
    "currentBlock": 1005678,
    "highestBlock": 1020000,
    "inProgress": true
  }
}

When inProgress is true, the node is actively fetching blocks. If currentBlock stops advancing for more than 10 minutes, a sync stall is likely. To detect this, query eth_syncing every 30 seconds and alert on currentBlock not changing for 3 consecutive intervals.

For long-running nodes, track node_health via a health check endpoint. A node should expose GET /health with a 200 response and a body including:

{
  "status": "healthy",
  "syncing": true,
  "current_block": 1005678,
  "latest_block": 1020000,
  "peers": 52,
  "disk_usage": 421000000000,
  "memory_usage": 210000000,
  "uptime": 864000
}

The disk_usage and memory_usage values are in bytes. A threshold alert triggers when disk usage exceeds 90% or memory usage exceeds 85% of available RAM.

For performance, monitor eth_getBlockByNumber latency. A 95th percentile latency above 300ms indicates a bottleneck in block retrieval. Use curl to test:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["0x100000", true]}' \
  http://localhost:8545 \
  -w "Latency: %{time_total}s\n"

A time_total of over 500ms suggests the node is under load or the database layer is slow.

Tracking Consensus and Validator Performance

In proof-of-stake chains, validators are the engines of consensus. Monitoring them requires tracking slot progress, attestation and block proposals, and missed or delayed events.

The key metric is slot_time, which defines when a new block should be produced. A validator is expected to produce a block in every slot. Use GET /eth/v1/beacon/validators/{index} to retrieve a validator’s status.

A validator is considered active if status is active_ongoing, active_exiting, or active_slashed. The current_epoch and current_slot are critical for tracking liveness.

To detect missed slots, query GET /eth/v1/beacon/epochs/{epoch}/proposals and GET /eth/v1/beacon/epochs/{epoch}/attestations. A proposal is missing if a validator’s proposer_index does not appear in the proposals list.

Track attestation coverage by comparing the number of attestations received against the expected number (typically 2 * validators_in_epoch). A low ratio indicates network congestion or validator failures.

Use eth_getLogs to track AttestationReceived and BlockProposed events from the beacon chain. For example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getLogs",
  "params": [
    {
      "address": "0x0000000000000000000000000000000000000001",
      "topics": [
        "0x59358742a3e86937633a31b4283d7b311753134b3c06f071c04e8066311c7b88"
      ],
      "fromBlock": "0x100000",
      "toBlock": "0x100010"
    }
  ]
}

This query returns all AttestationReceived events from the beacon chain contract. A missing event in a slot suggests a validator failed to submit an attestation.

Detecting Transaction Lifecycles

Transactions are the lifeblood of a blockchain. Monitoring them involves tracking their journey from submission to finality.

Start with eth_sendTransaction. The response includes tx_hash, which becomes the primary identifier. Use eth_getTransactionReceipt to track progress:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0x9b0d18d22b6f2530e05718018b149e53b45053366b4d5a5e5554c9380551e0f0",
    "blockNumber": "0x100000",
    "contractAddress": null,
    "cumulativeGasUsed": "0x18a1b",
    "effectiveGasPrice": "0x1388",
    "from": "0x742d35Cc6634C0532925a3b8D4C2A1513c658310",
    "gasUsed": "0x18a1b",
    "status": "0x1",
    "to": "0x8061645a42595614d6f1269a6711f481b55352f9",
    "transactionHash": "0x68d85198381d4575b2e18443851962b065f697111b5588a4686583e6d499018c",
    "transactionIndex": "0x0"
  }
}

The status field is 0x1 (true) for success. If status is 0x0, the transaction reverted. Use eth_getTransactionByHash to retrieve the full transaction object and extract the input data, which can reveal the error.

For long-lived transactions, use eth_getFilterChanges with a newHeads filter:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_newFilter",
  "params": [
    {
      "fromBlock": "0x100000",
      "toBlock": "latest",
      "address": "0x8061645a42595614d6f1269a6711f481b55352f9",
      "topics": []
    }
  ]
}

This filter captures all events from a contract. Poll it every 10 seconds with eth_getFilterChanges. If no new events appear for 15 minutes, suspect a stuck transaction.

Detecting and Diagnosing Failures

Failures in blockchain systems often manifest as silent stalls or cascading errors.

A common silent failure is mempool congestion. When eth_getBlockByNumber returns a block with fewer transactions than expected, and eth_getTransactionCount shows a growing number of pending transactions, the mempool is full. Use eth_getTransactionCount to track pending transactions:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionCount","params":["0x742d35Cc6634C0532925a3b8D4C2A1513c658310", "pending"]}' \
  http://localhost:8545

If the count increases by more than 100 per minute, the mempool is under pressure. A pending count over 10,000 suggests a bottleneck.

A second failure is finality delay. In a beacon chain, finality occurs when current_epoch % 32 == 0. The eth_getBeaconState endpoint reveals the finalized_checkpoint and current_justified_checkpoint. When finalized_checkpoint.epoch < current_justified_checkpoint.epoch - 1, finality is delayed.

Use GET /eth/v1/beacon/states/{state_id}/finalized_checkpoint to retrieve the finalized state. If the finalized_checkpoint.epoch lags behind current_epoch by more than 64 slots (about 32 minutes), the chain is experiencing finality issues.

A third failure is node reconnection. When a node disconnects from peers and reconnects, it may miss blocks. To detect this, track node_peer_count and node_syncing over time. A sudden drop in peer count from 50 to 10, followed by inProgress: true, indicates a disconnection.

Use GET /eth/v1/node/peers to fetch peer details:

[
  {
    "peer_id": "16Uiu2HakTq5R1T4vDc33b45XuN2p8kL3HwYjgK2oK8Fq5tRr647K",
    "address": "/ip4/192.168.1.100/tcp/30303/p2p/16Uiu2HakTq5R1T4vDc33b45XuN2p8kL3HwYjgK2oK8Fq5tRr647K",
    "status": "connected",
    "last_seen": "2024-01-01T12:00:00Z"
  }
]

If last_seen is more than 10 minutes old, the peer is likely disconnected. A full reconnection event is signaled by a new peer_id and a status of connected after a period of disconnected.

Setting Up a Monitoring Pipeline

Combine tools to build a robust monitoring pipeline.

Use systemctl to manage node processes:

systemctl status geth
systemctl status lighthouse
systemctl is-active lighthouse
systemctl --failed

Log output to journalctl for real-time debugging:

journalctl -u geth -f --since "2024-01-01T12:00:00"
journalctl -u lighthouse --since "1 hour ago" | grep -i "error"

Use curl to run health checks periodically:

#!/bin/bash
while true; do
  curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" \
    "http://localhost:8545/health"
  sleep 30
done

Store monitoring data in a PostgreSQL database:

CREATE TABLE node_metrics (
  id SERIAL PRIMARY KEY,
  node_name TEXT NOT NULL,
  timestamp TIMESTAMPTZ NOT NULL,
  syncing BOOLEAN,
  current_block BIGINT,
  latest_block BIGINT,
  peers INT,
  disk_usage BIGINT,
  memory_usage BIGINT,
  latency_ms DOUBLE PRECISION
);

CREATE INDEX idx_node_metrics_timestamp ON node_metrics(timestamp);

Use psql to insert metrics:

INSERT INTO node_metrics (
  node_name,
  timestamp,
  syncing,
  current_block,
  latest_block,
  peers,
  disk_usage,
  memory_usage,
  latency_ms
) VALUES (
  'mainnet-node-01',
  NOW(),
  true,
  1005678,
  1020000,
  52,
  421000000000,
  210000000,
  0.423
);

Common Pitfalls and Sharp Edges

Monitoring a blockchain is not about collecting metrics. It is about understanding the chain’s heartbeat, its breath, and its silence. When the chain sleeps, the monitor wakes it. When the chain stumbles, the monitor sees it before it falls.

This page was rewritten on 18 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.