Complete guide to run a dual node on centos 8 using symbol-bootstrap

In this guide you will learn how to run a dual node (peer and API) on centos 8

Note that this guide is work-in-progress, it will likely change over time

Requirements

Hardware

Hardware requirements are taken from Running a Symbol node — Symbol Documentation

Requirement Minimum Recommended
CPU 4 Cores 8 Cores
RAM 16 GB 32 GB
Disk Size 750 GB 750 GB
Disk Speed 1500 IOPS SSD 1500 IOPS SSD

Environment

  • docker
  • docker-compose
  • node.js
  • VIM texteditor

Ports

  • Port 7900 is used by catapult-server to communicate between nodes
  • Port 3000 is used by the REST Gateway to expose the endpoints to interact with the node.

Installation

In this guide we assume that you are running a freshly deployed server with centos 8.

Creating a new user account

Although it works, it is not recommended to use the root user account for installing/running your node. Thus we will create a new user account. We will name it symbolnode

Log into your server with the root user account.

Use following command to create the user account symbolnode:

adduser symbolnode

Set the password for the freshly created user account with the following command:

passwd symbolnode
[enter new password twice]

Add the user to the sudo-enabled usergroup (we need the sudo command for installation later) and switch to the symbolnode useraccount:

usermod -aG wheel symbolnode
su - symbolnode

Install environment requirements

Install and configure docker with the following commands:

sudo yum install -y yum-utils
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker symbolnode
sudo systemctl start docker
sudo systemctl enable docker

Install docker-compose with the following commands:

sudo dnf install curl
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Install node.js with the following commands:

sudo dnf module list nodejs
sudo dnf install nodejs -y

Install VIM with following command:

sudo yum install vim-enhanced -y

Reboot your server and login with the symbolnode user account we have created earlier.

Verify environment requirements

To verify that the environment installations were successful, we can run following commands:

For docker, run:

docker run hello-world

The output should be similar to:

Hello from Docker!
This message shows that your installation appears to be working correctly.
[...]
For more examples and ideas, visit:
 https://docs.docker.com/get-started/

For docker-compose, run:

docker-compose version

The output should be similar to:

docker-compose version 1.28.5, build c4eb3a1f
docker-py version: 4.4.4
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

For node.js, run:

node --version

The output should be similar to:

v10.24.0

Once you have verified the installation, you can continue to with the installation of symbol-bootstrap.

Install and configure symbol-bootstrap

Use the following command to install symbol-bootstrap:

sudo npm install -g symbol-bootstrap

Before we will run it, we will create a custom configration file custom.yml with VIM.

The custom file should look like this:

nodes:
    - friendlyName: 'NameOfYourNode'
      host: IP
      beneficiaryAddress: YourNEMAccount

friendlyName is the name of your node
host is the IP address of your node (can also be a DNS name)
BeneficiaryAddress is the Symbol Account which will get the node operator fee.
For more configuration properties, check Configuring node properties — Symbol Documentation

Use the following command to create and open the custom.yml:

vim custom.yml

Press i to change to insert mode.
Paste your config, for example:

nodes:
    - friendlyName: 'MySymbolNode'
      host: 123.123.123.123
      beneficiaryAddress: NBUTOBVT5JQDCV6UEPCPFHWWOAOPOCLA5AY5FLI

Close insert mode with Esc and save the file with:

:wq

Now we are finally ready to run symbol-bootstrap with custom.yml for the first time!
To do so, use the following command:

symbol-bootstrap start -p mainnet -a dual -c custom.yml
[enter password]

enter a strong password, this password will be used to encypt files on your node, including the private keys of the node accounts

Let it run for 2-3 minutes, then stop it by pressing ctrl + c.

Before we run it again, we want to save our node accounts (including private keys).
To do so, decrypt the addresses.yml file with the following command:

symbol-bootstrap decrypt  --source target/addresses.yml --destination plain-addresses.yml
[enter the password you have just used to encrypt the files]

This will create a new file plain-addresses.yml which is readable.
Open the plain-addresses.yml with following command:

vim plain-addresses.yml

Write down the privatekeys of every account, you can use them to restore the accounts in case you have to.
After you have all information written down, close it with following command:

:q

We are going to remove this file from the server with following command:

rm plain-addresses.yml

We are not going to cover howto setup harvesting in this guide as it would push the boundaries. To activate remote harvesting, please follow Activating remote harvesting — Symbol Documentation

Running the node

After installation and configuration you are ready to run your node
Use following command:

symbol-bootstrap start -p mainnet -a dual -c custom.yml -d
[enter the password you have used to encrypt the files]

-p mainnet states that we are using the mainnet
-a dual states that we are running a dual (peer and API) node
-c custom states that we are using a custom configuration file
-d detached mode, symbol bootstrap will run it the background
To get a full list of different presets, check Using Symbol Bootstrap — Symbol Documentation

Validate the setup

Connect to your node via web, check that the following URLs return valid data.

http://YourNodesIP:3000/node/info for node health.

http://YourNodesIP:3000/chain/info for node connection to the mainnet.

Updateing symbol-bootstrap

To update the version of symbol-bootstrap, use following commands:

symbol-bootstrap stop
cp -r target target_backup
sudo npm install -g symbol-bootstrap
symbol-bootstrap start -p mainnet -a dual -c custom.yml --upgrade -d

Check the version by running:

symbol-bootstrap --help

If update was successfull, remove backup of target folder:

rm target_backup

Useful commands

To stop your node use:

symbol-bootstrap stop

To check if symbol-bootstrap runs without problems use:

symbol-bootstrap healthCheck

To update your config, use:
(it’s recommended to backup the target folder before you do this)

(edit your custom.yml config file)

symbol-bootstrap stop
symbol-bootstrap start -p mainnet -a dual -c custom.yml --upgrade  -d

To start fresh with symbol-bootstrap, for example if you experience problems with the config, use following commands:

symbol-bootstrap stop
docker system prune -a
sudo rm -r target

Selecting your node for harvesting in the desktop wallet

At the time of writing, the symbol desktop wallet doesnt let you enter custom node’s for harvesting. I guess this will be corrected in a newer release, until then, there is a workaround.

The wallet generates the harvesting node list based on peer’s of the node to which the wallet is connected to. To be able to see your own node in the list, you have to connect the wallet to a peer of your node.

Your account needs an importance score of > 0 to activate harvesting. You can check the importance score in the wallet or blockexplorer. When you send XYM to a new acount it needs about 12h to get importance.

  1. Open http://YourNodesIP:3000/node/peers in a webbrowser.
  2. Write down any of the peers.
  3. Open the symbol desktop wallet, login to the profile with your harvesting account.
  4. Go to wallet settings in the top right corner.
  5. Go to network settings and add the peer node from step 2 in “Node Url” field and press the “add node” button.
  6. After adding, close the settings, click on “Node” in the left bottom and choose the peer node we have just added in step 5.
  7. Close the wallet, open it again and login to your profile with the harvesting account again.
  8. Go to harvesting, your node should now appear in the “Node Url” list.
  9. Press “Link all keys” on the bottom, once done, activate it.
  10. Done
11 Likes

Hi,

Just a question about the beneficiaryAddress:

Is this just an example? It seems that for literally every block harvested funds are going to that account:

http://explorer.symbolblockchain.io/accounts/NBUTOBVT5JQDCV6UEPCPFHWWOAOPOCLA5AY5FLI

Seems that this should be going to an account of the node owners choosing:

What is the account and who owns it? Is it a case of everyone using a default config or is this account somehow special?

Sorry if this is a stupid question - I noticed that the block I harvested on my own Allnodes node sent a share to NBUTOBVT5JQDCV6UEPCPFHWWOAOPOCLA5AY5FLI but I didn’t know why :slight_smile:

Hey SJM211,

NBUTOBVT5JQDCV6UEPCPFHWWOAOPOCLA5AY5FLI is the network sink account which collects fee’s for voting nodes (and probably other rewards too).

i just set it as example so you know how the file have to look. for your own node you have to set your own account

5% of every block goes to this account, thats why you see it on each block :slight_smile:

2 Likes

Ah great - I thought it must be some kind of special account but I couldn’t find this information anywhere. Thanks! :slight_smile:

1 Like

Hi, are you using dedicated instances, or are you running your own server?
I am trying to see what is the most economical way of running a node or a supernode

I see there are new nodes running 1.0.1.0 version so I did:

npm install -g symbol-bootstrap
symbol-bootstrap stop
symbol-bootstrap config -p mainnet -a dual -c custom.yml --upgrade
symbol-bootstrap compose --upgrade
symbol-bootstrap run -d

symbol-bootstrap is now updated but it’s still using the old version of the containers.

Thanks, @spizzerb, great guide! Especially around how to setup the Linux users and install the right versions.

One comment, from v 1.0.1, the beneficiaryAddress will be filled automatically with the node’s main account address, you don’t need to add it to the custom preset.

1 Like

thanks!

good to know :slight_smile:

i will not change it in the guide though, if someone wants to add a different account instead of the main account they know how to do it

hey, i use VPS from netcup and hetzner with dedicated CPU cores

didnt notice there was an update yet :slight_smile: i guess it will soon be available over symbol-bootstrap too

will add it to the guide as soon as i installed it on my nodes

Hi spizzerb, many thanks to your “Dual node Centos guide”, I successfully made a node in (Fedora) docker and everything looks fine (under the URL http://node:3000/chain/info I see appropriate block height, etc.).

I just like to interconnect this node with my account (and also like to start harvesting thru the wallet client). I suppose it’s necessary to do in Settings → Network Settings . But I see there “List of nodes (35)”, one of them (ngl-dual-002…) has been automatically selected during the Wallet start. I’m able to write down my own node into “Node Url” row, but button “Add node” is still gray after that. And also, it’s impossible to change “Network Type” and “Generation Hash” rows. Impossible as well, is setting my node in “Harvesting” section (after “Link” click by “Node public key” warning “Invalid node” is displaying). Doing I’m wrong something ? Is necessary to set up something special/additional on server/node side ? I tested both Linux desktop and univerzal (web) version of the (1.0.0 version) wallets, issue appears in both. Thanks again!

Somebody is describing similar issue (in Mac desktop wallet) here ::

Hey @spizzerb, thanks a ton for this guide!

Truth is, at NEM we don’t have the headcount required to update the official docs with every Linux distro, so we need to rely on community efforts like yours.

Is it OK if we link to this forum post from the official guides?

4 Likes

you are welcome :slight_smile:

yes, you can link to it. i will try to keep it up to date

1 Like

Hey KloNEM,

Happy to hear that your node is up and running :+1:

Currently the wallet doesnt let you input custom nodes for harvesting, i think this is some kind of a bug in current version. I guess we will see an updated version soon.

i currently dont have much time but there is a workaround. will post it later or tomorrow.

I have a little text box for you at the top of the page :slight_smile:

https://docs.symbolplatform.com/guides/network/running-a-symbol-node.html

1 Like

just added following part to my guide:

Selecting your node for harvesting in the desktop wallet

At the time of writing, the symbol desktop wallet doesnt let you enter custom node’s for harvesting. I guess this will be corrected in a newer release, until then, there is a workaround.

The wallet generates the harvesting node list based on peer’s of the node to which the wallet is connected to. To be able to see your own node in the list, you have to connect the wallet to a peer of your node.

  1. Open http://YourNodesIP:3000/node/peers in a webbrowser.
  2. Write down any of the peers.
  3. Open the symbol desktop wallet, login to the profile with your harvesting account.
  4. Go to wallet settings in the top right corner.
  5. Go to network settings and add the peer node from step 2 in “Node Url” field and press the “add node” button.
  6. After adding, close the settings, click on “Node” in the left bottom and choose the peer node we have just added in step 5.
  7. Close the wallet, open it again and login to your profile with the harvesting account again.
  8. Go to harvesting, your node should now appear in the “Node Url” list.
  9. Press “Link all keys” on the bottom, once done, activate it.
  10. Done
4 Likes

Based on experiences to start harvesting with new accounts, it seems to be best to verify first that your importance is (re)calculated so it has a value above 0, before submitting the ‘Link keys’ and/or the ‘Activate’ transaction(s).
That last one to activate does not seem to have an effect with importance 0, leaving the Harvesting screen in the desktop wallet in a yellow “ACTIVATION IN PROGRESS” state.
If that happens wait for a positive importance, stop harvesting, link the node of your choice again and re-activate harvesting. That seems to solve it.

2 Likes

Thanks spizzerb for your hint! Unfortunately, I’m stuck at point 5), as I’m still not able to add peer node into the Node Url (even if I have non-zero balance account) or more precisely: I’m able to input node into Node Url row, but it’s impossible to push “Add node” button then. Probably something is broken in 1.0.0 version and hopefully it will be fixed soon.

Anyway, I tried to make another workaround; use `symbol-bootstrap link’ under the docker-node environment. It gave me ::

2021-03-24T16:34:45.320Z info Password has been provided
2021-03-24T16:34:45.986Z info Linking nodes
2021-03-24T16:34:46.019Z info Connecting to node http://localhost:3000
2021-03-24T16:34:46.221Z info Node’s minFeeMultiplier is 100
2021-03-24T16:34:46.239Z error Node signing account NB5… is not valid.

Does your node signing address have any network coin? Send some tokens to NB5… .

I suppose I should send some XYMs into this “my docker-node account” and linking process will be successful then. But, question is - how should I say to my node, that it’d harvest with my main account (with some Importance score, amount of coins, etc.) in my Symbol wallet ? Is it enough to put this account into “beneficiaryAddress” row in the `custom.yml’ file ?

Thanks for your co-operation again! I really appreciate it (and not just me, I hope :slight_smile: ) …

Did you check your main NB5… account in the desktop wallet?
It could be one of those mnemonic derived Opt-In Seed account’s calculated with an old method… It depends on when you did the Opt-In.
I had one of those accounts (see screenshot) and experienced problems setting up a node and linking keys with it.

I don’t know if that is your problem as well, but you could check to eliminate that possibility.