Random Number Generator (RNG)
Other Documentation
Powered By GitBook
Setting up a Witness Node
This is an introduction for new Witnesses to get up to speed on the Peerplays blockchain. It is intended for Witnesses planning to join a live, already deployed, blockchain.
The following repository should be used in support of this document:
GitHub - peerplays-network/peerplays: The Peerplays Blockchain
GitHub

System Requirements

The following table lists what should be considered the minimum system requirements for running a witness node:
CPU
Memory
Storage
Bandwidth
OS
8 Cores
64GB
300GB SSD
1Gbps
Ubuntu 18.04
These requirements are as of the time of writing, so consider deploying a server with specs slightly higher than the ones listed above in order to "future proof" your server in case the minimum requirements grow in the future.

Building on Ubuntu 18.04 LTS and Installation Instructions

The following dependencies are necessary for a clean install of Ubuntu 18.04 LTS:
1
sudo apt-get update
2
sudo apt-get -y install autoconf bash build-essential ca-certificates cmake \
3
dnsutils doxygen git graphviz libbz2-dev libcurl4-openssl-dev \
4
libncurses-dev libreadline-dev libssl-dev libtool libzmq3-dev \
5
locales ntp pkg-config wget autotools-dev libicu-dev python-dev
Copied!

Build Boost 1.67.0

1
mkdir $HOME/src
2
cd $HOME/src
3
export BOOST_ROOT=$HOME/src/boost_1_67_0
4
sudo apt-get update
5
sudo apt-get install -y autotools-dev build-essential libbz2-dev libicu-dev python-dev
6
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.bz2/download'\
7
-O boost_1_67_0.tar.bz2
8
tar xjf boost_1_67_0.tar.bz2
9
cd boost_1_67_0/
10
./bootstrap.sh "--prefix=$BOOST_ROOT"
11
./b2 install
Copied!

Building Peerplays

1
cd $HOME/src
2
export BOOST_ROOT=$HOME/src/boost_1_67_0
3
git clone https://github.com/peerplays-network/peerplays.git
4
cd peerplays
5
git checkout master # --> replace with most recent tag
6
git submodule update --init --recursive
7
git submodule sync --recursive
8
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release
9
make -j$(nproc)
10
11
make install # this can install the executable files under /usr/local
Copied!
Note: #master# can be replaced with the most recent release tag.

Starting the Peerplays Witness Node

If we have installed the blockchain following the above steps, the node can be started as follows:
1
witness_node
2
3
# If you need the logs, the following can be helpful
4
# witness_node 2>&1 peerplays.log
Copied!

Install Docker Image

This Docker image can be installed as an alternative to the previous steps. It doesn't need to be run if those steps have already been completed.
1
# Install docker
2
sudo apt install docker.io
3
4
5
# Add current user to docker group
6
sudo usermod -a -G docker $USER
7
# You need to restart your shell session, to apply group membership
8
# Type 'groups' to verify that you are a member of a docker group
9
10
11
# Build docker image (from the project root, must be a docker group member)
12
docker build -t peerplays .
13
14
15
# Start docker image
16
docker start peerplays
17
18
# Exposed ports
19
# # rpc service:
20
# EXPOSE 8090
21
# # p2p service:
22
# EXPOSE 1776
Copied!

Build Graphene

Note: This step can be skipped if you're not running Ubuntu 14 - which really you shouldn't be!
1
cd ..
2
git clone https://github.com/cryptonomex/graphene.git
3
cd graphene
4
git submodule update --init --recursive
5
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Debug .
6
make
Copied!

Starting A Peerplays Witness Node

1
git clone https://github.com/peerplays-network/peerplays.git
2
cd peerplays
3
git submodule update --init --recursive
4
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .
5
make
6
./programs/witness_node/witness_node
Copied!
Launching the Witness creates the required directories.
Important: Next stop the Witness node before continuing.
1
$ vi witness_node_data_dir/config.ini
2
p2p-endpoint = 0.0.0.0:9777
3
rpc-endpoint = 127.0.0.1:8090
4
seed-node = 213.184.225.234:59500
Copied!
Start the Witness node back up.
1
./programs/witness_node/witness_node
Copied!

Starting the witness as a service

We can add the peerplays blockchain node as a service using the following steps.
under, /etc/systemd/system create a file with the following content.
1
[Unit]
2
Description=Witness
3
[Service]
4
User=ubuntu
5
WorkingDirectory=/home/ubuntu/beatrice
6
ExecStart=/home/ubuntu/beatrice/witness_node
7
Restart=always
8
[Install]
9
WantedBy=mult-user.target
Copied!

Upgrading A Peerplays Witness Node

To minimize downtime of your Peerplays Witness node when upgrading, it's recommended to create a backup Witness server.

CLI Wallet Setup

The next step is to set up the CLI Wallet.

Auto-Starting the Witness Node

It's important for your Witness node to start when your system boots up. The filepaths here assume that you installed your witness into /home/ubuntu/peerplays
Step 1. Create a log file to hold your stdout/err logging
1
sudo touch /var/log/peerplays.log
Copied!
Step 2. Save this file in your Peerplays directory. vi /home/ubuntu/peerplays/start.sh
1
#!/bin/bash
2
3
cd /home/ubuntu/peerplays
4
./programs/witness_node/witness_node &> /var/log/peerplays.log
Copied!
Step 3. Make it executable
1
chmod 744 /home/ubuntu/peerplays/start.sh
Copied!
Step 4. Create this file: sudo vi /etc/systemd/system/peerplays.service
Note: Check the path for start.sh, if necessary, change it to match where your start.sh file actually is.
1
[Unit]
2
Description=Peerplays Witness
3
After=network.target
4
5
[Service]
6
ExecStart=/home/ubuntu/peerplays/start.sh
7
8
[Install]
9
WantedBy = multi-user.target
Copied!
Step 5. Enable the service
1
sudo systemctl enable peerplays.service
Copied!
Important: Make sure you don't get any errors.
1
sudo systemctl status peerplays.service
Copied!
Step 6. Stop your Witness node, if it's currently running, then start it with the service.
1
sudo systemctl start peerplays.service
Copied!
Step 7. Check your logfile for entries
1
tail -f /var/log/peerplays.log
Copied!

BOS and MINT Setup

All Witnesses are also required to install and run the Bookie Oracle Suite (BOS) and the supporting manual intervention tool (MINT).
Last modified 10mo ago