1. Building BitCoin-Core

Install the build environment and dependencies

sudo apt-get update
sudo apt-get install build-essential autoconf libssl-dev libboost-dev libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libdb4.8++-dev libdb4.8-dev pkg-config

Clone the Git repo and view available version:

git clone https://github.com/bitcoin/bitcoin.git
git tag

Checkout the last released version ie.

git checkout 0.9.5rc2
cd bitcoin
./autogen.sh
./configure --without-gui
sudo make install
which bitcoind
which bitcoin-cli

Now run setup Bitcoind

bitcoind

create .bitcoin/bitcoin.conf and add:

rpcuser=bitcoinrpc
rpcpassword=<password shown in the previous step>

Now run Bitcoind and rebuild the blockchain:

bitcoind -daemon
tail -f ~/.bitcoin/debug.log

2. Setting up a wallet

Set a password

bitcoin-cli encryptwallet <SECURE PASSWORD>

Restart the daemon if it isn’t running:

bitcoind -daemon

Login to the wallet:

bitcoin-cli walletpassphrase <SECURE PASSWORD> 360
bitcoin-cli getinfo

Backup and Restore

bitcoin-cli backupwallet wallet.bak
bitcoin-cli importwallet wallet.bak

View as human readable:

bitcoin-cli dumpwallet wallet.txt

Now wait for the client to become synched with the blockchain

3. Receiving bitcoins

bitcoin-cli getnewaddress
<NEW ADDRESS APPEARS>

Send some bitcoins!

  bitcoin-cli getreceivedbyaddress <NEW ADDRESS APPEARS>
  bitcoin-cli getbalance

4. Stopping the VPS hypervisor from shutting down the VM

While it is syncing the blockchain it will be verifying each and every block that it receives, and so the CPU usage will get so high that the VPS provider will keep shutting it down.

To avoid this, limit the CPU:

$ echo daemon=0 >> ~/.bitcoin/bitcoin.conf
$ cpulimit -l 90 bitcoind &

How far along is it synching?

nspool@vps:~$ bitcoind getinfo
{
    "version" : 90500,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 299058,
    "timeoffset" : 0,
    "connections" : 13,
    "proxy" : "",
    "difficulty" : 8000872135.96816349,
    "testnet" : false,
    "keypoololdest" : 1449355342,
    "keypoolsize" : 100,
    "unlocked_until" : 0,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00001000,
    "errors" : ""
}

It was 386959 last I checked on blockchain.info. So the progress is 324173386959 = ~77%

du -sh .bitcoin/blocks/