From 71f193002388817c6d6546dd18a2582ff3c60fb6 Mon Sep 17 00:00:00 2001 From: squidbear <379651+czarly@users.noreply.github.com> Date: Mon, 24 Mar 2025 05:02:35 +0100 Subject: [PATCH] try --- get-block.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/get-block.sh b/get-block.sh index 7ead25ea..3b6c397f 100755 --- a/get-block.sh +++ b/get-block.sh @@ -1,4 +1,7 @@ #!/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}'"