diff --git a/get-block.sh b/get-block.sh new file mode 100755 index 00000000..7ead25ea --- /dev/null +++ b/get-block.sh @@ -0,0 +1,4 @@ +#!/bin/bash + + +curl -s -X POST "${1}" -H "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"${2:-latest}\",false],\"id\":1}' | jq -r '.result.number, .result.hash' | gawk '{if (NR==1) print \"Block Number:\", strtonum($0); else print \"Block Hash:\", $0}"