Setting up a Raspberry Pi running Raspbian as a Bitcoin UASF BIP 148 node — compiling from source code.

Matthew Haywood
6 min readMay 21, 2017

The User Activated Soft Fork (BIP 148) depends on the support of users. By running a UASF BIP 148 node you can support the drive to activate SegWit on Bitcoin!

If you are running Ubuntu on your Pi and not Raspbian — please follow this guide instead.

If you already have a raspberry Pi set up as a Bitcoin node and compiled from source you can skip to the ‘Updating an existing Pi Bitcoin node to run UASF BIP 148’ section.

Setting up a Pi that is not already set up as a Bitcoin node

Firstly — thank you for helping UASF to bring SegWit to Bitcoin!

There is already a very good guide by the Raspnode project that we will use as the baseline for our set up. You just need to follow that guide and amend the sections as outlined below and you will have a Bitcoin node running UASF BIP 148.

Start by follow the instructions on the Raspnode guide here:

http://raspnode.com/diyBitcoin.html

When you get to the INSTALLING BITCOIN step and the code section below…

You only need to change the second line where the git clone command is issued

…you need to replace the command on the second line that reads:

git clone -b 0.13 https://github.com/bitcoin/bitcoin.git

With

git clone https://github.com/UASF/bitcoin.git -b 0.14-BIP148

That will pull the latest UASF BIP 148 code branch (UASF-Segwit:1.0) from the github repository onto your machine [based upon Core 0.14.2 at the time of this edit — 18th June 2017]. Every other line of code in the above section must remain as it is, you are only changing the second line. After that you can return to the steps in that section of the Raspnode guide.

When you get to the CONFIGURE AND RUN BITCOIN CORE step and the code section below…

You will also be adding a few more config settings to make your node run smoothly — this change has nothing to do with running the UASF code but is recommended for general Bitcoin node stability on the Pi

…you can also add the following config settings when you are instructed to add the rpcuser and rpcpassword settings to help improve the stability of your Bitcoin Pi node. These have nothing to do with running the UASF BIP 148 code itself and are recommended for general Bitcoin node stability on the Pi as they reduce the memory used by the node and make it more responsive:

dbcache=100
maxorphantx=10
maxmempool=50

You can further improve the performance of you node by following the steps in the ‘Some additional notes on increasing Bitcoin node performance on the Pi’ section below after you have completed setting you node up.

Once you have added the extra configuration settings above to the bitcoin.conf file you can carry on following the Raspnode guide until the end… and that’s it!

You should now have a Bitcoin UASF BIP 148 node running on your Raspberry Pi!

You should now go to https://bitnodes.21.co/ and click the ‘CHECK NODE’ button to see how your node appears to other nodes on the network. If it says that your node is unreachable then please go to the ‘Setting up your node to accept incoming connections’ section. This is important as it lets your node contribute to the network and adds to the UASF support on node statistics.

Setting up your node to accept incoming connections

It is important to make sure that your node is accepting incoming connections over port 8333 if you want to contribute to the network and add support to the UASF node statistics.

Go to https://bitnodes.21.co/ and click the ‘CHECK NODE’ button. If it appears as below all is well, your node is set up perfectly and counting towards UASF BIP 148 support!

Positive response of an incoming connection test

The latest build will show as Satoshi:0.14.2/UASF-Segwit:1.0(BIP148).

If you receive the following message your node is not accepting incoming connections and you will have to follow the steps below to correct this.

Negative response for an incoming connection test

To resolve this the easiest thing to do is to enable UPnP port forwarding in your bitcoin node. You can do this via the GUI by going into Settings/Options/Network and ticking the ‘Map port using UPnP’ check box. It is worth toggling this option if you have recently rebooted your router as they may forget UPnP requests after reboot.

If that still does not give you a positive response to the incoming connection test then you will have to either enable UPnP on your router (and then toggle the UPnP option in your node) or set up a firewall rule to enable port 8333 forwarding to your Pi. How you do this is dependant on your make and model of router and you may have to search for instructions of how to do this online if it isn’t immediately obvious.

Updating an existing Pi Bitcoin node to run UASF BIP 148

If this applies to you and you originally compiled your node from source it is even easier for you to support the UASF to bring SegWit to Bitcoin!

Follow the instructions on the Raspnode guide (http://raspnode.com/diyBitcoin.html) starting at the INSTALLING BITCOIN step and the code section below…

You need to start at line two and amend it to point to the BIP 148 branch

…you need to open a terminal window, change directory to bin (cd ~/bin) and start at the second line, replacing the command:

git clone -b 0.13 https://github.com/bitcoin/bitcoin.git

With

git clone https://github.com/UASF/bitcoin.git -b 0.14-BIP148

That will pull the latest UASF BIP 148 code branch (UASF-Segwit:1.0) from the github repository onto your machine. Run the third and forth lines as they are with no changes.

Then follow all subsequent steps in the INSTALLING BITCOIN section which will make and install the source code you pulled above and replace your existing installation with a UASF BIP 148 one! You will need to follow the steps that are relevant for your existing node — so if you have compiled your existing node to run with a GUI you must do the same here to avoid missing dependancy issues.

That’s it!

You should now have a Bitcoin UASF BIP 148 node running on your Raspberry Pi!

You should now go to https://bitnodes.21.co/ and click the ‘CHECK NODE’ button to see how your node appears to other nodes on the network. If it says that your node is unreachable then please go to the ‘Setting up your node to accept incoming connections’ section. This is important as it lets your node contribute to the network and adds to the UASF support on node statistics.

Some additional notes on increasing Bitcoin node performance on the Pi

If you have no need to run GPU intensive applications (such as games) on your Pi you can also increase the memory available to general applications (such as your Bitcoin node) by changing the default GPU memory allocation from 64MB to 16MB. This frees up memory and leaves enough RAM available for the GPU to handle most desktop applications. To do this you just need to go into the Performance tab within the Raspberry Pi Configuration Tool:

For an added performance boost to your node you can adjust the GPU Memory down from the default 64MB to 16MB

You can further improve the stability of your Bitcoin Pi node by adding the following config settings to bitcoin.conf. These have nothing to do with running the UASF BIP 148 code itself and are recommended for general Bitcoin node stability on the Pi as they reduce the memory used by the node and make it more responsive:

dbcache=100
maxorphantx=10
maxmempool=50

For further information on the UASF BIP 148 in general please visit http://www.uasf.co/

--

--