Skip to content

Instantly share code, notes, and snippets.

@npodonnell
Last active January 4, 2021 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save npodonnell/91f0d3a561467efd0cb68583815b5959 to your computer and use it in GitHub Desktop.
Save npodonnell/91f0d3a561467efd0cb68583815b5959 to your computer and use it in GitHub Desktop.
Bitcoin CLI Commands

Bitcoin CLI Commands

N. P. O'Donnell, 2018-2020

Help & Information

Get help:

bitcoin-cli help

Get info on local node (mempool, etc):

bitcoin-cli getinfo

Blockchain Information

Get up-to-date info about the blockchain:

bitcoin-cli getblockchaininfo

Get block count:

bitcoin-cli getblockcount

Get a raw transaction:

bitcoin-cli getrawtransaction <txid>

Decode raw transaction:

bitcoin-cli decoderawtransaction <hextx>

Peer Management

List peers:

bitcoin-cli getpeerinfo

Account Management

List accounts:

bitcoin-cli listaccounts

Get unconfirmed balance: This is money that's coming to you but hasn't yet been confirmed in a block

bitcoin-cli getunconfirmedbalance

Get total balance held in all UTXOs:

bitcoin-cli getbalance

List unspent UTXOs:

bitcoin-cli listunspent

Get a new address:

bitcoin-cli getnewaddress

Dump a private key from address:

bitcoin-cli dumpprivkey <address>

Import a private key (WIF format):

bitcoin-cli importprivkey <wifkey>

Sending Money

Send bitcoin to address:

bitcoin-cli sendtoaddress <address> <amountexcludingfee>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment