In order to use bitcoin in the command line I previously needed to start this (otherwise I get an error):
then I can play with:
This will give you some useful information:
I configure my file bitcoin.conf to use the testnet. But some commands are only really usefull on the regnet.
Then I start using the commands available like this one:
bitcoin-cli getbestblockhash 00000000000000ec0c4ca095989933fe49e4723a1933c2272f4171aa64693e96
Some interesting commands.
Explore the blockchain
getblockchaininfo getblockcount verifychain
It returns the hash of a block (height of the block -a sequential number- is required as an argument)
It returns an estimated network hashes per second based on specified number of recent blocks. It is useful for knowing when the network is running faster or slower.
The hash of the last block synced.
You first need to get a hash of a block using getblockhash.
It gives you the block without transactions.
It mines a number of blocks to an address in the wallet. It can be useful using the regnet. Remember to update the config file bitcoin.conf before.
It provides information about the current wallet.
It creates a list of currently loaded wallets.
walletpassphrasechange oldpass newpass
It updates the passphrase.
It returns details on the active state of the transaction memory pool.
It returns a list of the transactions ids in the mempool.
It returns mempool data for a given transaction.
It returns compute statistics about the total number and rate of transactions in the chain.
It returns the transaction data in a computer friendly format.
It returns a list of transactions for a given account.
It signs inputs for a raw transaction which is formatted to be read by a computer. In version 18 will be removed so we will use signrawtransactionwithkey and signrawtransactionwithwallet instead.
It signs a message with the private key of an address.
It gets a high level overview of the network state you are currently on.
It returns data about each connected node.
It returns the number of connections you have to other nodes (number of peers).
It returns an object with mining-related information, for example the block that is currently being mined.
It accepts the transaction into mined blocks at a higher or lower priority.
It returns data needed to create a block.