In this tutorial we will make a remotely accessible Bitcoin node on a Raspberry Pi.
Bitcoin is a new fully digital currency. It is the first decentralized peer-to-peer payment network that is powered by its users with no central authority or middlemen. From a user perspective, Bitcoin is pretty much like cash for the Internet.
- Raspberry Pi Model B, B+ or Raspberry Pi 2 Model B (at least 512MB RAM is needed)
- At least 64GB (micro-)SD card (you need to download the whole blockchain for the node to work. At the time of this writing, the blockchain is over 37GB.
- A clean install of Raspbian Linux distribution on the SD card.
- Network access (Ethernet or Wifi adapter)
- Mouse, keyboard, monitor (only during installation)
Please note that this tutorial has been tested with Raspberry Pi 2 Model B. The previous models may not be powerful enough to run the full Bitcoin node.
- Boot up Raspberry Pi with Raspbian installed
- Login using your credentials
- Update Raspbian to latest packages:
sudo apt-get update sudo apt-get upgrade
Install some required dependencies for Bitcoin:
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 libtool
Installing Berkeley DB
Unfortunately Raspbian has a very old version of the Bitcoin client (called Bitcoin Core). That's why we need to install Bitcoin Core and Berkeley DB version 4.8 manually.
- Download Berkeley DB version 4.8:
Extract the file and change to that directory:
tar -xzvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix/
- Configure the package:
- Compile the package and install (this will take a while)
make sudo make install
Installing Bitcoin Core
And finally, we can install the Bitcoin client.
- Go to https://bitcoin.org/en/download and check the latest version (at the time of this writing it's 0.11.0. Substitute this number in future for yours if it's different)
- Clone the git repository
git clone -b 0.11 https://github.com/bitcoin/bitcoin.git bitcoin-0.11 cd bitcoin-0.11
- Configure the package
./autogen.sh ./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"
- Compile Bitcoin Core (this will take several hours)
make sudo make install
You now have a complete Bitcoin node installed. You can start it anywhere by typing:
Do remember to check the settings for bitcoind (with 'bitcoind --help'). One useful setting is -dbcache, which sets the database cache limit. Around 50-100 should be fine.
To run the client automatically on startup, edit '/etc/rc.local' file and append to the end of the file:
Bitcoin uses port 8333 to communicate with the network, so make sure to open port on your router if necessary.
Syncing the whole blockchain can take days. To get current status of your client, you can run:
You can find the latest blocks on blockexplorer.com.
You can access your computer remotely with SSH. Run the raspberry pi configuration tool and enable SSH server.