Skip to content

How to setup Activenode in Ubuntu 18.04

LocalCoin.is edited this page Jul 10, 2019 · 10 revisions

Preparations:

You should have:

  • an account
  • lifetime membership
  • min balance of 1000 llc
  • your public and private key (with active or owner permissions, not both). Public key you can find here https://wallet.localcoin.is/account/testnet-acc/permissions (in url you should use your username). Private key - unlock your wallet, and click on public key.

You must login as root (or sudo user) user to your server, and start terminal session.

Step 1. Installing soft, and getting localcoin node.

sudo apt-get update
sudo apt-get install -y htop zip unzip wget libcurl3 mc ncdu git nano
mkdir myactivenode
cd myactivenode
wget https://github.com/LocalCoinIS/LocalCoin-core/releases/download/1.0.1/Localcoin-Core-1.0.1-Linux.tgz
tar -xvzf Localcoin-Core-1.0.1-Linux.tgz
chmod +x cli_wallet delayed_node witness_node
./witness_node

You should see Localcoin start screen. Something like these:

1864405ms th_a       activenode.cpp:68             plugin_initialize    ] activenode plugin:  plugin_initialize() begin
1864412ms th_a       activenode.cpp:73             plugin_initialize    ] activenode-account field is empty! Please add activenode account to configuration
1864430ms th_a       activenode.cpp:101            plugin_initialize    ] activenode plugin:  plugin_initialize() end
1864435ms th_a       witness.cpp:87                plugin_initialize    ] witness plugin:  plugin_initialize() begin
1864446ms th_a       witness.cpp:115               plugin_initialize    ] witness plugin:  plugin_initialize() end
1873376ms th_a       object_database.cpp:111       open                 ] Done opening object database.
1873384ms th_a       db_management.cpp:59          reindex              ] reindexing blockchain
1873389ms th_a       db_management.cpp:65          reindex              ] Replaying blocks, starting at 4808372...
1873405ms th_a       db_management.cpp:122         reindex              ] Done reindexing, elapsed time: 0.01573600000000000 sec
1876827ms th_a       application.cpp:178           reset_p2p_node       ] Adding seed node 81.25.56.71:11020
1877121ms th_a       application.cpp:178           reset_p2p_node       ] Adding seed node 81.25.56.71:11020
1877164ms th_a       application.cpp:178           reset_p2p_node       ] Adding seed node 95.216.112.99:11020
1877172ms th_a       application.cpp:193           reset_p2p_node       ] Configured p2p node to listen on 0.0.0.0:11020
1877179ms th_a       application.cpp:271           reset_websocket_serv ] Configured websocket rpc to listen on 0.0.0.0:8090
1877185ms th_a       activenode.cpp:106            plugin_startup       ] activenode plugin:  plugin_startup() begin
1877189ms th_a       activenode.cpp:119            plugin_startup       ] activenode plugin:  plugin_startup() end
1877195ms th_a       witness.cpp:120               plugin_startup       ] witness plugin:  plugin_startup() begin
1877199ms th_a       witness.cpp:135               plugin_startup       ] No witnesses configured! Please add witness IDs and private keys to configuration.
1877207ms th_a       witness.cpp:136               plugin_startup       ] witness plugin:  plugin_startup() end
1877213ms th_a       main.cpp:269                  main                 ] Started LocalCoin node on a chain with 4808377 blocks.
1877217ms th_a       main.cpp:270                  main                 ] Chain ID is 806101b8d87a91c433796f536708924409d4a2161ece2e555ceb2960de76a2cc

Wait 5-10 sec before node start download blocks and exit pushing ctrl+c combination.

Step 2. Configure service.

Let's configure node service and autostart. Enter:

sudo nano /etc/systemd/system/llcnode.service

Should appear nano text editor, then input (check your username and user group, if it not root, make changes according your username)

[Unit]
Description=Graphene Witness Service
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/root/myactivenode
ExecStart=/root/myactivenode/witness_node --replay-blockchain

[Install]
WantedBy=multi-user.target

Press ctrl+O and ENTER to save changes. Press ctrl+X to quit editor. Start and enable service:

sudo systemctl start llcnode
sudo systemctl enable llcnode
sudo systemctl status llcnode

Then you should wait about 20 minutes, because your node must download blockchain. You can check status by entering

sudo systemctl status llcnode

If it shows something like

2625370ms th_a application.cpp:490 handle_block ] Got block: #4856341 time: 2019-06-13T11:43:44 latency: 1370 ms from: winstonsmith irreversible: 4856334 (-7)

Block number must be the same with numbers in your wallet.

Step 3. Create activenode account.

So your blockchain is ready, so let's create activenode account:

cd ~
cd myactivenode
./cli_wallet

After entering the cli_wallet you must create a wallet password and import your private keys, and then create activenode:

set_password 123456
unlock 123456
import_key username your_private_key
create_activenode username true

Import key command should look like:

import_key testnet-acc 5KQwrPJhBoxHEKJkjHJKHgjhMyUZ7ot6sWJ3tmmQt4yxtaW

If it's ok, you will see your username in https://llc.is/#/activenodes standby Activenodes list.

Now you need to update config.ini file and restart your node:

cd ~
cd myactivenode
nano witness_node_data_dir/config.ini

Find these lines and enter your data (name, public key and private key):

# Name of account that is an activenode
activenode-account = username

# Tuple of [PublicKey, WIF private key] (for account that will get rewards for being an activenode)
activenode-private-key = ["LLC6MRyAjQq8ud7hVNYcfnVPJqcVpscN5dfHGtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW3GfgDhjZ1JiwsST4cqQzDeyXtP79zkvFD3"]

Make sure you have deleted # before activenode-account.

Press ctrl+O and ENTER to save changes. Press ctrl+X to quit editor. Restart your service and check status:

sudo systemctl restart llcnode
sudo systemctl status llcnode

Your activenode will start mine next day.

Add crontab to resync your node twice a day

sudo crontab -e
0 */6 * * * sudo systemctl restart llcnode

Known issues

If your node in activelist https://llc.is/#/activenodes but % of missed activities = 100%, you node doesn't work properly. Check your config file (it should be only one copy of config.ini file!).

Bad config

You should contain "activenode-account" and "activenode-private-key". All other options leave by default.

Stop your node service, and run it manually.

sudo systemctl stop llcnode
cd ~
cd myactivenode
./witness_node

When node starts you can see details. If there is something wrong with your config file, check what it says.

For example: "activenode-account field is empty!"

Firewalled

If activenode starts without errors and warnings, check activenode screen.

When your node sent activitity you will see smth like:

activenode.cpp:227 send_activity activity sent.

If you see

send_activity ERROR: node is firewalled 0.0.0.0

check 8090 and 11020 for availability.