How to use JSON-RPC in C++ in Linux?

How to use RPC of bitcoind or bitcoin-cli?

  1. bitcoind – bitcoin deamon = core value of the software (bitcoind -printtoconsole -debug=1)
  2. bitcoin-cli – bitcoin command line interface = allow you to “query’ the blockchain that you had download previously with bitcoind. (bitcoin-cli getinfo)

So bitcoind provide the RPC “interface” in which you can query with bitcoin-cli
(or a library in c++ you will find…).
You must run bitcoind before using bitcoin-cli.

Basically bitcoin-cli communicate with your node bitcoind so in other word your current blockchain state.

bitcoin-qt – Graphical bitcoin software = bitcoind + graphical interface
(You can find a graphical console embedded in which you will use bitcoin-cli command)