Skip to main content

chain_subscribeNewHeads RPC Method

Retrieves the best header via subscription.

Updated on
Oct 4, 2023

chain_subscribeNewHeads RPC Method

Parameters

subscription
string
Allows the client to manage the subscription

Returns

parentHash
string
The hash of the parent block header
number
string
The block number of the best header
stateRoot
string
The hash of the state root of the best header
extrinsicsRoot
string
The hash of the extrinsic root of the best header
digest
object
An object containing additional information about the header, such as logs
logs
array
An array of log messages associated with the header
Request
1
wscat -c \
2
# wait for connection
3
{"id":1,"jsonrpc":"2.0","method":"chain_subscribeNewHeads","params":[]}
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free