There are two ways you can about doing this:
- Using a Bitcoin Node (RPC)
- Using a library like this
You asked about RPC so I will talk about that.
Ubuntu
1. You can install the Bitcoin Daemon like this:
$ sudo apt-get install bitcoind
2. You have to start the daemon and wait for blocks to download.
You can start the daemon like so: $ bitcoind -daemon
You can check the progress of blockchain download like so: $ bitcoin-cli getinfo
If you don't have space to download the full chain, you can use the prune
method. Create a new file ~/.bitcoin/bitcoin.conf
and add prune {megabytes of space}
. This will limit blockchain space allocation to the value of the prune
method.
3. Setup your JSON RPC configuration. You can refer to this thread for adding your RPC username and password.
4. After the blockchain has been downloaded (~150GB), you can connect to the RPC server on port 8332
by default. You may use this library or this library to make calls to the RPC server in NodeJS; you may also use any JSON RPC client to make calls.
5. Use walletnotify
to receive transaction updates related to your wallet. Setup an insight-api
if you want to receive transaction updates from any wallet. You can use insight-api
to index and retrieve transaction data and block data on demand as well.
Resources
Bitcoin API Calls - You may want to reference to these methods as you are programming
Bitcoin Full Node - More information on starting a local node if you are coming across trouble
Insight API - Used for indexing displaying all transactions and blocks.
walletnotify
- Information on how to use walletnotify.