twilborn
Posts: 1
Joined: Sat Jan 21, 2017 6:41 am

Donate BTC of your choice to 16PWnLfNdDZ5EtiG7wZujmgR9JCcLikbe1

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

Thu Jan 26, 2017 8:57 pm

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

Introduction
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:

https://app.purse.io/product/B01C6EQNNK

. . .micro sd cards:

https://app.purse.io/product/B00V62XBQQ

https://www.amazon.com/SanDisk-microSDH ... b+micro+sd

. . .And installing raspbian:

https://vimeo.com/90518800

Setting up you pi

Before 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:

http://raspnode.com/diyBitcoin.html

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.


>Method 1<

Compile the code
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.

Install dependencies

Image
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
Cloning the source code
mkdir -p ~/src
cd ~/src
git clone https://github.com/BitcoinUnlimited/BitcoinUnlimited.git bu-src
cd bu-src
Compile
./autogen.sh
LIBS="-lboost_atomic" ./configure --enable-upnp-default --disable-wallet
make
sudo make install
>Method 2<
Note: If you have already followed the steps in method 1, skip ahead to the 'Setting up your node' section
Install the pre-compiled package from bitcoinunlimited.info
The 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.
mkdir ~/downloads/
cd ~/downloads
wget https://www.bitcoinunlimited.info/downloads/bitcoinUnlimited-1.0.0-arm32.tar.gz
Verify your download by pasting the checksum from the website on the command line and use the following format:
Image
echo 6bb4489c74d0d295741e7c9f3cbd95dbfc54ae7ae29ca8badbc413f14fd587ef  bitcoinUnlimited-1.0.0-arm32.tar.gz | sha256sum -c
If the checksum the actual file, proceed on and extract the archive.
tar xf bitcoinUnlimited-1.0.0-arm32.tar.gz
cd bitcoinUnlimited-1.0.0
Now the executables inside the archive need to be moved inside /usr/local/bin in order to run properly.
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
Also, the Include files will need to be moved to /usr/local/include
mkdir -p /usr/local/include
mv ./include/bitcoinconsensus.h /usr/local/include/bitcoinconsensus.h
chmod 644 /usr/local/include/bitcoinconsensus.h
Finish the installation by moving the library files to /usr/local/lib
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
Alright, 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.



Setting up your node

Starting your node
bitcoind -daemon
This process runs completely in the background.

Stopping your node
bitcoin-cli stop

(Optional)

Custom Configurations
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.

Opening bitcoin.conf
nano .bitcoin/bitcoin.conf
Here is a sample setup for bitcoin.conf:

Image

Set up pruning
prune=<n>
(in megabytes)

Storing the blockchain on an external drive
datadir=<n>
(Enter the location of your External Hard Drive)

Signaling for bigger blocks
excessiveblocksize=<n>
(in bytes. For example, if you want 4mb, write in 4000000)
excessiveacceptdepth=<n>
(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.
Last edited by twilborn on Mon Jan 30, 2017 3:01 am, edited 4 times in total.

User avatar
rogerver
Founder
Founder
Posts: 1855
Joined: Thu Sep 10, 2015 6:55 am

Donate BTC of your choice to 1PpmSbUghyhgbzsDevqv1cxxx8cB2kZCdP

Contact: Website Twitter

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

Fri Jan 27, 2017 2:33 am

Thanks for posting this!
I will test it out this coming week and report back on how long it takes for a $20 Raspberry Pi to sync the whole blockchain from scratch.
I would guess less than a week.
Help spread Bitcoin by linking to everything mentioned here:
topic7039.html

Rmcdermott927
Bronze Bitcoiner
Bronze Bitcoiner
Posts: 590
Joined: Tue Sep 20, 2016 7:32 pm

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

Fri Jan 27, 2017 4:12 am

Do you have any data on how long SD cards with the entire blockchain will survive? I would assume that the heavy writing must take quite a toll.
Image

Justaphf
Posts: 1
Joined: Fri Jan 27, 2017 6:36 am

Donate BTC of your choice to 18QJRY6phsbCeR4QdD48eEtVw1tU2SfspA

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

Fri Jan 27, 2017 9:14 am

Excellent to see an updated guide for Pi3 setup twilborn!

Couple of quick insights based on running both a Pi3 and PineA64+ as full nodes (non-pruned) since about June 2016.

1. If you just want to build & run the most recent stable release version, I would suggest that after you clone the source from github you switch to the release branch. Currently the default branch when you clone the BU project from github is the dev branch. If you want to get an early preview of upcoming features intended to be included in the next release, you can just stay on the dev branch. Just note that the dev branch is more likely to be unstable as the new features will still be undergoing testing.
To switch to the release branch, simply call git checkout release right after you call cd bu-src into the clone directory.

2. Alternately, if you don't want to bother building from source, you can download deterministic statically compiled binaries from https://www.bitcoinunlimited.info/download. The 1.0.0 release includes 32 and 64 bit ARM binaries which you can download and install. For the Pi you would download the 32-bit binary https://www.bitcoinunlimited.info/downl ... m32.tar.gz, unpack using the command tar xf bitcoinUnlimited-1.0.0-arm32.tar.gz and execute from the extract location. Just note that if you choose to go this route, make sure you verify the binary file signatures listed on the download page against the file you downloaded before installing.

3. I highly recommend you use an external USB HDD for storing the blockchain data. It's cheaper and more reliable long-term than the onboard MicroSD that the OS will be installed to, though a bit slower in terms of the read/write access times. I would reccommend this even if you intend to use pruning to spare your MicroSD card. If using a USB HDD, make sure you connect it to your Pi via a powered USB hub or it may cause issues if it tries to draw too much from the Pi's USB port directly.

4. I recommend that you connect the Pi's power cable to a small UPS so that noise in the line or short outages don't cause the node to go down. Depending on the quality of your power cable, noise in the line can be an issue for the Pi.

5. I also recommend that you set up your Pi to run in headless mode without any desktop installed and minimize the RAM reserved for video (i think the minimum split is 16MB).

6. In terms of IBD sync time, it took a little over a week back in June 2016 for my Pi3.

As a side note, if anyone wants to set up a full node on the PineA64, the instructions are nearly identical and you get much better performance due to having actual 64-bit OSes available and having double the RAM. Performance-wise, it took 1/3 of the time for the Pine to sync up from block 0 than the Pi took.

Return to “Bitcoin Unlimited”

Who is online

Users browsing this forum: No registered users and 1 guest