Returns an object with data about the sync status or false
.
Supported on Klaytn (mainnet) only.
Parameters
Request
None
Result
Object|Boolean
, an object with sync status data or false
when not syncing:
Name | Type | Description |
---|---|---|
startingBlock | QUANTITY | The block at which the import started (will only be reset, after the sync reached his head). |
currentBlock | QUANTITY | The current block, same as klay_blockNumber . |
highestBlock | QUANTITY | The estimated highest block. |
pulledStates | QUANTITY | The number of state entries processed until now. If the sync mode is not "fast", zero is returned. |
knownStates | QUANTITY | The number of known state entries that still need to be pulled. If the sync mode is not "fast", zero is returned. |
API Endpoint
The format of a Klaytn API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/klaytn/
Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/klaytn/
Example
// Request
curl https://open-platform.nodereal.io/{{apiKey}}/klaytn/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"klay_syncing","params":[],"id":1}'
// Result
{
"jsonrpc": "2.0",
"id":1,
"result": {
"currentBlock":"0x3e31e",
"highestBlock":"0x827eef",
"knownStates":"0x0",
"pulledStates":"0x0",
"startingBlock":"0x0"
}
}
// Or when not syncing
{
"jsonrpc": "2.0",
"id":1,
"result": false
}