[draft draft][Validation] How to set up an evmos node from scratch

Windpowerstake
6 min readJul 15, 2023
Black Hole Messier 87. Event Horizon Telescope. CC-BY 4.0. Author European Southern Observatory.

Evmos is the EVM-hub in the Cosmos.

With this post I’ll try to reproduce how to set up an evmos node.

Preparing a node

Get a new Linux machine with at least 32GB RAM, a decent speed hard drive (NVMe for the better). CPU shall be modern.

In this case Ubuntu 22.04 LTS will be used. We recommend always to use the last possible Ubuntu LTS version with all security patches up to date.

Small consideration about Archive

In terms of space, if a user wants to store all blocks, catching up might take up to 10TB (to at least v13).

this is our data for *zipped* data folders only you can assume the deploy will take 1.4 times more for safety.

However, if you are running a bare metal machine, you can start up from a fast 4TB nvme drive that you can easily find on the market (we recommend WD SN850x), and then transfer it to bigger drives (slower, and more expensive at today’s state of the art).

Archive nodes need to do a modification (below) on the [app.toml] file (see below) before starting.

Considerations about security of your machine

Regardless of the service you use to set up the node, please avoid running as root (if you plain execute whoami in the terminal and the response is ‘root’, you are running as root. Avoid it by creating a user with sudo role, -bis-).

Starting & updating

#Update your OS to the latest software
sudo apt update
sudo apt upgrade

Additional packages to be installed in order to follow this doc:

#Installing git,
#build-essential for compiling
#ufw for the firewall
#curl for downloading
#jq for json files
#snapd in order to install go
sudo apt install git build-essential ufw curl jq snapd --yes# Install Go
sudo snap install go --classic

Proceed to set up the environment variables

# Export environment variables
echo 'export GOPATH="$HOME/go"' >> ~/.profile
echo 'export GOBIN="$GOPATH/bin"' >> ~/.profile
echo 'export PATH="$GOBIN:$PATH"' >> ~/.profile
source ~/.profile

Setting up ufw

Setting firewall.

# running this should show it is inactive
sudo ufw status
# Turn on ssh *if you need it*
sudo ufw allow ssh
# Accept connections to port 26656 from any address
sudo ufw allow from any to any port 26656 proto tcp
# enable ufw
sudo ufw enable
# check ufw is running
sudo ufw status

Getting the evmos repo

Downloading the evmos repo and build evmos_9000–2 first version:

git clone https://github.com/evmos/evmos

going to the repo and installing last version (check if there’s an update)

cd evmos
git checkout v3.0.2
make install

please check your version with:

evmosd version

should return v3.0.2

Now you can make an init. This init will just set up a folder with all needed stuff to run a generic evmos node (that does not contain data about the genesis, therefore in cannot run yet).

evmosd init "WriteaNameForThisNode" --chain-id evmos_9001-2

this will make a default init to the folder ~/.evmosd

Configuring genesis and peers

Get the evmos genesis

rm ~/.evmosd/config/genesis.json
wget http://45.152.13.148:8083/evmos_genesis.json.tar.gz
tar -xzf evmos_genesis.json.tar.gz -C ~/.evmosd/config

Verify the genesis shasum:

jq -S -c -M '' ~/.evmosd/config/genesis.json | sha256sum
# should return
# f5553811376ab3cde025a252f0e4d917136aae918718c3fbc71b5034104167b7 -

Peers

nano ~/.evmosd/config/config.toml

In line 215 of config.toml you’ll find a blank list of persistent peers.

Replace the empty string, introducing the following

persistent_peers = "6efc68b5e07afb8f5d7606dd83c07c841b6f9d5a@65.21.202.154:26656,b3b34199c9577feb67d60f06a0d19633c015dd41@65.108.239.142:26656"

Then press Ctrl + X in order to prompt the exit message, and say ‘Y’ in order to save the changes made in nano.

(Polkachu Live Peers service, thanks!)

Archive nodes (Only if you want to run an archive node)

In order to store all blocks you’ll need to modify the app.toml file in order to avoid pruning.

nano ~/.evmosd/config/app.toml

In line 17 of the app.toml, change the line from pruning default to pruning nothing:

pruning = "nothing"

Configuring an evmosd.service

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

The contents of this file (notice <your_user> written 3 times, which is your username for the node -your ubuntu login-, you’ll need to replace them):

[Unit]
Description=evmosd
After=network.target

[Service]
Type=simple
User=<your_user>
WorkingDirectory=/home/<your_user>
ExecStart=/home/<your_user>/go/bin/evmosd start
Restart=always
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

Once you are done, next step is enabling the service and start (!)

sudo systemctl enable evmosd
sudo systemctl daemon-reload
sudo systemctl start evmosd

You can track your progress anytime with:

journalctl -u evmosd -f

sudo systemctl start evmosd

Start from v3.0.2.

Starting block is already 58701. This is because we redid the genesis after a non-consensus halt. In fact the chain before this block has a different name, so they are in theory two different chains. There’s no point in setting up a node for block 1 to 58699, since it will never be able to catch up from that point.

v4.0.2:

Once your node arrives to halt height 257850, it will stop via halt height, and no-reset policy on the daemon (hopefully)

journalctl --unit=evmosd -n 100 --no-pager

This will look like this:

once the block is hit, your halt height has stopped the node.

go to the repo folder

sudo systemctl stop evmosd
cd evmos
git checkout v4.0.2
make install

please check your version with:

evmosd version

should return v4.0.2

and then start again the service

sudo systemctl start evmosd

ignore v5.

we skipped this version (was never used)

v.6.0.4

Once the block hits second voted upgrade (at block 1042000), this will look like this:

journalctl --unit=evmosd -n 100 --no-pager
Evmos automatically stops at block 1042000

go to the repo folder

sudo systemctl stop evmosd
cd evmos
git checkout v6.0.4
make install

please check your version with:

evmosd version

should return v6.0.4

Once you are ready, start again the process:

sudo systemctl start evmosd

You can track the restart by doing journal

journalctl -u evmosd -f

Will apply the upgrade and try to dial again.

Wait until it hits the halt height for v7 (2476000)

v7.0.0

Once your node arrives to the programmed halt height (2476000), it will stop automatically.

v8.1.1

Once your node arrives to block 4655500, it will request for v8.1.0, please go directly to v8.1.1, as this is non-breaking and will avoid problems with the next upgrade.

v8.2.0

this will require that you set iavl to false before the upgrade on the app.toml

your app.toml should look like this, if you don’t have this line, please add it at this point

v9, 10, 11, 12, 13

Will enter up via governance proposals, versions to be used are: v9.1.0, v10.0.1, v11.0.2 ,v12.1.5, v13.0.2

License:

CC-BY for all the contents (except for icons -CC-BY-SA-, as indicated on the header). Simple geometric figures are Public Domain.

Author: Windpowerstake. This work is licensed under a Creative Commons Attribution 4.0 International License..

--

--

Windpowerstake

We are a validator for several networks. We own our equipment and want to measure and report as much as we can. We use green electricity per contract.