For the complete documentation index, see llms.txt. This page is also available as Markdown.

getconsensusblock - TON

Example code for the getconsensusblock JSON-RPC method. Сomplete guide on how to use getconsensusblock JSON-RPC in GetBlock.io Web3 documentation.

This method returns the masterchain block currently confirmed by consensus, including the underlying timestamp. Useful for sanity-checking that the node is keeping up with consensus.

Parameters

  • None

Request Example

REST (GET):

curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/getConsensusBlock' \
--header 'Content-Type: application/json'

JSON-RPC (POST):

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getConsensusBlock",
    "params": {},
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result.consensus_block

integer

Seqno of the most recently consensus-confirmed masterchain block

result.timestamp

number

Unix timestamp at which consensus was observed (seconds)

Use Cases

  • Verifying node sync health

  • Pinning a stable read snapshot across multiple calls

  • Latency / freshness monitoring of the RPC endpoint

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

422

Validation Error

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

504

Lite Server Timeout

Upstream TON liteserver timed out

SDK Integration

Last updated

Was this helpful?