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

system_syncState - Midnight

Example code for the system_syncState JSON-RPC method. Complete guide on how to use system_syncState JSON-RPC in GetBlock Web3 documentation.

This method returns the node's synchronization state, including the block it started from, the block it has reached, and the highest known block on the network.

Parameters

  • None

Request Example

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

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "startingBlock": 657521,
        "currentBlock": 967344,
        "highestBlock": 967344
    }
}

Response Parameters

Field
Type
Description

result.startingBlock

integer

Block number at which the node started syncing

result.currentBlock

integer

Block number the node has synced up to

result.highestBlock

integer

Highest block known to the network

Use Cases

  • Detecting whether a node is behind the tip

  • Computing sync progress as (currentBlock - startingBlock) / (highestBlock - startingBlock)

  • Monitoring dashboards and alerting on lagging nodes

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?