Intermediate

 

Validators – Server setup using Raspberry Pi Guide

This tutorial provides instructions on how to set up a validator server using a Raspberry Pi. It covers the setup of a UPS device, connecting a modem and setting up a fixed IP address and port forwarding, preparing the Raspberry Pi by installing a heatsink and fan, connecting the necessary cables, and installing Ubuntu Server 20.04 LTS on a MicroSD and SSD. It also includes instructions on updating the Raspberry Pi, setting up the SSD as the primary boot device, and changing basic settings such as the keyboard language and time zone. Additionally, the tutorial covers system optimization by minimizing GPU usage, deactivating Bluetooth and Wi-Fi, and overclocking. The final step is to establish the validator server.

Before setting up Raspberry Pi, check requirements here.

UPS Device

Connect the UPS to the power supply and let it charge.

Connect the Modem to the UPS and Set it up

Plug in the modem, the swith and the Raspberry into the UPS and access the Modem. Later we need to set up a fixed IP address and port forwarding (TCP 6000/9000/9500) for the Rasperry.

Prepare the Raspberry

Install Heatsinker on Raspberry

Install Fan

Connect Mini HDMI -> HDMI cable (if you like, otherwise you can use SSH)

Connect the keyboard (if you like, otherwise you can use SSH)

Connect Ethernet

Install Ubuntu Server 20.04 LTS on MircoSD and on SSD. Click here for instructions

Start the UPS Power for the Raspberry

Update Raspberry Pi

Access via Powershell, Terminal or directly via Keyboard and Monitor

ssh username@ip address

 

Login: ubuntu / Password: ubuntu

For security reasons Linux requires to change the default ubuntu password.

Update & Upgrade

 
sudo apt update && sudo apt upgrade

 

During update we can set up a static IP on the Modem and set up Port forwarding.

Restart

sudo reboot

 

Install SSD

Code is adapted from an Instruction, check here if you need further information’s.

Download Eeprom

sudo apt install rpi-eeprom

sudo apt install rpi-eeprom

Restart

sudo reboot

Connect the hard disk and check

lsblk

Read out the SSD ID via and write it down

sudo lsusb

Mount the hard disk

sudo mkdir /mnt/boot
sudo mkdir /mnt/writable
sudo mount /dev/sda1 /mnt/boot
sudo mount /dev/sda2 /mnt/writable

 

Check again with point 5.3 if mount has worked

Automatically boot from SSD using this script

sudo curl https://raw.githubusercontent.com/TheRemote/Ubuntu-Server-raspi4-unofficial/master/BootFix.sh | sudo bash
sudo umount /mnt/boot
sudo umount /mnt/writable
sudo shutdown now

 

Create Quirks driver

In point 5.4. the SSD ID was read out via sudo lsusb xxxx:xxxx Now connect the hard disk to a computer and add in /boot/firmware/cmdline.txt “usb-storage.quirks=xxxx:xxxx:u” in the first place, without the quotation marks and save. For example for the Samung T7, usb-storage.quirks=04e8:4001:u

Remove the MicroSD and boot from SSD

Now it should start from the SSD, let it around 20 Minutes so settle down everything, special if you have a bigger SSD.

In case it searches still for MicroSD, write with the Pi Imager «Misc utility images -> Bootloader -> USB Boot to the MicroSD, put it in and start the Rasperry, wait around 15 seconds, remove power and MicroSD and try again.

Set up the Raspberry again

By starting from the SSD, the password must be changed again. Upon logging in for the first time if the Pi is connected to the internet Ubuntu will immediately/soon start a lengthy update process via snapd and apt.

Make sure you give the system enough time (20 Minutes at least) to finish this process before doing going forward.

Change basic settings

Code is adapted from an Instruction, check here if you need further information’s).

Update by command

sudo apt update && sudo apt upgrade

 

Restart by command

 

sudo reboot

 

Change the keyboard to your Language (if wished)

 

sudo dpkg-reconfigure keyboard-configuration

 

Restart by command

 

sudo reboot

 

Set the time zone

 

sudo dpkg-reconfigure tzdata

 

Restart by command

sudo reboot

 

Speed testing of SSD via

 

sudo hdparm -tT /dev/sda && sudo hdparm -tT --direct /dev/sda

 

System optimization

Minimize GPU, deactivate Bluetooth, deactivate Wifi and overclocking

sudo nano /boot/firmware/config.txt

 

Add the following in the config file under [all]

 

over_voltage=5
arm_freq=1800
force_turbo=1
gpu_mem=16
gpu_freq=300
dtoverlay=disable-bt
dtoverlay=disable-wifi

 

Save via ctrl + x and confirm.

Final Establishment

Change host name

Code is adapted from an Instruction, check here if you need further information’s).

hostnamectl set-hostname NEWHOSTNAME

 

Create user

Code is adapted from an Instruction, check here if you need further information’s).

sudo -i
sudo adduser NEWUSER

 

Enter your new password and confirm again.

Give sudo permission

groups NEWUSER && groups ubuntu
sudo usermod -G ubuntu, adm, dialout, cdrom, floppy, sudo, audio, dip, video, plugdev, netdev, lxd, root NEWUSER

 

Add the entry for the new user in Visudo

 

visudo

 

root ALL = (ALL: ALL) ALL 
NEWUSER ALL = (ALL: ALL) ALL

 

Save via ctrl + x and confirm.

Terminate old processes and block users

sudo pkill -u ubuntu
sudo usermod -L ubuntu

 

Change to new User

 

sudo su -NEWUSER

 

Firewall Setup

Code is adapted from an Instruction, check here if you need further information’s).

Install & activate the firewall

sudo apt install ufw
sudo ufw enable

 

Open the corresponding TCP ports for Harmony & local SSH from another PC

 

sudo ufw allow from LOCALIP to any port 22
sudo ufw allow 6000/tcp
sudo ufw allow 9000/tcp
sudo ufw allow 9500/tcp

 

Check Firewall

 

sudo ufw status

 

Congratulation you set up your Raspberry Pi and it is ready for setting up as Node!