Skip to content

Instantly share code, notes, and snippets.

@apemon
Last active March 12, 2018 13:48
Show Gist options
  • Save apemon/5b83d02b401cbc6a0a8a33a4df8557e8 to your computer and use it in GitHub Desktop.
Save apemon/5b83d02b401cbc6a0a8a33a4df8557e8 to your computer and use it in GitHub Desktop.

Create a bitcoin-cli shortcut to interface with the node

cat /usr/local/bin/bitcoin-cli
#!/usr/bin/env bash
docker run --rm --network container:bitcoind_testnet -v /scratch/bitcoin/testnet/bitcoind:/data dougvk/bitcoind:latest bitcoin-cli -testnet "$@"

Grant permission to shortcut

chmod +x /usr/local/bin/bitcoin-cli

Test

bitcoin-cli getinfo
{
  "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16",
  "version": 150100,
  "protocolversion": 70015,
  "walletversion": 139900,
  "balance": 0.00000000,
  "blocks": 1287948,
  "timeoffset": 0,
  "connections": 12,
  "proxy": "",
  "difficulty": 1,
  "testnet": true,
  "keypoololdest": 1518350149,
  "keypoolsize": 2000,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "errors": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment