Last active
September 23, 2020 21:26
-
-
Save assafmo/2037d3a08ca5c9bcc25ea026ce7694a8 to your computer and use it in GitHub Desktop.
Node sync progress bar + ETA
This file contains hidden or 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
| #!/bin/bash | |
| NETWORK_BLOCK_NUMBER=$( | |
| curl -s http://client.secretnodes.org:26657/status | jq '.result.sync_info.latest_block_height | tonumber' | |
| ) | |
| LOCAL_BLOCK_NUMBER=$(secretcli status | jq '.sync_info.latest_block_height | tonumber') | |
| BLOCKS_LEFT_TO_SYNC=$(jq -n "${NETWORK_BLOCK_NUMBER} - ${LOCAL_BLOCK_NUMBER}") | |
| sudo journalctl -u secret-node -f | | |
| grep -Po 'height=\d+ txs=' | | |
| pv -l -s "${BLOCKS_LEFT_TO_SYNC}" > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment