neat one liner

This commit is contained in:
Sebastian
2024-12-13 09:56:57 +01:00
parent 55ba3ebcaa
commit 00cd9aafb8

3
utils/latest.sh Executable file
View File

@@ -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}'