/Quilibrium-Node-Auto-Installer-v2

Quilibrium node auto-installer script

Primary LanguageShell

This is a script to auto-install your Quilibrium node in the easiest way.

This guide is unofficial and made just to support the project

♡ Want to say thank you?

Apart from using my referral links below for Cherryservers, you can buy me a cup of something with a small donation, here is my ERC-20 address

0x0fd383A1cfbcf4d1F493Dd71b798ebca89e8a013

Table of Contents

Best server to run a Quilibrium node

Cherryservers supports Quilibrium and is recommended by Cassie, the founder of Quilibrium. They offer good solutions at a fair price. Thank you for using my referral links and supporting my work :-)

Here are some pre-configured server options, take a look. Cloud VDS 4 | E3-1240V3 | E3-1240V5 | E5-1620V4 | E5-1650V3 | E5-1650V4

Node auto-installer: install your node in a few clicks

If you are reinstalling your existing node, be sure to backup your keys.yml and config.yml files, they are in the root/ceremonyclient/node/.config folder. How do I do this?

Step 1

Rent a server with at least 8 cores (best 12), 16 GB RAM (best 32), 250 GB SSD space (best 500), and 400 Mbit/s symmetric bandwidth.
(After Quilibrium 1.5 min specs will be: 4 cores, 8 GB RAM, and 400 Mbit/s symmetric bandwidth. Outbound traffic after 1.5 should be up to 5 TB per month ((raw approximation)), depending on how you set the node)
Also refer to the Quilibrium official docs.
If you can afford better specs than the minimum, your node will earn more rewards.

VDS (Virtual Dedicated Servers) and Bare Metal (Physical dedicated Servers) are your best choiche. Using a VPS (Virtual Private Server) may give you issues as often the providers oversell the resources. The community had a really bad experience with both Contabo and Hostinger for instance.
That being said, after 1.5 is out a VPS or a home machine may work just fine.

Step 2

Install the OS Ubuntu 22.04.X.
If your server has two disks, consider configuring them in "RAID 1" (typically offered by your provider). This setup mirrors one disk to the other, providing redundancy and safeguarding against data loss in case one disk fails.

Step 3

Run the auto-installer script on your server (OS must be Ubuntu 22.04.X). I suggest you to use Termius to login

 wget -O - https://raw.githubusercontent.com/masterkiller87/Quilibrium-Node-Auto-Installer-v2/main/installer | bash
Auto-installer script for Almalinux 8 (untested) The below script has not been tested yet, run it at you own risk!
wget -O - https://raw.githubusercontent.com/lamat1111/quilibrium-node-auto-installer/master/installer-ubuntu-almalinux | bash

Step 4

After installing the node and making some necessary edits, the script will run your node for 5 minutes and then you will be prompted to reboot the system, type "Y" and reboot.

Step 5

Wait 3 minutes, then login again in your server.

Step 6

Run the command below. This will go to the node folder, create a persistent shell (session), start the node via the poor_mans_cd script (more info about this script below) and detach from the session again.

cd ceremonyclient/node && tmux new-session -d -s quil './poor_mans_cd.sh'
Alternatve: step by step commands You can also run these command one after the other if you prefer.
cd ceremonyclient/node 
tmux new-session -s quil 
./poor_mans_cd.sh

To detach from tmux press CTRL+B then D. Now you can safely logout from your server and the node will keep running in its persistent shell. To reattach to the tmux session and see your node log, just use tmux a -t quil

Step 7

You are done! Now you can safely logout from your server and the node will keep running in its persistent shell.

If you want to see you node log you can reattach to the tmux session with tmux a -t quil

Once you are in the tmux session a green bar will appear at the bottom of the screen, to detach from tmux press CTRL+B then D.
It will usually take 15-30 minutes before you will begin to see new log entries in the node log.

The poor_mans_cd is a script used to run the node, it will also restart it if it gets killed and will auto-update it when there is a new version available.

Step 8

Let you node run for at least 30 minutes, then proceed to backup your your keys.yml and config.yml files, and setup your gRPC calls

Check node info

After you node has been running for at least 30 minutes, run this command from your root folder to check the node info (Node version, Peer ID, Quil balance).
For this to work you need to setup the gRPC calls first.

cd /root/ceremonyclient/node && GOEXPERIMENT=arenas go run ./... -node-info

Backup your keys.yml and config.yml files

After 30 minutes that then node has been running, it should have generated your keys and config files correctly. Use WinSCP to navigate to the root/ceremonyclient/node/.config folder. You may have to enable visibility for hidden files in WinSCP if you don't see the .config folder. Select Options, Preferences from the main menu, then the Panels tab, and check the option to Show hidden files (Ctrl+Alt+H).

Download locally your keys.yml and config.yml files. Keep them safe and do not share them with anyone! Is a good idea to put them in an encrypted folder using a free tool such as Encrypto

If you need to migrate the node elsewhere, after installing the node from scratch you just need to put these 2 files in the root/ceremonyclient/node/.config folder (changing the ones automatically created by the node). Here is a quick way to do this.

Setup the Firewall and gRPC calls

After tour node has been running for 30 minutes, run the below script to setup the gRPC calls.

wget -O - https://raw.githubusercontent.com/lamat1111/quilibrium-node-auto-installer/master/installer-gRPC-calls | bash

Now run the below script to setup the Firewall.

wget -O - https://raw.githubusercontent.com/lamat1111/quilibrium-node-auto-installer/master/installer-firewall | bash



Tools and resources

  • To manage your nodes use Termius, the coolest SSH client and terminal around :)
  • To track your server uptime and resources usage use Hetrixtools.com, you can track up to 15 servers for free and the setup is very easy
  • If you need help come to the Quilibrium Community Discord

Useful server commands

Check node info After you node has been running for at least 30 minutes, run this command from your root folder to check the node info (Node version, Peer ID, Quil balance).
For this to work you need to [setup the gRPC calls](https://github.com/lamat1111/quilibrium-node-auto-installer/blob/main/README.md#setup-the-firewall-and-grpc-calls) first.
To go to the root folder just type cd .
cd /root/ceremonyclient/node && GOEXPERIMENT=arenas go run ./... -node-info

Check node version If the "Check node info" command above do not work, you can check the node version by running:
cat ~/ceremonyclient/node/config/version.go | grep -A 1 'func GetVersion() \[\]byte {' | grep -Eo '0x[0-9a-fA-F]+' | xargs printf '%d.%d.%d'
Check node peer ID If the "Check node info" command above do not work, you can check the node peer ID by running:
cd ~/ceremonyclient/node && GOEXPERIMENT=arenas go run ./... -peer-id
Attach to existing tmux session
tmux a -t quil

To detach from tmux press CTRL+B then release both keys and press D

Create tmux session + run node + detach from session: 1 step command This is useful to quickly run then node in a session AFTER you have rebooted your server. Only RUN this after a reboot and if you have no tmux session already active.
cd ceremonyclient/node && tmux new-session -d -s quil './poor_mans_cd.sh' && tmux detach
Create cronjob to run the node automatically after a reboot You only have to run this command once. This will setup a cronjob that will create your tmux session and run the node automatically after every reboot of your server. Shoutout to Peter Jameson (Quilibrium Discord community creator) for the script.
(crontab -l ; echo "@reboot sleep 10 && bash -lc \"tmux new-session -d -s quil\" && tmux send-keys -t quil \"cd ~/ceremonyclient/node\" Enter && tmux send-keys -t quil \"./poor_mans_cd.sh\" Enter") | crontab -
Kill node process Use this in case you need to stop the node and kill the process
pkill node && pkill -f "go run ./..."
Empty "store" folder CAREFUL: this will empty your "store" folder, only use it if you know what you are doing. Sometimes when you receive errors that you cannot debug, you can solve by killing the node process, emptying the store folder and starting the node again from scratch.
sudo rm -r /root/ceremonyclient/node/.config/store
Backup keys.yml and config.yml to a root/backup folder This may be useful if you have to cleanup your ceremonyclient folder and don't want to download locally your config.yml and keys.yml. You can just backup them remotely on a root/backup folder and copy them again in the node folder later on.

Copy the files your node folder to from root/backup

mkdir -p /root/backup && cp /root/ceremonyclient/node/.config/config.yml /root/backup && cp /root/ceremonyclient/node/.config/keys.yml /root/backup

Copy the files back from root/backup to your node folder

cp /root/backup/{config.yml,keys.yml} /root/ceremonyclient/node/.config/

Migrate node to a new server

  1. OPTIONAL if you already have installed the node. Use the auto-installer script in this guide to install the node on the new server and let it run for 5 minutes, then stop it with CTRL+C
  2. Grab your new server IP and password.
  3. Login to the old server and run this command. Change <NEW_SERVER_IP> with your new server IP and enter the new server password when requested.
scp -f /root/ceremonyclient/node/.config/keys.yml /root/ceremonyclient/node/.config/config.yml root@<NEW_SERVER_IP>:/root/ceremonyclient/node/.config/
ATTENTION: The command will ovewrite any existing keys.yml and config.yml files in the target server with no confirmation.

The command will move your keys.yml and config.yml to new server. For this to work the node must already be installed in the new server and the .config folder be generated.

Manual method

Alternatively you can migrate the files manually. If you already have a local backup of the config.yml and keys.yml files, you just need to upload them to your new server in the folder root/ceremonyclient/node/.config . You can use use WinSCP to do this.

Troubleshooting

Panic: resource temporarily unavailable This error means you have an already running instance of the node. Follow the step below to kill all nodes and restart just one instance.
How to kill and restart the node Sometimes you may need to kill and restart the node. For instance if you made the mistake of starting 2 separate instances of the node.
You may also verify this by running the command ps -ef . It will list all your running processes, look for ".../exe/node". There should be only one.



Go to your root folder

cd root

Kill all the node processes

pkill node && pkill -f "go run ./..."

Go into your tmux session and start again the node.

tmux a -t quil
./poor_mans_cd.sh

To detach from tmux press CTRL+B then D.

Errors on servers that already hosted a node If you've already attempted to install a node on your server and then ran the auto-install script, you may encounter errors. Execute these commands sequentially, and they should typically suffice for initiating a new installation.
sudo swapoff /swap/swapfile 2>/dev/null; sudo sed -i '/\/swap\/swapfile/d' /etc/fstab; sudo rm /swap/swapfile 2>/dev/null; sudo rmdir /swap 2>/dev/null || sudo rm -rf /swap
sudo rm -rf /usr/local/go && sudo rm -rf /root/ceremonyclient
Command GO not found If you see the error *Command GO not found*, then try to run this command.
export PATH=$PATH:/usr/local/go/bin:$HOME/go
export GOEXPERIMENT=arenas



If you receive the error while trying to run your poor_mans_cd script in your tmux session, press CTRL+C to stop the process, then run

export PATH=$PATH:/usr/local/go/bin:$HOME/go
export GOEXPERIMENT=arenas

and finally try to run again the script

./poor_mans_cd.sh