Thu Jan 26, 2017 8:57 pm

Tutorial: How to run Bitcoin Unlimited node on a Raspberry Pi 3

sudo apt-get update sudo apt-get install git build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-all-dev

mkdir -p ~/src cd ~/src git clone https://github.com/BitcoinUnlimited/BitcoinUnlimited.git bu-src cd bu-src

./autogen.sh LIBS="-lboost_atomic" ./configure --enable-upnp-default --disable-wallet make sudo make install

mkdir ~/downloads/ cd ~/downloads wget https://www.bitcoinunlimited.info/downloads/bitcoinUnlimited-1.0.0-arm32.tar.gz

echo 6bb4489c74d0d295741e7c9f3cbd95dbfc54ae7ae29ca8badbc413f14fd587ef bitcoinUnlimited-1.0.0-arm32.tar.gz | sha256sum -c

tar xf bitcoinUnlimited-1.0.0-arm32.tar.gz cd bitcoinUnlimited-1.0.0

mkdir -p /usr/local/bin mv ./bin/bitcoind /usr/local/bin/bitcoind mv ./bin/bitcoin-cli /usr/local/bin/bitcoin-cli mv ./bin/bitcoin-tx /usr/local/bin/bitcoin-tx mv ./bin/test-bitcoin /usr/local/bin/test-bitcoin chmod 755 /usr/local/bin/bitcoind /usr/local/bin/bitcoin-cli /usr/local/bin/bitcoin-tx /usr/local/bin/test-bitcoin

mkdir -p /usr/local/include mv ./include/bitcoinconsensus.h /usr/local/include/bitcoinconsensus.h chmod 644 /usr/local/include/bitcoinconsensus.h

mkdir -p /usr/local/lib mv ./lib/libbitcoinconsensus.so /usr/local/lib/libbitcoinconsensus.so mv ./lib/libbitcoinconsensus.so.0 /usr/local/lib/libbitcoinconsensus.so.0 mv ./lib/libbitcoinconsensus.so.0.0.0 /usr/local/lib/libbitcoinconsensus.so.0.0.0 chmod 644 /usr/local/lib/libbitcoinconsensus.so /usr/local/lib/libbitcoinconsensus.so.0 /usr/local/lib/libbitcoinconsensus.so.0.0.0

Setting up your node

bitcoind -daemon

bitcoin-cli stop

nano .bitcoin/bitcoin.conf

prune=<n>

datadir=<n>

excessiveblocksize=<n>

excessiveacceptdepth=<n>

When setting up a bitcoin node on a raspberry pi, there are a couple of choices to make in regards to the resources available to you. The first thing to consider is whether to run a full node or a pruning node. A full node downloads the entire blockchain, while a pruning node will only download the latest part of the blockchain. If you choose to run a full node, there is the option to store the blockchain on an external storage unit (as micro sd cards can get expensive).This tutorial assumes that you have a working pi with raspbian installed. If you don't already have one, you can buy it here:. . .micro sd cards:. . .And installing raspbian:https://vimeo.com/90518800Before you compile the code, set up remote ssh with your pi and increase the swapfile (more memory). This makes the compiling more doable for your pi.This tutorial below explains how:There are two ways to install the software. You can either compile the source code directly, or download the arm build from the Bitcoin Unlimited website. I will explain below how to do it from each of these methods. I have found compiling the source code to be a more slow and reliable way of installation. The choice is up to you.To compile the code, you will need to install the necessary dependencies, and clone the source code from github into your home folder. Be patient as it may take a few hours to compile the source code.Note: If you have already followed the steps in method 1, skip ahead to the 'Setting up your node' sectionThe Raspberry Pi 3 uses a 32bit processor. Some boards like the pine have a 64bit architecture.Use the terminal to download the latest build.Note: The actual url may be different then the one shown below because of future releases.Verify your download by pasting the checksum from the website on the command line and use the following format:If the checksum the actual file, proceed on and extract the archive.Now the executables inside the archive need to be moved inside /usr/local/bin in order to run properly.Also, the Include files will need to be moved to /usr/local/includeFinish the installation by moving the library files to /usr/local/libAlright, you're done with the installation! You can purge your download folder if you'd like and move on to starting/setting up your node.This process runs completely in the background.Like I mentioned earlier, If you want to run a pruning node where only part of the blockchain is downloaded, or if you want to store the blockchain on an external drive, you can do so by adding a few simple lines to your bitcoin.conf file. Because this is Bitcoin Unlimited, you can also set rules for the size of blocks for your node to accept.Here is a sample setup for bitcoin.conf:(in megabytes)(Enter the location of your External Hard Drive)(in bytes. For example, if you want 4mb, write in 4000000)(this number is how many previous blocks with that size are required to have been accepted on the blocksize in order for your node to accept them. This is to keep mining from becoming centralized.)________________________________________________________________________________________________________________________Special thanks to user justaph, who helped me out in /r/bitcoin_unlimited . Without the help I received, this tutorial would not have been possible.