Skip to content

Instantly share code, notes, and snippets.

@bensig
Created April 6, 2024 05:27
Show Gist options
  • Save bensig/7b8fd3193c77d1877bc7b2d8c6422afc to your computer and use it in GitHub Desktop.
Save bensig/7b8fd3193c77d1877bc7b2d8c6422afc to your computer and use it in GitHub Desktop.
Using curl to test bitcoin rpc authentication
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