Skip to content

Instantly share code, notes, and snippets.

@yondonfu
Created April 24, 2018 03:34
Show Gist options
  • Save yondonfu/790b29f2cc7a880370d11eed9a1f5dca to your computer and use it in GitHub Desktop.
Save yondonfu/790b29f2cc7a880370d11eed9a1f5dca to your computer and use it in GitHub Desktop.
res=$(curl -s -X POST -H "Content-Type: application/json" localhost:8545 --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' | jq '.result')
temp=${res%\"}
temp=${temp#\"}
blk=${temp:2}
blk=$((0x${blk}))
while (( $blk <= 5264265 ))
do
echo $blk
sleep 2
res=$(curl -s -X POST -H "Content-Type: application/json" localhost:8545 --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' | jq '.result')
temp=${res%\"}
temp=${temp#\"}
blk=${temp:2}
blk=$((0x${blk}))
done
if (( $blk >= 5264265 )); then
parityPID=$(pgrep parity)
kill -s 2 $parityPID
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment