Created
December 27, 2021 08:26
-
-
Save tianhaoz95/c7047a31932cd927cdc71fc869964679 to your computer and use it in GitHub Desktop.
A short script to check the sync progress of Cronos node :)
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
#!/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