Skip to content
Subscribe to receive notifications when a new block reaches confirmed or finalized commitment.
Unstable MethodAgave documents this as an unstable RPC PubSub blockSubscribe subscription. It is only available if the validator was started with --rpc-pubsub-enable-block-subscription, which also requires --enable-rpc-transaction-history.

​Parameters

​filter
string | object
required
Filter describing which blocks should produce notifications.
  • all returns every matching block
  • { "mentionsAccountOrProgram": <pubkey> } returns only blocks that contain a transaction mentioning the provided base-58 encoded address
​config
object
Optional configuration object.

​Result

​result
integer
Subscription id. Pass this to blockUnsubscribe.

​Notification format

Notifications are delivered as blockNotification. The example below was captured from a subscription with transactionDetails: "full", showRewards: true, and maxSupportedTransactionVersion: 0.
​jsonrpc
string
Always "2.0".
​method
string
Always "blockNotification".
​params
object
Notification wrapper with the block update payload and the subscription id.