MEGAETHDOCS
GitHubGet started →
API

eth_subscribe

Subscribe to realtime channels over WebSocket.

Request

eth_subscribe.jsonjson
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_subscribe",
"params": ["miniBlocks"]
}

Supported Channels

ChannelPayloadUse case
miniBlocksMini block + execution contextRealtime app state
newHeadsEVM block headersCanonical block indexing
logsEvent logsEvent-driven integrations
pendingTransactionsTx hashesMempool-aware UX

Keep connection alive with periodic eth_chainId (every ~30s) on long-lived sockets.

Was this page helpful?

Edit on GitHub