Domain Kiosk

Creative website design and internet marketing studio

Recompiling and installing of LOC staking wallet with GUI on Raspberry Pi 4b

Let's use the tiny, yet powerful Raspberry Pi 4b to recompile the LOC staking wallet with GUI!

But first let's clear, why do I chose to use the LOC wallet with GUI on the Pi? The answer is simple - the QT version (the version with GUI) is more convenient (which is obvious) and also more secure (not so obvious) than the Daemon/Client version.

The Daemon keeps a port open for CLI (the Client) to be able to communicate with it. On the other hand there is no such port open when the QT version of the wallet is run. To open such a port on the QT version the option "-server" can be used, then the QT wallet can accept commands from CLI too. By default this port on the QT version is closed and hackers don't have even the possibility to try and run commands on the wallet remotely.

Before reaching to the point in this article, it is important that you have read the first article Raspberry Pi 4b - basic setup with Raspbian Buster and getting ready to install the LOC staking wallet from my Guide to staking LOCs on Raspberry Pi 4b.  Now let's get to the point:

 

What are the steps to recompile the LOC staking wallet from source?

  1. Prepare the repositories lists.
  2. Prepare the development environment.
  3. Pre-compile and link objects.
  4. Compile.
  5. Create Debian package and install it.
  6. "Test drive" the LOC staking wallet with GUI.
  7. Install the staking wallet from the .deb package in clean environment.

 

1.Prepare the repositories lists

- Check the contents of your repository files lists on the Raspberry Pi:

sudo nano /etc/apt/sources.list

and make sure they look like this:

deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
# deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

- Create a new file in the same directory:

sudo nano /etc/apt/sources.list.d/bitcoin.list

with this content (we will uncomment the lines later):

# deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main
# deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main

- Now do:

sudo apt update
sudo apt upgrade

 

2. Prepare the development environment

- Installing the developer libraries:

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

sudo apt install software-properties-common

- Adding the Bitcoin Personal Package Archive (PPA):

In some Linux tutorials this is done with the command "sudo add-apt-repository ppa:bitcoin/bitcoin". This command does not work in Raspbian, thus we install with a work-arround:

sudo nano /etc/apt/sources.list.d/bitcoin.list

Uncomment the first line, the edited file should look like this:

deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main
# deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main

sudo apt update

You will get an error. The error message explains this is not a Raspbian repository. From the error message write down the missing public key -> D46F45428842CE5E

Run next command with last 8 digits from the missing pub key -> 8842CE5E

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8842CE5E

sudo apt update

- Adding the Berkeley DB dev libraries, version 4.8:

sudo apt install libdb4.8-dev libdb4.8++-dev

- To build the Qt GUI, install these libraries:

sudo apt install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler qrencode

- The command below will download the wallet source code from Github from the most recent (current) as of writing of this article branch:

git clone -b qtum_params https://github.com/LockTrip/Blockchain.git --recursive

cd Blockchain

 

3. Pre-compile and link objects

"./autogen" may prompt to install some more dependencies if needed.

./autogen.sh

"./configure" has some options to finish faster (./configure --disable-tests --disable-bench --disable-gui-tests), however these are now included by default in the source, so you can simply run:

./configure

 

4. Compile

This step took a bit less than 1 hour to complete on the Raspberry Pi 4b with SSD. If you care about your Pi, now it's the right time to check how well the board is prepared to perform "under pressure". Before stressing out the Pi, check if you have heat sinks installed on the right places. Wireless and Bluetooth should be off, so there will be no heat produced there. If your Pi is in a box, leave the box cover open. Of course these are the minimums. You could install a huge heat sink on the CPU and USB chips, a cooling fan or two, etc. Just avoid the mistake to cool your CPU only and to forget the rest heat producers unprotected.

For an in-depth analysis of the temperature behaviour of the Pi, check out this article >> Raspberry Pi 4 Firmware Updates Tested: A Deep Dive Into Thermal Performance and Optimization.

Now let's compile:

make -j3

 

5. Create Debian package and Install

The command checkinstall is a fast way to create a .deb installation package.

A full tutorial about this powerful command can be found here >> checkinstall Debian Wiki

First let's install checkinstall:

sudo apt install checkinstall

and run it:

sudo checkinstall

The command will first ask a few questions you need to answer (like "Should I create a default set of package docs?", etc.), then create the Debian installation file, install the binaries in /usr/local/bin and lastly create a .tgz Archive.

You can also use checkinstall with options, to avoid some manual typing. Customize the wallet version in these options before you use them of course:

sudo checkinstall --maintainer="office @ thedomainkiosk.com" --pkgname="locktrip" --pkgversion="0.18" --pkgrelease="4" --requires="libboost-system1.67.0,libboost-filesystem1.67.0,libboost-program-options1.67.0,libgmpxx4ldbl,libboost-thread1.67.0,libboost-chrono1.67.0,libboost-random1.67.0,libprotobuf17,libevent-pthreads-2.1-6"

After checkinstall finishes you will find the .deb installation file in the ~/Blockchain folder.

Finally you need to "chown" (change owner) of the .deb file to be able to copy or move it. In the command below you need to replace your-package-name-and-version_armhf.deb with the exact name and version of the .deb file checkinstall created:

sudo chown pi:pi ~/Blockchain/your-package-name-and-version_armhf.deb

 

6. Start the wallet with GUI ("test drive")

To start the wallet you need to access the Raspberry Pi via VNC and launch a terminal in the VNC viewer. Then in the terminal type:

/usr/local/bin/locktrip-qt -testnet

 

7. A clean wallet with GUI in use

As we created a developer environment on the SSD, for security reasons it is safer to make a copy of the .deb package file on a removable flash drive, get a fresh image of the Raspbian Buster with desktop, make sure you access remotely the Pi with SSH and via VNC, and install the .deb package in the clean now environment on your Pi. You can use dpkg, which will need to manually install missing dependencies, or apt install, which will install dependencies automatically and use dpkg in the background to install the .deb package.

 

7.1 Installing with dpkg (manual installation of dependencies)

Before we install the .deb package, we need to install the missing packages (libraries) it depends on. Here is a detailed manual way to install the dependencies:

- Add the Bitcoin core:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8842CE5E

sudo nano /etc/apt/sources.list.d/bitcoin.list

The contents of the file should be:

deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main
# deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main

sudo apt update

- Add the Berkeley database v4.8 libraries:

sudo apt install libdb4.8 libdb4.8++

- Add the rest of the missing libraries:

sudo apt install libboost-system1.67.0 libboost-filesystem1.67.0 libboost-program-options1.67.0 libgmpxx4ldbl libboost-thread1.67.0 libboost-chrono1.67.0 libboost-random1.67.0 libprotobuf17 libevent-pthreads-2.1-6

 - Now we make a new directory ~/Locktrip and copy there the .deb file from the flash memory stick:

mkdir Locktrip

cp /media/pi/your-usb/your-package-name-and-version_armhf.deb ~/Locktrip

cd Locktrip

- The following command will install the files from the .deb package in /usr/local/bin

sudo dpkg -i your-package-name-and-version_armhf.deb

- Then in the VNC viewer launch a terminal and type the command:

/usr/local/bin/locktrip-qt -testnet

 

7.2 Installing with apt install (semi-automatic installation of dependencies)

Instead of using dpkg you can use apt install which will first install the dependencies and then use dpkg to install the .deb package.

- Add the Bitcoin core:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8842CE5E

sudo nano /etc/apt/sources.list.d/bitcoin.list

The contents of the file should be:

deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main
# deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu artful main

sudo apt update

- Add the Berkeley database v4.8 libraries:

sudo apt install libdb4.8 libdb4.8++

- Next we make a new directory ~/Locktrip and copy there the .deb file from the flash memory stick:

mkdir Locktrip

cp /media/pi/your-usb/your-package-name-and-version_armhf.deb ~/Locktrip

cd Locktrip

- Finally the following command will install the missing dependencies and then the .deb package in /usr/local/bin. Please note that we use the full (absolute) path to the .deb package.

sudo apt install /home/pi/Locktrip/your-package-name-and-version_armhf.deb

- In the VNC viewer launch a terminal and type the command:

/usr/local/bin/locktrip-qt -testnet

Enjoy the "beauty" of using the LOC staking wallet with GUI on Raspberry Pi !

 

Hardware used in this article

  • - Raspberry Pi 4b;
  • - 5V/3A C-type connector power supply;
  • - Samsung 970 EVO Plus 250GB NVMe M.2 SSD;
  • - X870 NVMe M.2 SSD Storage Expansion Board (Adapter) - JMicron Technology Corp. chip set;
  • - Armor case/heat sink for Raspberry Pi 4b;
  • - 12V low noise Jiesammy cooling fan, powered from the Pi.

 

If you find inaccuracies in this article or ways to improve it, please leave a comment below. In the next article we will make the important security checks for our staking Pi.

 

Yours, Crypto Qu

 

Ways to support my work, if you find it helpful. Thank You!

How to run a healthy HYDRA staking node

This article is all about the health of your HYDRA staking node, and the important things you need to know to win block rewards on the HYDRA blockchain.

Read more ...
 

Using Ledger Nano S to protect the SSH session to the Raspberry Pi 4b with LOC staking wallet

In this article we will make a setup that will allow to use Ledger Nano S to generate a pair of keys and use it to protect the SSH session to the LOC staking Raspberry Pi.

Read more ...

Basic security check list for staking LOCs on Raspberry Pi 4 model b

Let's harden the security of our staking Pi. Our goal is to keep the minimal number of open ports on the Pi and secure them.

Read more ...

Recompiling and installing of LOC staking wallet with GUI on Raspberry Pi 4b

Let's use the tiny, yet powerful Raspberry Pi 4b to recompile the LOC staking wallet with GUI!

Read more ...

Raspberry Pi 4b - basic setup with Raspbian Buster and getting ready to install the LOC staking wallet

The new Raspberry Pi 4b has arrived! Let's set it up for best performance for staking with the LOC staking wallet!

Read more ...
 

How to protect the SSH session with 2FA on Raspberry Pi 3B+

In this third article we continue the series about making secure the Pi for staking LOCs. We will increase the security level of SSH by adding 2FA to the session login.

Read more ...

How to stake LOCs securely and conveniently on Raspberry Pi 3B+

This article is the second in a series that helps begin staking LOCs on the Raspberry Pi 3b+.

Read more ...

A step by step recompilation of LOC test staking wallet with GUI for Raspberry Pi 3B+

This is the first of a series of articles to help you recompile and set up a Raspberry Pi as a LOC staking wallet with GUI.

Read more ...

A Gem forged in the Crypto Hell of 2018

2018 was the year that crypto fell to earth with louder critics than ever. The industry had been hit with what some would say was a much-needed reality check.

Read more ...