From 00cd9aafb8257365dfaaaf6ff9e82ee154f24d23 Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Fri, 13 Dec 2024 09:56:57 +0100 Subject: [PATCH] neat one liner --- utils/latest.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 utils/latest.sh diff --git a/utils/latest.sh b/utils/latest.sh new file mode 100755 index 00000000..9985c92a --- /dev/null +++ b/utils/latest.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +curl -s -X POST $1 -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' | jq -r '.result.number, .result.hash' | awk '{if (NR==1) print "Block Number:", strtonum($0); else print "Block Hash:", $0}'