[Reddcoin] Updated: Staking with Reddcoin Core client GUI wallet on a Raspberry Pi Model 3B

This tutorial has also been posted on Reddit, in /r/Reddcoin.

Writing an article like this takes time and effort; tips are appreciated.
My Reddcoin address: RsuwV6GP72Mr2aoha9SQSB6KJGAkS1jMbb.

Contents

Intro

This thread is an update to my first Reddcoin staking tutorial that was written 7 months ago.

The reason for the update

My Reddcoin Core software crashed and became unusable. My Raspberry Pi 3B would lag and freeze, I couldn’t stake anymore.

Instead of just redoing everything the same way, I wanted to see if I could improve on 3 points:

  • Use an OS that was lighter
  • Update the Reddcoin Core software (2.0.0.0 => 2.0.1.2)
  • Make improvements to the configuration.

The updates

  • OS: using Lubuntu instead of Ubuntu MATE. Lubuntu uses less resources (130 MB RAM vs. 190 MB RAM on initial boot).
     
  • Reddcoin Core: v2.0.1.2-a8767ba-beta instead of v2.0.0.0-92768f9-beta.
     
  • Swap: using a swap partiton instead of a swap file. Also adjusting the swap size: from 1 GB to 2 GB, after reading the comments to my previous tutorial.
     
  • All data to USB: Blockchain data and the swap are now stored on the USB drive, instead of the SD card.
     
  • Private keys: added instructions on how to backup the private keys of your Reddcoin addresses!

Overview

  • Hardware: Raspberry Pi 3 Model B.
     
  • OS: Lubuntu 16.04.2 (Xenial).
     
  • Storage space: I am using an 8 GB microSD card for the OS, and a 128 GB USB drive for data. Minimums I would recommend: 8GB SD card and 32 GB USB drive.
     
  • Reddcoin Core client version: v2.0.1.2-a8767ba-beta (most recent version at this moment).
    Screenshot

Steps

  • You need software to write the OS to the SD card. I use Etcher. Download Etcher: https://etcher.io/.
    • Run Etcher.
       
    • Select image: select the lubuntu-16.04.2-desktop-armhf-raspberry-pi.img.xz file.
       
    • Select drive: select your microSD card.
       
    • Flash.
  • Plug the SD card into your Raspberry Pi and power it up.
    • Lubuntu should boot up.
       
    • Set up Lubuntu, connect to the internet (wired or wireless).
      ↳ As username, I chose “rpi3b”. You will see this username throughout this whole tutorial.
       
    • Make sure date and time are correct ([Menu] > System Tools > Time and Date).
      ↳ Click on Unlock to make changes. I personally change Configuration to “Keep synchronized with Internet servers”.
      Screenshot

    • Reboot ([Menu] > Logout > Reboot). I am connected to wifi, but have issues getting wifi to work on initial boot. A reboot solves this issue.
  • Make sure system is up-to-date, install never versions.
    • Open LXTerminal ([Menu] > System Tools > LXTerminal).
      Screenshot

    • Enter the following in LXTerminal:
      sudo apt update && sudo apt upgrade
      Screenshot

    • You will be asked if you really want to continue. Enter Y (yes).

    • Updates are being installed! Wait until it’s finished.
  • Install programs that will be used in this tutorial.
    • GParted: to partition the USB drive.
    • Htop: to see the amount of memory (RAM) and swap that is in use.
       
    • Enter the following in LXTerminal to install these 2 programs.
      sudo apt install gparted && sudo apt install htop
      Screenshot
  • Create 2 partitions on the USB drive:
    1) Swap partition
    2) data partition (for the Reddcoin blockchain)
     
    The swap partition is necessary: The Reddcoin wallet can be memory intensive. To prevent any crashes or freezes, add 2 GB of ‘virtual’ memory by creating a swap partition.
     
    • Important: Backup your USB drive if needed. The USB drive will be formatted, so the data on the USB drive will be wiped.
    • Please use the USB drive solely for this purpose, do not combine it with other stuff.
    • Keep your USB drive plugged in, do not (randomly) plug it out.
       
    • Plug your USB drive in.
       
    • GParted will be used to create the partititons.
      Start GParted via LXTerminal:
      sudo gparted
      Screenshot

    • In GParted, switch from your SD card (default) to your USB drive.
      Screenshot
      Screenshot

    • You will now see the all the partition on USB drive. Delete every partition (right mouse click). If you can’t select Delete, do an Unmount first.
      Screenshot
      Screenshot

    • After deleting all partition, you will only see ‘unallocated’ space on your USB drive.
      Screenshot

    • Create the first partition: the swap partition. Right click on the blank space, select New and enter the following:
      • New size (MiB): 2048
      • File System: linux-swap
      • Click on Add.
        Screenshot

    • Create the second partition: the data (blockchain) partition. Richt click, select New and enter:
      • File system: ext4
      • Label: usb
      • Click on Add.
        Screenshot

    • Apply the changes. Click on the check mark or select Edit > Apply All Operations.
      Screenshot
      Screenshot

    • Important: The name of the swap partition is needed later, so please write it down. Mine is /dev/sda1 (first partition on first drive (drive ‘a’)).
      Screenshot

    • Reboot. After the reboot, the data partition you just created should be visible on your desktop.
      Screenshot

  • The swap partition is created, so now we can enable and use it.
    • The swap in use can be monitored with the program Htop. Open Htop ([Menu] > System Tools > Htop) to see the ‘Swp’ (swap) in use.
      Screenshot

      By default, swap is not used, so 0K.
      Screenshot

      You can leave Htop open.

    • To enable the swap partition, open LXTerminal and enter the following commands:
      (Assuming /dev/sda1 is your swap partition.)

    • You’ve enabled the swap partition. Switch back to Htop and check the ‘Swp’ (swap) value.
      It should read ‘2.0G’.
      Screenshot

  • To make sure the swap file is persistent (so it survives a reboot), you have to add a line to the /etc/fstab file.
    • In LXTerminal, enter the following command to open the file in Leafpad (text editor):
      sudo leafpad /etc/fstab
      Screenshot

    • In Leafpad, add this text in a new line:
      /dev/sda1 swap swap defaults 0 0
      Screenshot
      (I’ve added spaces to vertically align the text.)

    • Save and close the file.

    • Reboot your Pi.

    • To see if the swap partition is in use after a reboot, open Htop ([Menu] > System Tools > htop) and check the ‘Swp’ (swap) value.
      It should read ‘2.0G’.
      Screenshot

  • So, the swap partition is enabled and in use, and the data partition is prepared. We now can install the necessary software for the Reddcoin wallet; enter the following commands into LXTerminal:
    • sudo apt-get update && sudo apt-get install git build-essential libqt4-dev libprotobuf-dev protobuf-compiler libtool autotools-dev autoconf libssl-dev libboost-all-dev wget pkg-config
      Screenshot

    • sudo add-apt-repository ppa:bitcoin/bitcoin
      Screenshot

    • sudo apt-get update

    • sudo apt-get install db4.8
      Screenshot
      Screenshot

    • sudo apt-get install libminiupnpc-dev
      Screenshot

    • sudo apt-get install libqrencode-dev
      Screenshot

    • Reboot your Raspberry Pi.

  • After the reboot, open LXTerminal again. Download, unpack, configure, build and install Berkeley DB.
    • Set the working directory to your USB drive:
      cd /media/rpi3b/usb
      (rpi3b is the username I chose; if you have a different username, change it to yours.)
      Screenshot

    • sudo wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
      Screenshot
      Screenshot

    • sudo tar xfvz db-4.8.30.NC.tar.gz
      Screenshot

    • cd db-4.8.30.NC

    • cd build_unix

    • sudo ../dist/configure --enable-cxx

    • sudo make
      This took about 10 minutes for me.

    • sudo make install

  • Set BerkeleyDB variables (in LXTerminal):
    • export CPATH="/usr/local/BerkeleyDB.4.8/include"
      Screenshot

    • export LIBRARY_PATH="/usr/local/BerkeleyDB.4.8/lib"
      Screenshot

    • sudo leafpad /etc/ld.so.conf.d/daemon-libs.conf
      Screenshot

    • Add this line in Leafpad:
      /usr/local/BerkeleyDB.4.8/lib/
      Screenshot

    • Save and close the file.

    • Back in LXTerminal:
      sudo ldconfig
      Screenshot

  • Download the source of the Reddcoin wallet and build it.
    • Set the working directory to your USB drive:
      cd /media/rpi3b/usb
      (rpi3b is the username I chose; if you have a different username, change it to yours.)
       
    • Download Reddcoin Core source files:
      sudo wget https://github.com/reddcoin-project/reddcoin/archive/arm_support_v2.zip
      Screenshot
      Screenshot

    • Unzip the file:
      sudo unzip arm_support_v2.zip
      Screenshot

    • Rename the folder from ”unzip arm_support_v2” to ”reddcoin” (easier to use when needed)
      sudo mv reddcoin-arm_support_v2/ reddcoin/
      Screenshot

    • cd reddcoin
      Screenshot

    • sudo ./autogen.sh
      Screenshot

    • sudo ./configure --disable-tests --enable-sse2=no
      Screenshot

    • sudo make
      Screenshot
      Screenshot
      Screenshot
      (This will take some time; with me it took just over 1 hour.)

    • sudo make install
      Screenshot
      Screenshot

  • Speed up synchronizing with the Reddcoin blockchain by bootstrapping.
    • Set the working directory to your USB drive:
      cd /media/rpi3b/usb
      (rpi3b is the username I chose; if you have a different username, change it to yours.)
       
    • Download the bootstrap file (1.45 GB):
      sudo wget https://github.com/reddcoin-project/reddcoin/releases/download/v2.0.1.2/bootstrap.dat.xz
      Screenshot
      Screenshot

    • Unpack the file (large file, takes around 15 minutes to unpack):
      sudo xz -d bootstrap.dat.xz
      Screenshot

    • After a successful unpack, your will find the file bootstrap.dat in your USB root folder.
      Screenshot

  • On the first run of the Reddcoin Core client, it will ask for a data directory to store the blockchain and wallet data.
    • Start the Reddcoin Core client:
      sudo /media/rpi3b/usb/reddcoin/src/qt/reddcoin-qt
      Screenshot

    • The welcome screen will appear and ask you about the data directory. I suggest a new folder on your USB drive, I picked blockchain. The directory will be created with all the necessary files.
      Screenshot

      • Select Use a custom data directory.
        Screenshot

      • Click on the three dots (…) on the right.
        Screenshot

      • Click on Create Folder at the upper right corner.
        Type and enter in the folder name. (In my case: blockchain.)
        Click on Open.
        Screenshot
        Screenshot
        Screenshot

    • After selecting the directory, the Reddcoin Core client will start. Wait till it’s fully loaded and close it.

  • Move the bootstrap.dat file to your data directory you selected in the previous step. By doing this, Reddcoin Core will use the bootstrap.dat file to import the blockchain, which speeds up syncing.

    sudo mv bootstrap.dat /media/rpi3b/usb/blockchain/
    (Assuming blockchain as data directory.)
    Screenshot
  • The Reddcoin Core client set up is completed, but you still have to sync fully with the blockchain before you can send, receive and stake.
    • Launch the Reddcoin Core client again:
      sudo /media/rpi3b/usb/reddcoin/src/qt/reddcoin-qt
      Screenshot
      Screenshot

    • Keep the client running until it’s fully synchronized. It will use the bootstrap file first, and download the rest of the blockchain to complete the sync. This can take some time (it took 2 days for me). Syncing the blockchain uses a lot of resources, so the software may react slow.

    • You can see the progress in the debug window (Help > Debug window).
      Screenshot

    • When the synchronization is completed, the red (out of sync) will disappear on the Overview screen!
      Screenshot

  • When synchronization is complete, you can start staking your Reddcoins.
    • For staking, your wallet needs to be encrypted: Settings > Encrypt…
      Do not forget your password!
      Screenshot
      Screenshot
      Screenshot
      Screenshot
      Screenshot

      • Your wallet will be encrypted, and the Reddcoin Core client will be closed. Launch the Reddcore Client again.
        sudo /media/rpi3b/usb/reddcoin/src/qt/reddcoin-qt

    • To start stake, you need to unlock your wallet (by entering your password).
      • Settings > Unlock Wallet…
        Screenshot

      • Make sure “For staking only” is checked before clicking OK.
        Screenshot

    • You can only stake with Reddcoins that have matured: coins have to be at least 8 hours in your wallet to mature.

    • The grey arrow at the bottom should be green when staking. Hover over that icon to see the progress of staking.
      Screenshot

Video

This video shows how long it takes to start Reddcoin Core.
 
TL;DR:

  • [01:11] Reddcoin Core started (sudo password entered).
  • [01:13] Message shown on screen: Loading block index…
  • [10:14] Message shown on screen: Verifying blocks…
  • [10:18] Message shown on screen: Loading wallet…
  • [12:49] Message shown on screen: Done loading
  • [13:13] Reddcoin Core ready to use.

Extra

Backup

Backup your wallet to prevent losing the RDDs in your wallet!
There are two methods to backup, do both.
Make new backups if you create a new receiving address!

  • Method 1: Backup your wallet.dat.
    Open Reddcoin Core.
    Use the menu to backup: File > Backup Wallet…
    Screenshot
  • Method 2: Backup your private keys.
    In case you lose your wallet.dat backup, you still can import your private keys later when needed.
     
    • To extract your private keys:
      • If you have a passphrase on your wallet, unlock your wallet first.
        Settings -> Unlock Wallet… (make sure ‘For staking only’ is not checked)
        Screenshot
        Screenshot

      • Extract your private keys.
        Debug window -> Console ->
        dumpprivkey <your RDD address>
        Screenshot

      • You can write down your private key or copy and save it in a document. Make sure you save it somewhere only you can access it.

    • To import later:
      Debug window -> Console ->
      importprivkey <reddcoinprivkey> [label]
      [label] is optional.
      Screenshot (without a label)
      Screenshot (with a label)

Boot with only 1 USB drive plugged in:

Make sure only the USB drive (with the swap partition and data partition) is plugged in when you boot up your Raspberry Pi. This to make sure the swap partition (/dev/sda1) is recognized correctly.
 
If you boot up with multiple USB drives, Lubuntu might see the USB drive with the swap partition as the second drive (instead of the first drive), and ignore the 2 GB swap partition. If this happens, starting Reddcoin can render the Raspberry Pi unresponsive.

Connection issues

If you have issues syncing the blockchain because you have 0 network connections, please follow the instructions in this article.

Start Reddcoin Core easier

Run a shell script (.sh file), so you can start Reddcoin just by double clicking on an icon on your Desktop.

  • Right Click on your Desktop and select Create New -> Empty File.
    Screenshot

  • Enter a file name, make sure it ends with .sh, and click on OK.
    I’ve chosen for Reddcoin.sh.
    Screenshot

    The file will be created on your Desktop.
    Screenshot

  • Add the command to start Reddcoin to the file.
    • Right click on the file, select Leafpad (to open the file in a text editor).
      Screenshot

    • Add the following to the file and save the file: sudo /media/rpi3b/usb/reddcoin/src/qt/reddcoin-qt
      Screenshot

  • To be able to execute the shell script (.sh), it has to have ‘execute permissions’.
    • Right click on the file, and select Properties.
      Screenshot

    • Click on the Permissions tab.

    • For Execute, select Anyone, and click on OK.
      Screenshot

  • To start Reddcoin Core, double click on the file.
    A new window will pop-up, asking you what you want.
    Execute in Terminal is what we want, so you can click on enter.
    Screenshot

    Reddcoin Core will now start. Do not close the Terminal window, you can minimize it if needed.

Minimization options

Adjust minimization options, so you can safely press on the X button (the close/exit button on the upper right corner).

  • Activate ‘Minimize on close’.
    Settings -> Options… -> Window (tab) -> Minimize on close.
    Screenshot

    Reddcoin will still run when you click on the X button.
    To close/exit Reddcoin, right click on the Reddcoin icon in the system tray (bottom right corner).
    Screenshot

RealVNC VNC Viewer (client) and VNC Connect (server):

To remote connect to the Raspberry Pi, I use VNC Viewer ad VNC Connect from RealVNC.

  • On your Raspberry Pi:
    • Download VNC Connect from the RealVNC website: https://www.realvnc.com/en/connect/download/vnc/raspberrypi/.

    • After your download is finished, open the file and click Install Package.
      Screenshot

    • To run the VNC Connect once:
      • Open [Menu] > Run, and enter: vncserver-x11
        Screenshot

    • To auto run on startup:
      • Open Default applications for LXSession ([Menu] > Preferences > Default applications for LXSession).
        Screenshot
      • In LXSessions configuration, select Autostart in the menu left.

      • Under Manual autostarted applications, enter vncserver-x11 and click on + Add.
        Screenshot
        Screenshot

      • Reboot your Raspberry Pi and check if VNC Connect is started automatically after the reboot.

    • When VNC Connect is running, you’ll see a VNC icon on the right bottom corner. Double click the icon to open VNC Connect and to see the IP address you need to enter to connect to your Raspberry Pi.
      Screenshot

  • On your computer:

Chromium as browser:

The updates break Firefox, the browser crashes when you try to run it. Install another browser, Chromium, to solve this issue.

  • In LXTerminal, enter:
    sudo apt install chromium-browser
    Screenshot

  • You can run Chromium via [Menu] > Internet -> Chromium Web Browser
    Screenshot

Updates / Upgrades

If Software Updater shows up and tells you that there is updated software available, do not install the updates using Software Updater.

Use LXTerminal to update Lubuntu.

  • Open LXTerminal and enter this command to update:
    sudo apt update && sudo apt upgrade
    Screenshot

Credits

  • cryptoBUZE on reddit.com; for getting the official arm_support_v2.zip to work.
  • worstkaas on reddit.com; for his suggestion of using 2 GB instead of 1 GB for the swap space.

Credits in previous tutorial

  • My main source: damsal01 on reddcointalk.org.
    His RDD address for donation: Rqd8xDv6oV9BYFaVrLdkWcR5JU6sPPZTKs.
  • hieplenet on reddit.com.
    His RDD address for donation: RaF3TeWqgTzAdnaZQffnsxS74dag13zsAY.
  • joroob on Github.com. He made some adjustments to the reddcoin wallet source code so it will compile on ARM cpus.
    His RDD address for donation: Rb8754QZvpbw6DjrMV1qX9SnHzYnSyXRMC.

1 thought on “[Reddcoin] Updated: Staking with Reddcoin Core client GUI wallet on a Raspberry Pi Model 3B”

Leave a Comment