Skip to content

Instantly share code, notes, and snippets.

@mechawrench
Created September 16, 2019 21:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mechawrench/088cc8bf14d5c6ff36a00a1b0dd32c12 to your computer and use it in GitHub Desktop.
Use this script in combination with "geth attach"
var lastPercentage = 0;var lastBlocksToGo = 0;var timeInterval = 10000;
setInterval(function(){
var percentage = eth.syncing.currentBlock/eth.syncing.highestBlock*100;
var percentagePerTime = percentage - lastPercentage;
var blocksToGo = eth.syncing.highestBlock - eth.syncing.currentBlock;
var bps = (lastBlocksToGo - blocksToGo) / (timeInterval / 1000)
var etas = 100 / percentagePerTime * (timeInterval / 1000)
var etaM = parseInt(etas/60,10);
console.log(parseInt(percentage,10)+'% ETA: '+etaM+' minutes @ '+bps+'bps');
lastPercentage = percentage;lastBlocksToGo = blocksToGo;
},timeInterval);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment