Skip to content

Instantly share code, notes, and snippets.

@nnzo
Last active May 24, 2022 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nnzo/954222e0fec9d0d84159135a823afed7 to your computer and use it in GitHub Desktop.
Save nnzo/954222e0fec9d0d84159135a823afed7 to your computer and use it in GitHub Desktop.
Monitor Geth node progress script
// PASTE the below into your Geth Javascript console (geth attach)
// Every minute it'll report the total days and estimated blocks per second
lastSyncedBlock = 1;
(function percentage() {
ee = eth.syncing.currentBlock - lastSyncedBlock
perSecond = (ee / 60).toFixed(3)
totalSeconds = (eth.syncing.highestBlock - eth.syncing.currentBlock) / perSecond
totalDays = (totalSeconds / 86400).toFixed(4)
console.log('Rate of ' + perSecond + ' blocks per second. ' + 'Estimated ' + totalDays + ' days.')
lastSyncedBlock = eth.syncing.currentBlock
setTimeout(percentage, 60000);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment