Starting a U°OS Producer Node

Table of contents

Introduction

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

For this guide, we are using a fresh Ubuntu 18.04 running in Singapore.

System requirements

Supported operating systems:

  • Mac OS
  • Ubuntu
  • Debian
  • Fedora

RAM:

  • 8 GB

Overview of the process

  1. Install build libraries
  2. Time sync the system
  3. Create new user for UOS
  4. Clone the UOS repository
  5. Update submodules
  6. Build the UOS software. Note that this will run for over an hour, so plan accordingly.
  7. Install the node from the UOS software
  8. Generate three key pairs using the UOS software
  9. Contact the UOS developers with your preferred account name and public keys
  10. Create and modify config.ini
  11. Download a pre-created genesis.json file
  12. Download snapshot file
  13. Start your node
  14. Create a wallet and import both your Active and Block Producer private keys
  15. Register as a Block Producer

Step-by-step

1. Install build libraries

Install libboost-all-dev build-essential and llvm-4.0-dev:

sudo apt -y install libboost-all-dev build-essential llvm-4.0-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. Create new user for UOS

adduser uos

and switch to this user

su - uos

4. Clone the UOS repository

Clone the UOS repository:

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

5. Update the submodules

Update the submodules:

cd ~/uos
git submodule update --init --recursive

6. Build the UOS software

Build the UOS software with the following command:

./scripts/eosio_build.sh -y

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

7. Install the node

Install the node from the UOS software:

./scripts/eosio_install.sh

Add installed eosio binaries to the PATH variable:

echo 'PATH="/home/uos/eosio/1.8/bin:$PATH"' >> ~/.profile

You need to relogin as uos user.

Verify the version of the node:

nodeos --version

It will give you something similar to:

v1.8.4-1-g11eeb9b85

8. 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.

9. 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.

10. Create and modify config.ini

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

    nodeos
    

    The config.ini file will be created in the ~/.local/share/eosio/nodeos/config/ 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 = mainnet-node-1.uos.network:9876
    p2p-peer-address = mainnet-node-2.uos.network:9876
    p2p-peer-address = mainnet-node-3.uos.network:9876
    p2p-peer-address = mainnet-node-4.uos.network:9876
    p2p-peer-address = mainnet-node-5.uos.network:9876
    
    plugin = eosio::producer_plugin
    

    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
    • You might need to change p2p peers, just ask for the current peers in the dev chat
  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.

Save or copy config.ini to you home directory:

cp ~/.local/share/eosio/nodeos/config/config.ini config.ini

11. Download genesis.json

Download the pre-created genesis.json file from the UOS repository:

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

12. Download snapshot file

Download latest snapshot from S3:

wget https://s3.eu-central-1.amazonaws.com/snapshot.uos.network/snapshot_latest.bin

13. Start your node

Start your Standby Block Producer node:

nodeos --snapshot ~/snapshot_latest.bin --genesis-json ~/genesis.json --delete-all-blocks -c ~/config.ini "$@" >> ~/output.log 2>&1 &

Check that the node is running:

tail -f ~/output.log

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

14. Create a wallet and import Active and Block Producer private keys

Create a wallet that you will use to stake UOS and receive UOS emission:

cleos wallet create -n NAME --to-console

where

  • NAME — Any name for your wallet
  • --to-console — The wallet password will be printed to console. You can also specify --file instead of --to-console if you would like the password to be saved to a file instead.

Save the wallet password and keep it secure.

Make sure the wallet is unlocked:

cleos wallet list

This will print all your wallet names. The unlocked wallets will have an asterisk next to the name *.

For example, the wallet ledgerblocks is unlocked in this output:

Wallets:

[
"default",
"ledgerblocks *",
"test"
]

If your wallet is locked, you can unlock it with the following command:

cleos wallet unlock -n NAME

where NAME is the name of your wallet.

Import your Active private key into the unlocked wallet:

cleos wallet import -n NAME --private-key PRIVATE_KEY

Import your Block Producer private key with the same command but with your Block Producer private key this time.

Lock your wallet:

cleos wallet lock -n NAME

Now you have a locked wallet with both your Active and Block Producer private keys.

15. Register as a Block Producer

Run the following command:

cleos -u https://api.uos.network:7889 system regproducer NAME PUBLIC_KEY

where

  • -u — This parameter sends the command to a full U°OS node. Registration will only work on a fully synced node and syncing the node takes a significant amount of time. So use the -u parameter to register on a fully synced U°OS node running on U°Community server.
  • NAME — This is your Block Producer account name.
  • PUBLIC_KEY — This is your Block Producer public key.

For example, we are registering as ledgerblocks for this guide:

cleos -u https://api.uos.network:7889 system regproducer ledgerblocks EOS8Apwg8bfaLWat4qizAdyoLgESCmkfA3Fz7gVnzzn9TfXaoH2iK

The command might print a warning:

warning: transaction executed locally, but may not be confirmed by the network yet

This is a standard warning saying that it may take a second to register on the network.

You can now check your account name on the GOVERNANCE page of U°Community.

Troubleshooting and maintenance

Checking if the node is running:

ps -elf | grep nodeos

Checking the produced blocks:

tail -f ~/output.log

Gracefully stopping the node:

pkill nodeos

Deleting all blocks to restart the node fresh:

nodeos --delete-all-blocks -c ~/config.ini "$@" >> ~/output.log 2>&1 &

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

A full running U°OS node for API calls:

https://api.uos.network:7889

A full running U°OS history node for API calls:

https://history.uos.network:7889

Get any account information, including balances and voting:

cleos -u https://api.uos.network:7889 get account NAME

Feel free to talk to the developers in the chat.

https://t.me/joinchat/F4mwU0tLqMTrmb8H5kbIMg