Returns an object with data about the sync status or false
if the node is not syncing.
Request Format
{
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": [],
"id": 1
}
Response Format
If the node is syncing:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"startingBlock": "0x0",
"currentBlock": "0x1518",
"highestBlock": "0x9567a3"
}
}
If the node is not syncing:
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
Parameters
None.
Return Value
- Syncing Status (
SyncingStatus
orfalse
):- If syncing, returns an object containing:
startingBlock
(uint
): Block number where syncing started.currentBlock
(uint
): Current block number the node is processing.highestBlock
(uint
): Latest known block number.
- If not syncing, returns
false
.
- If syncing, returns an object containing:
Example
Request
{
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": [],
"id": 1
}
Response (if syncing)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"startingBlock": "0x0",
"currentBlock": "0x1518",
"highestBlock": "0x9567a3"
}
}
Response (if not syncing)
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
Notes
- Useful for monitoring the sync progress of an Ethereum node.
- If the result is
false
, the node is fully synced and up-to-date with the network.