Links
Comment on page

GitLab Artifact Install

Setup a Witness Node using a pre-compiled GitLab artifact
This document assumes that you are running Ubuntu 20.04.
The Gitlab artifacts were built targeting Ubuntu 20.04 and will not work on Ubuntu 18.04. While Peerplays does support Ubuntu 18.04, you'll need to follow the Manual Install guide for Ubuntu or use Docker to use it on this version.
The following steps outline the artifact installation of a Witness Node:
  1. 1.
    Prepare the environment
  2. 2.
    Download and extract the artifacts
  3. 3.
    Copy the artifacts to the proper locations
  4. 4.
    Update the config.ini File
  5. 5.
    Create a Peerplays Account
  6. 6.
    Update config.ini with Witness Account Info
  7. 7.
    Start the Witness and Vote for Yourself
  8. 8.
    Auto-Starting the Witness Node
Before we begin, to set up a Witness node requires about 15 PPY. This is to pay for an upgraded account (5 PPY) and to create a new witness (8 PPY). The remaining funds are to pay for various transaction fees while setting up the node (like voting for yourself!). Please see Obtaining Your First Tokens for more info.
Note that these fees will likely change over time as recommended by the Committee of Advisors.

1. Prepare the environment

1.1. Hardware requirements

Please see the general Witness hardware requirements.
For the GitLab artifact install, the requirements that we'll need for this guide would be as follows:
Node Type?
CPU
Memory
Storage
Bandwidth
OS
Witness
4 Cores
16GB
100GB SSD
1Gbps
Ubuntu 20.04
The artifacts from GitLab are already built for x86_64 architecture. These will not work with ARM based architecture.

1.2. Install the required dependencies

The following dependencies are necessary for a clean install of Ubuntu 20.04:
sudo apt-get install \
autoconf bash bison build-essential ca-certificates dnsutils expect flex git \
graphviz libbz2-dev libcurl4-openssl-dev libncurses-dev libpcre3-dev \
libsnappy-dev libsodium-dev libssl-dev libtool libzip-dev locales lsb-release \
mc nano net-tools ntp openssh-server pkg-config python3 python3-jinja2 sudo \
systemd-coredump wget libboost-all-dev

1.3 cmake setup

Cmake is an open-source, cross platform tool that uses independent configuration files to generate native build tool files specific to the compiler and platform. It consists of precompiled binaries and the cmake tools makes configuration, building, and debugging much easier.
Install the cmake using the below commands:
wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.sh
chmod 755 ./cmake-3.24.2-linux-x86_64.sh
sudo ./cmake-3.24.2-linux-x86_64.sh --prefix=/usr --skip-license
cmake --version

1.4 Install Boost libraries

Boost libraries provide free peer-reviewed portable C++ source libraries and it can be used across broad spectrum of application.
Install Boost libraries using the below commands:
wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz
tar -xzvf boost_1_72_0.tar.gz
cd boost_1_72_0
./bootstrap.sh
./b2
sudo ./b2 install
sudo ldconfig

1.5 Install libzmq

The components libzmp and cppzmp are used for relaying messages between nodes.
First, install libzmq using the below commands:
wget https://github.com/zeromq/libzmq/archive/refs/tags/v4.3.4.tar.gz
tar -xzvf v4.3.4.tar.gz
cd libzmq-4.3.4
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
sudo ldconfig

1.6 Install cppzmq

Next, install cppzmp using the below commands:
wget https://github.com/zeromq/cppzmq/archive/refs/tags/v4.9.0.tar.gz
tar -xzvf v4.9.0.tar.gz
cd cppzmq-4.9.0
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
sudo ldconfig

1.7 Install gsl

GSL is the GNU scientific library for numerical computing. It is a collection of routines for numerical computing in e.g. linear algebra, probability, random number generation, statistics, differentiation, etc.,
Install the gsl using the below commands:
wget https://github.com/imatix/gsl/archive/refs/tags/v4.1.4.tar.gz
tar -xzvf v4.1.4.tar.gz
cd gsl-4.1.4
make -j$(nproc)
sudo make install
sudo ldconfig

1.8 Install libbitcoin

The libbitcoin toolkit is a set of cross platform C++ libraries for building bitcoin applications. The toolkit consists of several libraries, most of which depend on the base libbitcoin-system library.
Install the libbitcoin using the below commands:
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git
cd libbitcoin-explorer
sudo ./install.sh
sudo ldconfig

1.9 Install Doxygen

Doxygen is a software utility that recognizes comments within C++ code that have a certain form, and uses them to produce a collection of HTML files containing the information in those comments.
Install the Doxygen using the below commands:
wget https://github.com/doxygen/doxygen/archive/refs/tags/Release_1_8_17.tar.gz
tar -xvf Release_1_8_17.tar.gz
cd doxygen-Release_1_8_17
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
sudo ldconfig

2.0 Install Perl

Perl is a high-level, general-purpose, interpreted, dynamic programming language originally developed for text manipulation.
Install the Perl using the below commands:
wget https://github.com/Perl/perl5/archive/refs/tags/v5.30.0.tar.gz
tar -xvf v5.30.0.tar.gz
cd perl5-5.30.0
./Configure -des
make -j$(nproc)
sudo make install
sudo ldconfig

2. Download and extract the artifacts

Artifacts are pre-built binaries that are available to download from GitLab. You can see the available pipelines, sorted by release tags, on the GitLab Peerplays project page. The link in the code below refers to release version 1.6.0 which is the latest production release as of the writing of this document. Please make sure to replace the tag with the one you need.
cd $HOME
mkdir artifacts
cd artifacts
sudo wget https://gitlab.com/PBSA/peerplays/-/jobs/artifacts/1.6.0/download?job=build-mainnet -O artifacts.zip
unzip artifacts.zip
Double check the tag in the download link!

3. Copy the artifacts to the proper locations

Putting the witness_node and cli_wallet programs in the /usr/local/bin directory will allow us to call the program from any directory.
sudo cp $HOME/artifacts/build/programs/witness_node/witness_node /usr/local/bin/witness_node
sudo cp $HOME/artifacts/build/programs/cli_wallet/cli_wallet /usr/local/bin/cli_wallet
Now we can run start the node with:
cd $HOME
witness_node
Launching the witness creates the required directories which contain the config.ini file we'll need to edit. We'll stop the witness now with Ctrl + C so we can edit the config file.

4. Edit the config.ini file

We need to set the endpoint and seed-node addresses so we can access the cli_wallet and download all the initial blocks from the chain. Within the config.ini file, locate the p2p-endpoint, rpc-endpoint, and seed-node settings and enter the following addresses.
nano ~/witness_node_data_dir/config.ini
p2p-endpoint = 0.0.0.0:9777
rpc-endpoint = 0.0.0.0:8090
seed-node = ca.peerplays.info:9777
seed-node = de.peerplays.xyz:9777
seed-node = pl.peerplays.org:9777
seed-nodes = []
Save the changes and start the Witness back up.
witness_node

5. Create a Peerplays Account

We'll need an account as the basis of creating a new Witness. The easiest way to do that is to use the GUI wallet.

5.1. Download the Peerplays Core GUI Wallet to Make an Account

  1. 1.
    Install, open, and create an account. It's pretty self-explanatory.
    🙂
  2. 2.
    Wait for your node to sync the blocks (about 7.3GB at the time of writing). We need to do this before we can use the CLI wallet.
  3. 3.
    From this point on, please note the results of the following commands as you'll need them later.

5.2. Use the cli_wallet to set a password and unlock the wallet

Back in a new command line window, we can access the cli_wallet program after all the blocks have been downloaded from the chain. Note that "your-password-here" is a password that you're creating for the cli_wallet and doesn't necessarily have to be the password you used in the GUI wallet earlier.
cli_wallet
set_password your-password-here
unlock your-password-here
The CLI wallet will show unlocked >>> when successfully unlocked.
A list of CLI wallet commands is available here: https://devs.peerplays.tech/api-reference/wallet-api/wallet-calls

5.3. Generate OWNER private keys for the cli_wallet and import them

This will return an array with your owner key in the form of ["PPYxxx", "xxxx"]. Note that the "created-username" and "created-password" used here are the username and password from the GUI wallet!
get_private_key_from_password created-username owner created-password
The second value in the returned array is the private key of your owner key. Now we'll import that into the cli_wallet.
import_key "created-username" SECONDVALUEFROMLASTCOMMAND

5.4. Generate ACTIVE private keys for the cli_wallet and import them

Once again, this will return an array with your active key in the form of ["PPYxxx", "xxxx"]. Note that the "created-username" and "created-password" used here are the username and password from the GUI wallet!
get_private_key_from_password created-username active created-password
The second value in the returned array is the private key of your active key. Now we'll import that into the cli_wallet.
import_key "created-username" SECONDVALUEFROMLASTCOMMAND
The keys that begin with "PPY" are the public keys.

5.5. Upgrade to lifetime membership

You will need some PPY for this command to succeed. The account must have lifetime membership status to create a new Witness.
upgrade_account created-username true

5.6. Create yourself as a Witness

The URL in this command is your own URL which should point to a page which describes who you are and why you want to become a Peerplays witness. Note your block signing key after you enter this command.
This command will require some PPY as well.
create_witness created-username "https://your-url-to-witness-proposal" true

5.7. Gather your Witness account info

First we'll get the private key for your block_signing_key.
get_private_key YOURBLOCKSIGNINGKEY
Then dump your keys to check and compare. One of the returned values from the following command should match your block_signing_key.
dump_private_keys
Last we'll get your witness ID.
get_witness created-username

6. Edit config.ini to include your Witness ID and your private key pair

Exit the cli_wallet with the quit command. We'll stop the Witness (Ctrl + C in the first command line window) and edit the config.ini file once again.
nano ~/witness_node_data_dir/config.ini
witness-id = "your_witness_id"
private-key = ["block_signing_key", "private_key_for_your_block_signing_key"]

7. Start the Witness and vote for yourself

witness_node
Once again, we need to wait for the node to sync the blocks to use the cli_wallet. After the sync, you can vote for yourself. Back in the second command line window:
cli_wallet
unlock your-password-here
vote_for_witness created-username created-username true true
Now you can check your votes to verify it worked.
get_witness your_witness_account
Congrats! You've successfully installed your Witness node using GitLab artifacts!
🎊

8. What's Next?

8.1. Auto-starting your node

Up until this point we have been running the node in the foreground which is fragile and inconvenient. So let's start the node as a service when the system boots up instead.

8.2. Creating a backup node

After that, it would be smart to create a backup server to enable you to make software updates, troubleshoot issues with the node, and otherwise take your node offline without causing service outages.

8.3. Fire up another node
🔥

You've got a Witness node. Now you'll need a BOS node. And since you're in the node making mood, how about a SON too?

8.4. Enable SSL to encrypt your node traffic

If you have a node that is accessible from the internet (for example, an API or Seed node) it would be wise to enable SSL connections to your node.

9. Glossary

Witness: An independent server operator which validates network transactions.
Witness Node: Nodes with a closed RPC port. They don't allow external connections. Instead these nodes focus on processing transactions into blocks.