January 2019
Beginner to intermediate
372 pages
11h 17m
English
Bitcoin Core provides an API through the JSON-RPC interface to facilitate communication with the Bitcoin node. Most of the consensus, wallet, and P2P Bitcoin operations can be performed on the node using this interface. Bitcoin uses 8332 as the default JSON-RPC server port for mainnet. Users should make sure not to allow arbitrary machines to access the JSON-RPC port. Exposing this interface would allow external machines to access private information, which could lead to theft.
Bitcoin has a command-line interface tool, bitcoin-cli, that can be used to access all the JSON-RPC APIs.
Any transaction details can be fetched using the getrawtransaction RPC command by specifying the transaction ID:
$ bitcoin-cli ...
Read now
Unlock full access