Created
August 25, 2023 17:08
-
-
Save csknk/a8761a820439b37ef9ed818e32e04f23 to your computer and use it in GitHub Desktop.
Basic script to run against Bitcoin bitcoind server on LAN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Basic script to run against Bitcoin bitcoind server on LAN | |
# Ref: Bitcoin Core getchaintips RPC command: https://bitcoincore.org/en/doc/0.21.0/rpc/blockchain/getchaintips | |
set -eou pipefail | |
IFS=$'\n\t' | |
# Set variables ---- | |
user=XXXXXX | |
password=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
node_ip=192.168.0.XXX | |
# End -------------- | |
port=8332 | |
data=$( | |
cat <<-EOF | |
{ | |
"jsonrpc": "1.0", | |
"id": "curltest", | |
"method": "getchaintips" | |
} | |
EOF | |
) | |
# Add -vvvv for verbose output/debugging | |
curl \ | |
-vvvv \ | |
--user "${user}:${password}" \ | |
--data-binary "$data" \ | |
-H 'content-type: text/plain;' \ | |
"${node_ip}:${port}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment