Block
Establish a websocket connection to the node to receive real-time updates on new blocks.
This endpoint can also be used to resume a subscription from a specific point in time.
Example:
const ws = new WebSocket('ws://localhost:8669/subscriptions/block')
ws.onmessage = (event) => {
console.log(event.data)
}
Query parameters
posstringOptionalPattern:
A saved block ID for resuming the subscription. If omitted, the best block ID is assumed.
Note: If the provided position is too far behind the best block, a 403 error will be thrown. The allowable difference depends on the configuration of each node.
See the argument api-backtrace-limit
when starting a node.
^(0x)?[0-9a-fA-F]{64}$
Responses
200
OK
application/json
Responseall of
and
and
400
Bad Request
text/plain
403
Forbidden
text/plain
get
GET /subscriptions/block HTTP/1.1
Host: vet.nownodes.io
Accept: */*
{
"number": 325324,
"id": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"size": 373,
"parentID": "0x0004f6cb730dbd90fed09d165bfdf33cc0eed47ec068938f6ee7b7c12a4ea98d",
"timestamp": 1533267900,
"gasLimit": 11253579,
"beneficiary": "0xb4094c25f86d628fdd571afc4077f0d0196afb48",
"gasUsed": 21000,
"totalScore": 1029988,
"txsRoot": "0x89dfd9fcd10c9e53d68592cf8b540b280b72d381b868523223992f3e09a806bb",
"txsFeatures": 0,
"stateRoot": "0x86bcc6d214bc9d8d0dedba1012a63c8317d19ce97f60c8a2ef5c59bbd40d4261",
"receiptsRoot": "0x15787e2533c470e8a688e6cd17a1ee12d8457778d5f82d2c109e2d6226d8e54e",
"com": true,
"signer": "0xab7b27fc9e7d29f9f2e5bd361747a5515d0cc2d1",
"obsolete": false,
"transactions": [
[
"0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477"
]
]
}