curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": true
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": true
}false if the node is fully synced, or a sync status object if syncing.
noneresult — false if not syncing, or a sync status object:
startingBlock — block at which sync startedcurrentBlock — current block being syncedhighestBlock — estimated highest blocketh_syncing code examplesconst Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);
async function checkSyncStatus() {
const syncing = await web3.eth.isSyncing();
if (syncing === false) {
console.log("Node is fully synced");
} else {
console.log(`Syncing: ${syncing.currentBlock}/${syncing.highestBlock}`);
}
}
checkSyncStatus()
Was this page helpful?