A BASH CLI JSON RPC Interface for Bitcoin and compatible coins.
Bitcoin already has a bitcoin-cli program so while this script will work with Bitcoin, it's probably most useful for altcoins that do not have one compiled for their coin, but still have JSON RPC.
Requires curl and jq (apt-get install jq curl)
Simply fill in your rpc user, pass and port in the variables at the beginning of the script to begin using.
You will find the RPC user and password in the coin's .conf file. Find the RPC port in chainparams.cpp of the coin's source code. e.g. Dogecoin RPC port is 22555
In your terminal run ./bitcoin-cli to see help with a list of available commands
You can install for system-wide usage by symlinking
WARNING - on a shared system any user will now be able to run this command and access your wallet
ln -s /home/user/bitcoin-cli-bash/bitcoin-cli /usr/local/bin/bitcoin-cli
Then bitcoin-cli
will work from any directory without the preceeding ./
Just make a copy of the file under whatever name makes sense and fill in the appropriate RPC info. e.g. dogecoin-cli
./bitcoin-cli help getinfo
./bitcoin-cli getinfo
./bitcoin-cli listunspent 0
So far only simple commands have been verified. Will need to test with more advanced commands e.g. raw transactions etc. Help and feedback with this are welcome, please submit an issue on github