The Human Interface: CLI vs GUI vs RPC
The Human Interface: CLI vs GUI vs RPC
How do you talk to your node? There are three main ways.
-
CLI (Command Line Interface): Using
bitcoin-cli. This is for the "Power Users" and developers. -
GUI (Graphical User Interface): Using
bitcoin-qt. This is for regular people who like buttons and windows. -
RPC (Remote Procedure Call): Using apps and websites. This is for the "Robots" and other software. All three of these speak the same language internally. They are all "Windows" into the same digital soul. It is the "Trinity of the Talk." It is the "Interface of the Individual."
The Bitcoin-CLI Bridge
In src/bitcoin-cli.cpp, the node translates your typed words into "JSON" messages that the node can understand. It is the "Translator of the Terminal." It is the "Bridge of the Bash."
/**
* Translates a human command (like "getbalance") into an RPC request.
* Sends the request to the bitcoind node and displays the answer.
*/
int main(int argc, char* argv[])
{
// Building the "Request" message.
UniValue reply = CallRPC(strMethod, args);
// Printing the answer to the user's screen.
printf("%s\n", reply.write().c_str());
}
Explaining the Code: The Voice of the User
-
CallRPC: This is the "Phone Call" from the terminal to the daemon. It travels through a "Socket" (a local network connection). It is the "Communication of the Core." It is the "Dialogue of the Daemon." -
UniValue reply: The node's answer. It is always formatted in "JSON" (JavaScript Object Notation), which is easy for both humans and computers to read. It is the "Common Language of the Bit." It is the "Universal Word."
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: