Skip to content

Spinning up a Block Producer Node on Ubuntu

Andrew U edited this page Nov 26, 2018 · 2 revisions

Table of contents

Introduction

This document will guide you through spinning up a Block Producer Node on the UOS testnet.

As this is a testnet, here's a couple of things you need to know beforehand:

  • The UOS developers are currently registering Block Producers manually. You will need to contact the UOS developers on Telegram with your preferred account name and public keys.
  • Your account name generated when signing up at https://u.community/ won't work for the UOS Block Producer registration. You will need to come up with a different one and provide it to us.

For this guide, we are using a fresh Ubuntu 16.04 (xenial) running in Singapore.

System requirements

Supported operating systems:

  • Mac OS
  • Ubuntu
  • Debian
  • Fedora

RAM:

  • 8 GB

Overview of the process

  1. Install Boost C++ libraries
  2. Time sync the system
  3. Clone the UOS repository
  4. Update submodules
  5. Build the UOS software. Note that this will run for over an hour, so plan accordingly.
  6. Install the node from the UOS software
  7. Generate three key pairs using the UOS software
  8. Contact the UOS developers with your preferred account name and public keys
  9. Create and modify config.ini
  10. Download a pre-created genesis.json file
  11. Start your node

Step-by-step

1. Install the Boost C++ libraries

Install libboost-all-dev:

apt -y install libboost-all-dev

2. Time sync the system

Sync the time to where your node is actually located. Check DigitalOcean: How To Set Up Time Synchronization on Ubuntu 16.04.

Since we are running this node in Singapore, we are issuing the following command:

sudo timedatectl set-timezone Asia/Singapore

3. Clone the UOS repository

Create a working directory for the UOS software:

mkdir uosdata

Change the directory to /uosdata/:

cd uosdata

Clone the UOS repository:

git clone https://github.com/UOSnetwork/uos

4. Update the submodules

Update the submodules:

git submodule update --init --recursive

5. Build the UOS software

Build the UOS software with the following command:

./eosio_build.sh -s UOS

Note that this will run for over an hour, so plan accordingly.

6. Install the node

Install the node from the UOS software:

sudo ./eosio_install.sh

Verify the version of the node:

nodeos --version

It will give you something similar to:

v.1.4.3

7. Generate three key pairs

You will need to generate three key pairs that you will use to manage your account:

  • Owner key pair: Use this key pair to manage the ownership of your account; use the owner key to recover the active or producer permissions if they get compromised.
  • Active key pair: Use this key pair to transfer funds and vote.
  • Producer key pair: Use this key pair to manage your Block Producer account.

Generate the key pairs:

cleos create key --to-console

The command will output a key pair once on each run. Run it three times to generate three key pairs.

Label each key pair as Owner, Active, Producer. Labeling here just means putting a note next to each of the key pairs — in a file or on a paper or anything else; it's up to you.

Keep the keys safe. You may want to encrypt them and store securely.

8. Contact the UOS developers

Think up an account name that you would like to register as a Block Producer.

The account name has the following conventions:

  • Must start with a letter
  • Must be 12 characters
  • Can only contain the characters lowercase a-z and 1-5

For example, 123example345 meets the convention requirements.

Prepare the information that you will need to provide to the UOS developers:

  • Your preferred account name
  • Your Owner public key
  • Your Active public key

Contact the UOS general group in Telegram at https://t.me/uos_network_en.

PM the group Admin for the UOS Block Producers Telegram group.

Once you join the UOS Block Producers Telegram group, provide your account name, owner and active public keys. The developers will register you as a Standby Block Producer.

9. Create and modify config.ini

  1. Start the node once to create a default config.ini file:

    nodeos --data-dir ~/uosdata/uos/data/ --config-dir ~/uosdata/uos/data
    

    The config.ini file will be created in the ~/uosdata/uos/data/ directory.

  2. Open config.ini for editing and add the following lines:

    agent-name = "PRODUCER_NAME"
    producer-name = PRODUCER_NAME
    signature-provider = PUBLIC_KEY=KEY:PRIVATE_KEY
    p2p-peer-address = node-1.uos.network:9876
    p2p-peer-address = node-2.uos.network:9876
    p2p-peer-address = node-3.uos.network:9876
    p2p-peer-address = node-4.uos.network:9876
    p2p-peer-address = node-5.uos.network:9876
    

    where

    • PRODUCER_NAME — Your account name that you provided to the UOS developers earlier
    • PUBLIC_KEY — Your public key from the Producer key pair that you generated earlier
    • PRIVATE_KEY — Your private key from the Producer key pair that you generated earlier
  3. Save the file.

Note that the default config.ini file has the agent-name = "EOS Test Agent" parameter uncommented, so you will need to comment it (#) or replace with the agent-name, producer-name and signature-provider parameters as specified above. If you don't do this, you will get an error when starting your node.

10. Download genesis.json

Download the pre-created genesis.json file from the UOS repository to your ~/uosdata/uos/data/ directory:

wget https://raw.githubusercontent.com/UOSnetwork/uos.docs/master/testnetv1/genesis.json

11. Start your node

Start your Standby Block Producer node:

nodeos --data-dir ~/uosdata/uos/data/ --genesis-json ~/uosdata/uos/data/genesis.json --config-dir ~/uosdata/uos/data "$@" > ~/uosdata/uos/data/stdout.txt 2> ~/uosdata/uos/data/stderr.txt &

Check that the node is running:

tail -f ~/uosdata/uos/data/stderr.txt

This should give you a running list of blocks and Block Producers.

12. Register your node

Finally, you must register your node on the chain as a block producer. To register, issue the following command:

cleos system regproducer <producer name> <producer public key> <producer website> <three digit ISO location code>

Your account is now registered as a producer on the testnet.

Troubleshooting and maintenance

Checking if the node is running:

ps -elf | grep nodeos

Checking the produced blocks:

tail -f ~/uosdata/uos/data/stderr.txt

Gracefully stopping the node:

pkill nodeos

Deleting all blocks to restart the node fresh:

nodeos --data-dir ~/uosdata/uos/data/ --genesis-json ~/uosdata/uos/data/genesis.json --config-dir ~/uosdata/uos/data "$@" > ~/uosdata/uos/data/stdout.txt 2> ~/uosdata/uos/data/stderr.txt &

You might want to do this if you started your node prematurely without properly following the instructions.

BPs are expected to perform regular maintenance. Prior to initiating maintenance, you must unregister your producing instance, you can use the following command:

cleos system unregprod <producer name>

Feel free to talk to the developers in the chat.

Resources

EOSIO Wiki: https://developers.eos.io/

Tools and scripts to monitor EOSIO BP:

https://github.com/eossv/bp-tools

https://uptimerobot.com/

https://github.com/cypherglassdotcom/windshield