system_syncState - Kusama
Example code for the system_syncState JSON-RPC method. Complete guide on how to use system_syncState JSON-RPC in GetBlock Web3 documentation.
Returns the starting, current, and highest known block numbers, describing how far the node has synced.
Parameters
Request
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "system_syncState",
"params": []
}'const axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'system_syncState',
params: []
}, { headers: { 'Content-Type': 'application/json' } });
console.log(response.data.result);import requests
response = requests.post(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'id': 'getblock.io',
'method': 'system_syncState',
'params': []
}
)
print(response.json())Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"startingBlock": 24000000,
"currentBlock": 25123456,
"highestBlock": 25123456
}
}Response Fields
Field
Type
Description
startingBlock
integer
Block the node started syncing from
currentBlock
integer
Block currently imported
highestBlock
integer
Best known block on the network
Use Cases
Sync Monitoring: Compare currentBlock to highestBlock
Readiness: Gate traffic until fully synced
Dashboards: Show sync progress
Error Handling
Error
Message
Description
-32603 / Internal error
Internal error
The node failed to report sync state
403 / RBAC: access denied
Access denied
The GetBlock access token is missing or incorrect
Last updated
Was this helpful?