Skip to content

Instantly share code, notes, and snippets.

@skwp
Created October 26, 2018 18:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skwp/8cd1c3e3b0d9d4978bec12ac7e5c8e56 to your computer and use it in GitHub Desktop.
Save skwp/8cd1c3e3b0d9d4978bec12ac7e5c8e56 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Runs a command against the btc node running in docker
# Usage: ./btcrpc [command]
command=$@
if [[ -z "$command" ]]; then
echo "Usage: ./btcrpc [command]"
echo "Example: ./btcrpc getmininginfo"
exit 1
fi
if [[ -z "$rpcpassword" ]]; then
echo "The rpcpassword env variable is not set."
exit 1
fi
docker exec bitcoin /usr/local/bin/bitcoin-cli -rpcuser=$rpcuser -rpcpassword=$rpcpassword $command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment