Created
April 6, 2024 05:27
-
-
Save bensig/7b8fd3193c77d1877bc7b2d8c6422afc to your computer and use it in GitHub Desktop.
Using curl to test bitcoin rpc authentication
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
rpcuser=$1 | |
rpcpass=$2 | |
url=$3 #should be http://localhost:8332 for mainnet or http://localhost:38332 for signet | |
curl --user $rpcuser:$rpcpass --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' $URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment