How to setup your own node in a blink of an eye (Now support multi-nodes per host)

To avoid going off topic, I’ve just sent you a DM to help you with the app problem. Please continue there!

3 Likes

What distribution do you recommend? I hit some problems when doing this on a clean Ubuntu 20.04.2, thought I would share some pointers on the pre-requisites.

If you’re having problems, it’s a good idea to check the system logs. This is where problems with the update script will end up. /var/log/syslog

The first error I encountered is that curl does not come standard on a minimal Ubuntu install.

IncNodeUpdt[96239]: /bin/run_node.sh: line 58: curl: command not found

But that is easily fixed

sudo apt-get install curl

Next problem is that the automatic installation of docker does not work when launched from the service.

IncNodeUpdt[102230]: /bin/run_node.sh: line 27: docker: command not found
IncNodeUpdt[102233]: # Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2737
IncNodeUpdt[102249]: + sudo -E sh -c apt-get update -qq >/dev/null
IncNodeUpdt[102250]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

Pre-installing it manually fixes that problem (copied from the run_node.sh script)

bash -c "wget -qO- https://get.docker.com/ | sh"

May I suggest you add this to the inc_node_installer.sh script instead of the service run_node.sh script?

After that, it started running. Syncing from scratch now, yet again, to see if I hit more shard stalls.

Update: which it did, stalled on the same shard block as always

2 Likes

Thanks for the tip, I will add the wget and docker installation steps to the post here for the best.

1 Like

Turns out the defaults and instructions are wrong. In the top post here it says

GETH_PORT="80" # this should be left as default

Do not set GETH_PORT to 80 if you use infura.io.

Change row 36 to

GETH_PORT=""

or change GETH_NAME to a full URL (thanks @duc) instead with

GETH_NAME="https://mainnet.infura.io/v3/xxxyyy"
GETH_PROTOCOL=
GETH_PORT=

Please note that all three must be included in your docker run command, because if omitted, it will use the default protocol (http) and the default port (8545) and end up as http://https://mainnet.infura.io/v3/xxxyyy:8545

If GETH is not setup correctly, you might not notice it until it’s time for your node to be part of the committee, since syncing the beacon chain works without it.

2 Likes

Thanks for the tip. I’ve updated the instruction as suggested.

1 Like

I don’t see https://raw.githubusercontent.com/incognitochain/incognito-chain/production/bin/inc_node_installer.sh with the update to GETH_PORT=""

1 Like

The code is not yet merged. you will have to change it manually as in step 2 of the instruction (I updated the instruction).

What’s the command to wipe and re-sync the vnode since “sudo rm -rfv data” and “sudo bash run.sh” no longer work?

If you’re using the script above, the vNode is run under user incognito and the data is in its home folder. Try:

sudo rm -rf /home/incognito/node_data

You should first stop the vNode if it’s running and then restart it, unfortunately it’s not done by the service. Trying doing something like:

# Stop the update service
sudo systemctl stop IncognitoUpdater.service
# Stop and remove the running docker
sudo docker rm -f inc_mainnet
# Delete the cached latest tag
sudo rm /tmp/inc_node_latest_tag
# Remove all node data
sudo rm -rf /home/incognito/node_data
# Start the update service again and it will start the latest docker
sudo systemctl start IncognitoUpdater.service
1 Like

That was very helpful, exactly what I needed. Thank you!

1 Like

is this a correct return for the

sudo systemctl status IncognitoUpdater.service

Loaded: loaded (/etc/systemd/system/IncognitoUpdater.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2021-06-04 10:11:57 CEST; 16s ago
Process: 23551 ExecStart=/bin/run_node.sh (code=exited, status=0/SUCCESS)
Process: 23795 ExecStop=/usr/bin/pkill run_node.sh (code=exited, status=1/FAILURE)
Main PID: 23551 (code=exited, status=0/SUCCESS)

image

Yes, it is. Since the update checking process will only need a few seconds to complete its task then it will exist.
When the update interval comes, systemd will restart the process by first stop it with ExecStop=/usr/bin/pkill run_node.sh then start it up again.
But since the process completed and existed already, ExecStop action will return the error as you already saw.

1 Like

thanks, gotcha

could you refer to the "How to check if node sync and other necessary staff’ please. I don’t mean the monitoring tool - How to use the Node monitor. I mean if we can monitor nodes in terminal.

Sorry to be a pain, but you should throw in curl there as well, or remove curl from the update script and replace it with wget. As it is right now, on a fresh install, you’ll end up with this in your system log and nothing is started.

systemd[1]: Started IncognitoChain Node updater.
IncNodeUpdt[13196]: Getting Incognito docker tags
IncNodeUpdt[13199]: /bin/run_node.sh: line 57: curl: command not found
systemd[1]: IncognitoUpdater.service: Control process exited, code=exited, status=1/FAILURE

My bad, will include curl right now

2 Likes

Can one infura API be used for multiple nodes?

Yes, I use one API key for more than one node.

2 Likes

One Infura with free plan supports 100,000 Requests/Day. So yeah, you can use one Infura for more than one.

1 Like

After using the new script “sudo ./inc_node_installer.sh”, I see only “inc_mainnet” running after sudo docker ps. I no longer see “eth_mainnet” running in docker after using the new script. Is this correct? Can someone share a correct return value for “sudo docker ps” after running the ./inc_node_installer.sh script?

1 Like

hello! Eth_mainnet The command incognito does not use) infura)

  • On Setting tab of project, copy the mainnet endpoint api key
    image
    Eg. Copy this string be5fe1410b024a8f94f62fbc106439xx
    [/quote]
    How to host a Virtual Node