Part 3 - Package Installation and Initial Configuration

Logged in as the non-root user, the next step is to install the required packages.

  • Install packages
  • Validate hardware
  • Configure the zend daemon and run a test challenge (this will establish whether the system is capable of passing challenges)



DescriptionCommand
1Set an environment variable to match the Fully-Qualified Domain Name of the node - you will need to type this command and change 'FQDN' (the value between the quotes ' ') to the value used in the domain registration for your node

DO NOT USE CAPITAL LETTERS IN PLACE OF 'FQDN' REPLACE ONLY WITH LOWER CASE!

FQDN='FQDN'

use only lower case letters like the example

Example Output

zenops@node01:~$ FQDN='node01.zentest.win'

2Add the FQDN variable to the .bashrc file, for the non-root user, this will ensure it is persistent across sessions
echo "export FQDN=$FQDN" >> $HOME/.bashrc
3

Update the package cache

sudo apt-get update
4

Install the universe repository and the initial packages (build-essential, software-properites-common, apt-transport-https, lsb-release, dirmngr, pwgen, git, jq ufw, curl, aria2)


sudo apt install software-properties-common -y

Skip adding the universe repository on Debian systems, DO NOT SKIP THE OTHER ENTRIES IN THIS STEP

sudo add-apt-repository universe -y

Be sure to copy entire commands, especially for long command strings

sudo apt-get install build-essential apt-transport-https lsb-release dirmngr pwgen git jq ufw curl aria2 -y

IF USING DEBIAN, ENTER THE FOLLOWING. DO NOT ENTER THE FOLLOWING FOR UBUNTU

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
5

Add the Horizen repository to the 'sources.list' file

echo 'deb https://HorizenOfficial.github.io/repo/ '$(lsb_release -cs)' main' | sudo tee /etc/apt/sources.list.d/zen.list
6Pull the gpg key used to sign Horizen packages

Pulling the gpg key may take some time, if it times out, run it again until it has been imported

gpg --keyserver keyserver.ubuntu.com  --recv 219F55740BBF7A1CE368BA45FB7053CE4991B669

Alternate key server if the one above fails to respond

gpg --keyserver ha.pool.sks-keyservers.net --recv 219F55740BBF7A1CE368BA45FB7053CE4991B669
7Export the gpg key and add to apt, this enables package verification
gpg --export 219F55740BBF7A1CE368BA45FB7053CE4991B669 | sudo apt-key add -
8

Install the latest version of snap and use it to install the snap version of certbot


sudo apt install snapd -y && sudo snap install core

Install certbot using snap and copy certbot into /usr/bin

sudo snap install --classic certbot
9
Update the package cache again with the Horizen repository added as sources
sudo apt-get update
10Install the zen software
sudo apt-get install zen -y
11Download the required parameters for zend
zen-fetch-params
12

Run zend after installation, read the message, it will then stop

NOTE: Do not restart zend as you will see in the last two lines of the warning message, proceed to step 13 below

zend
13Create a configuration file for zend, copy and paste the entire block of text on the right and paste on the command line
cat <<EOF > ~/.zen/zen.conf
rpcuser=$(pwgen -s 32 1)
rpcpassword=$(pwgen -s 64 1)
rpcport=18231
rpcworkqueue=512
rpcallowip=127.0.0.1
server=1
daemon=1
listen=1
txindex=1
logtimestamps=1
### testnet config
#testnet=1
EOF
14Run zend with the configuration file in place, it should automatically run in the background as a daemon
zend && sleep 8
15

Check that the blocks are increasing, run this command a couple of times with a few seconds in between and verify that the row shown in the example (blocks) shows an increasing number


NOTE: While the zend daemon is starting up, the 'zen-cli getinfo' command will initially return what looks like an error. When the daemon has loaded you will see the output as shown under the command on the right. Therefore do not be alarmed if you see the error shown below prior to the example output.


error code: -28
error message:
Loading block index...

zen-cli getinfo
Example Output

zenops@node01:~$ zen-cli getinfo
{
"version": 2001850,
"protocolversion": 170002,
"walletversion": 60000,
"balance": 0.00000000,
"blocks": 4200,
"timeoffset": 0,
"connections": 8,
"proxy": "",
"difficulty": 3493670.15884702,
"testnet": false,
"keypoololdest": 1546539045,
"keypoolsize": 101,
"paytxfee": 0.00000000,
"relayfee": 0.00000100,
"errors": "WARNING: check your network connection, 57 blocks received in the last 4 hours (96 expected)"
}


Optional Step - Bootstrap Blocks and Chainstate Files and Folders From an Existing Node - DO NOT PERFORM IF THIS IS YOUR FIRST NODE!
16

These are procedures for individuals with existing nodes with a complete copy of the blockchain to get new nodes synchronized quickly (5 to 10 minutes)



CONTINUE BELOW IF THIS IS YOUR FIRST NODE
17
Configure a swap file and benchmark a jointsplit operation on your node

Part 3 of 11 - Package Installation and Initial Configuration



© 2020 Horizen. All rights reserved.