Created
June 20, 2018 14:08
-
-
Save dleonard00/980ceca4be2c6542dc95efbca9313cfd to your computer and use it in GitHub Desktop.
show geth sync progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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