Created
October 26, 2018 18:31
-
-
Save skwp/8cd1c3e3b0d9d4978bec12ac7e5c8e56 to your computer and use it in GitHub Desktop.
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 | |
# 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