Skip to content

Instantly share code, notes, and snippets.

@tianhaoz95
Created December 27, 2021 08:26
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 tianhaoz95/c7047a31932cd927cdc71fc869964679 to your computer and use it in GitHub Desktop.
Save tianhaoz95/c7047a31932cd927cdc71fc869964679 to your computer and use it in GitHub Desktop.
A short script to check the sync progress of Cronos node :)
#!/bin/sh
TOTAL_HEIGHT=$(curl -s https://rpc-cronos.crypto.org/commit | jq -r ".result.signed_header.header.height")
CURRENT_HEIGHT=$(cronosd status 2>&1 --home $CRONOS_HOME | jq -r '.SyncInfo.latest_block_height')
PROGRESS=$(echo "scale=2; $CURRENT_HEIGHT/$TOTAL_HEIGHT*100" | bc -l)
echo "Progress $CURRENT_HEIGHT / $TOTAL_HEIGHT ($PROGRESS%)"
# The result will look something like:
# Progress 155937 / 748704 (20.00%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment