eth_syncing - Ethereum
Example code for the eth_syncing JSON RPC method. Сomplete guide on how to use eth_syncing JSON RPC in GetBlock Web3 documentation.
This method returns an object with sync status data when the node is catching up to the chain tip, or false when the node is fully synced. Managed RPC endpoints typically return false unless a specific backend node is currently mid-sync.
Parameters
This method takes no 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",
"method": "eth_syncing",
"params": [],
"id": "getblock.io"
}'const axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'eth_syncing',
params: [],
id: 'getblock.io'
}, {
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',
'method': 'eth_syncing',
'params': [],
'id': 'getblock.io'
}
)
print(response.json())Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": false
}Response Parameters
jsonrpc
string
JSON-RPC protocol version ("2.0")
id
string
Request identifier matching the request
result
boolean or object
false if fully synced, or an object with startingBlock, currentBlock, highestBlock (hex) if catching up
Use Cases
Node Freshness Verification: Confirm a node is at chain tip before treating its reads as canonical
Sync Progress Monitoring: Track a self-hosted node's catch-up progress via the
currentBlock/highestBlockfieldsFailover Decisioning: Skip a syncing backend and route to a fully-synced one at the load balancer level
Error Handling
-32603
Internal error
Node failed to determine its sync state
Web3 Integration
Last updated
Was this helpful?