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/bash | |
LATEST_BLOCK_HEIGHT=$(omniflixhubd query tendermint-validator-set | jq . | grep block_height | grep -o -E '[0-9]+') | |
YOUR_BLOCK_HEIGHT=$(omniflixhubd status 2>&1 | jq ."SyncInfo"."latest_block_height"| grep -o -E '[0-9]+') | |
DIFF_BLOCK_HEIGHT=$(expr $LATEST_BLOCK_HEIGHT - $YOUR_BLOCK_HEIGHT) | |
DIFF_BLOCK_LIMIT=0 | |
for (( ;; )); do | |
echo -e "LATEST BLOCK HEIGHT: ${LATEST_BLOCK_HEIGHT} \n" | |
echo -e "YOUR BLOCK HEIGHT: ${YOUR_BLOCK_HEIGHT} \n" | |
echo -e "Diff are ${DIFF_BLOCK_HEIGHT}" | |
if [ $DIFF_BLOCK_HEIGHT -gt $DIFF_BLOCK_LIMIT ]; then |