block Subscribe
Streams full block contents as each block reaches the requested commitment (unstable upstream).
wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEYblockSubscribe pushes block data as it is produced, either for every block ("all") or only blocks containing a transaction that mentions a given account or program ({"mentionsAccountOrProgram": "<pubkey>"}). Each notification's value.block is shaped like the block object getBlock would return for that slot, with the level of transaction detail controlled by transactionDetails. The config object must set maxSupportedTransactionVersion, currently 1; see Transaction v1.
Upstream Agave marks blockSubscribe unstable and ships it disabled by default, gated behind --rpc-pubsub-enable-block-subscription plus --enable-rpc-transaction-history; constant-k runs both flags, so the subscription works normally here even though many public RPC providers don't expose it. Because it ships whole blocks, it is the heaviest of the subscription methods; logsSubscribe or a filtered programSubscribe cover cases needing only confirmation that something happened, not full transaction payloads.
Parameters
params is a JSON array, with values in this order: filter, config.
Which blocks to receive.
Show one ofOne of
Every block.
allOnly blocks containing a transaction that references this address.
Show propertiesProperties
Base58 account or program id.
Subscription settings. Required here, because maxSupportedTransactionVersion must be set. Every other field in it is optional.
Show propertiesProperties
processed is not accepted for blockSubscribe; only confirmed and finalized blocks can be streamed.
confirmedfinalizedFormat for each transaction's message bytes inside the block payload (irrelevant when transactionDetails is signatures or none, since no transaction bodies are returned).
jsonjsonParsedbase58base64base64+zstdHow much per-transaction detail to include: full transactions, an accounts-only summary, bare signatures, or nothing beyond the block's own metadata.
fullaccountssignaturesnoneWhether to populate the block's rewards array.
Highest transaction version the caller can decode. Required on constant-k: blockSubscribe is refused with -32602 at subscribe time if it is missing. It is a ceiling, not a filter — 1 streams a block's legacy, version 0 and version 1 transactions alike, sent as the JSON integer 1 rather than the string "1". See Transaction v1.
0Maximum: 11Result
The subscription id, returned once in the initial RPC response. Passed to blockUnsubscribe, it cancels the stream.
Notifications
Updates arrive as blockNotification messages on the same socket. result.context.slot and result.value.slot both name the block's slot; result.value.err is null on success or an error object if the node failed to fully replay the block (in which case block is null); result.value.block is the block payload itself, shaped by transactionDetails/encoding/showRewards.
Notification payload.
Show propertiesProperties
Response context, including the slot the data was read at.
Show propertiesProperties
Slot number this applies to.
The requested data; see the fields below.
Show propertiesProperties
Slot number this applies to.
Null on success, or an error object/string describing the failure.
The block payload, or null when err is set.
Show propertiesProperties
Base58 hash identifying this block.
Base58 hash of this block's parent.
Slot of this block's parent.
Estimated production time as a Unix timestamp, or null if unavailable.
Number of blocks beneath this one, or null if unavailable.
Present only when transactionDetails is signatures.
Present only when transactionDetails is full or accounts. Each entry matches a getBlock transaction, including meta.costUnits and, on version 1 transactions, transaction.message.transactionConfig.
Present only when showRewards is true.
Unsubscribe
blockUnsubscribe, called with the subscription id, stops the notifications and returns true once the subscription is removed.
{
"jsonrpc": "2.0",
"id": 2,
"method": "blockUnsubscribe",
"params": [78915]
}Notes
blockSubscribeis on the Nexus plan only. The other subscriptions start at Operator.- WebSocket access is included on the Operator plan and above; it is not available on Free.
- Concurrent connections are capped per API key: 10 on Operator, 50 on Blade Runner, 100 on Nexus.
- Subscribe and unsubscribe calls draw from the same global per-plan request-rate limit as HTTP calls: 50 req/s on Operator, 200 req/s on Blade Runner, 500 req/s on Nexus.
- Only subscription methods (the
*Subscribe/*Unsubscribefamily) are accepted on the WebSocket endpoint; standard request/response RPC methods must go over HTTPS instead. - A
getHealthrequest sent over the open socket on a regular interval serves as a keepalive; connections that go quiet can be dropped by intermediate load balancers. - Each region has its own WebSocket hostname, for example
wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY; every region is listed on the Endpoints page. - Hand-built rather than captured live, since mainnet-beta's public endpoint does not accept
blockSubscribe. blockSubscribeis on Agave's own unstable list; the notification's field names have changed before and may again without a deprecation cycle.maxSupportedTransactionVersionis checked at subscribe time, not when a block arrives; a missing value, or the string"1"instead of the integer1, fails the subscribe call with-32602before any block is streamed.