Docker Install
Setup a Witness Node using a pre-configured Docker container
This document assumes that you are running Ubuntu 18.04 or 20.04. Other Debian based releases may also work with the provided script.
The following steps outline the Docker installation of a Witness Node:
Preparing the Environment
Installing Docker
Installing the Peerplays image
Starting the Container
Update the
config.ini
FileCreate a Peerplays Account
Update
config.ini
with Witness Account InfoStart the Container and Vote for Yourself
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. Preparing the Environment
1.1 Hardware requirements
Please see the Witness node hardware requirements.
For the docker install on Peerplays Mainnet, the requirements that we'll need for this guide would be as follows (as per the hardware requirements doc):
Node Type?
CPU
Memory
Storage
Bandwidth
OS
Witness
4 Cores
16GB
100GB SSD
1Gbps
Ubuntu 18.04
1.2 Installing the required dependencies
Then we'll clone the Peerplays Docker repository.
2. Installing Docker
It is required to have Docker installed on the system that will be performing the steps in this document.
Docker can be installed using the run.sh
script inside the Peerplays Docker repository:
The run.sh
script contains many commands to make managing the node easy. A list of all its commands are listed in section 9 of this document.
Since the script has added the currently logged in user to the Docker group, you'll need to re-login (or close and reconnect SSH) for Docker to function correctly.
You can look at https://docs.docker.com/engine/install/ to learn more on how to install Docker. Or if you are having permission issues trying to run Docker, use sudo
or look at https://docs.docker.com/engine/install/linux-postinstall/.
2.1. Setting up the .env file
Copy the example.env
to .env
located in the root of the repository (ie peerplays-docker folder)
We're going to have to make some changes to the .env
file so we'll open that now using a text editor.
Here are the important parts of the .env
file. These will be the parts that need to be edited or optionally edited. The rest of the file should be unchanged.
3. Installing the Peerplays image
Use run.sh
to pull the node image:
4. Start the Container
With at least 8GB of disk space available in your home folder, we'll start the node. This will create and/or start the Peerplays docker container.
Then we'll check the status of the container to see if all is well.
Last we'll stop the container so we can make updates to the config.ini
file.
5. Update 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.
Save the changes and start the container back up.
We have successfully started the witness node and it is now ready for configuration.
7. 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 container and edit the config.ini
file once again.
8. Start the container and vote for yourself
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.
Now you can check your votes to verify it worked.
9. Node Configuration
Next step is to configure the witness node based on the requirement. There are different ways in which the nodes can be configured such as block producer, SON node, API node, and delayed node.
Becoming a block producer is one of the important steps as it is mandatory to use the node for transactions across the wallet. Follow the steps from the below document to become a block producer,
There are other ways it which the node can be configured. The below document showcase the other ways available for node configuration.
10. What's Next?
11. Docker run.sh
commands list
run.sh
commands liststart
- starts seed containerstart_son
- starts son seed containerstart_son_regtest
- starts son seed container and bitcoind container under the docker networkclean
- Remove blockchain, p2p, and/or shared mem folder contents, seed, bitcoind, and son docker network (warns beforehand)dlblocks
- download and decompress the blockchain to speed up your first startreplay
- starts seed container (in replay mode)replay_son
- starts son seed container (in replay mode)memory_replay
- starts seed container (in replay mode, with --memory-replay)shm_size
- resizes /dev/shm to size given, e.g. ./run.sh shm_size 10Gstop
- stops seed containerstatus
- show status of seed containerrestart
- restarts seed containerinstall_docker
- install dockerinstall
- pulls latest docker image from server (no compiling)install_full
- pulls latest (FULL NODE FOR RPC) docker image from server (no compiling)rebuild
- builds seed container (from docker file), and then restarts itbuild
- only builds seed container (from docker file)logs
- show all logs inc. docker logs, and seed logswallet
- open cli_wallet in the containerremote_wallet
- open cli_wallet in the container connecting to a remote seedenter
- enter a bash session in the currently running containershell
- launch the seed container with appropriate mounts, then open bash for inspection
10. 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.
Last updated
Was this helpful?