Skip to content

Commit

Permalink
Update restate-sync.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
zenodeapp authored Jan 18, 2024
1 parent 71eed26 commit a7fb416
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions restate-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ if [ "$ANSWER" != "y" ]; then
fi

# Query block height data
LATEST_HEIGHT=$(curl -s $RPC_SERVER_1/block | jq -r .result.block.header.height)
LATEST_HEIGHT=$(wget -qO- $RPC_SERVER_1/block | jq -r .result.block.header.height)
TRUST_HEIGHT=$(( ((LATEST_HEIGHT - HEIGHT_INTERVAL) / HEIGHT_INTERVAL) * HEIGHT_INTERVAL )) # This makes sure we round to the nearest multiple of HEIGHT_INTERVAL
TRUST_HASH=$(curl -s "$RPC_SERVER_1/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash)
TRUST_HASH=$(wget -qO- "$RPC_SERVER_1/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash)

if [ "$TRUST_HEIGHT" -le 0 ]; then
echo "Error: trust_height cannot be less than or equal to zero. Your [TRUST_HEIGHT] might be too large for the current state of the blockchain or there is something wrong with the RPC server(s)."
Expand Down

0 comments on commit a7fb416

Please sign in to comment.