Skip to content

Instantly share code, notes, and snippets.

@assafmo
Last active September 23, 2020 21:26
Show Gist options
  • Select an option

  • Save assafmo/2037d3a08ca5c9bcc25ea026ce7694a8 to your computer and use it in GitHub Desktop.

Select an option

Save assafmo/2037d3a08ca5c9bcc25ea026ce7694a8 to your computer and use it in GitHub Desktop.
Node sync progress bar + ETA
#!/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