This commit is contained in:
squidbear
2025-03-24 05:02:35 +01:00
parent 9049a88672
commit 71f1930023

View File

@@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
request="{\"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}"
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}" echo "${request}"
curl -s -X POST "${1}" -H "Content-Type: application/json" --data "'${request}'"