Running a Node

The steps to successfully run a node on the Andromeda chain.

Install Prerequisites

sudo apt-get update && sudo apt upgrade -y
sudo apt-get install make build-essential git jq chrony -y
sudo apt install gcc

Increasing the default open files limit

This is to make sure that the nodes won't crash once the network grows larger and larger.

sudo su -c "echo 'fs.file-max = 65536' >> /etc/sysctl.conf"
sudo sysctl -p

Installing Go 1.20.x

You can find GoLang 1.20.x from here.

Updating Environment Variables

cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export GOBIN=$HOME/go/bin
export PATH=$PATH:/usr/local/go/bin:$GOBIN
EOF
source $HOME/.profile

Next we need to clone the source repo:

git clone https://github.com/andromedaprotocol/andromedad.git
cd andromedad
make install

Initialize the Config Files

andromedad init <MONIKER> --chain-id andromeda-1
andromedad config chain-id andromeda-1

Now, your node environment should be ready to go! In order to sync up to the network, a few more parameters must be changed to proper specifics for the network:

cd ~/.andromeda/config/

Create new keys, or import existing wallet with BEP32 mnenomic phrase:

andromedad keys add <KEY_NAME> --keyring-backend os

To recover existing wallet:

andromedad keys add <KEY_NAME> --keyring-backend os --recover

`gentx` Command

To generate your validators transaction (gentx) use the following command:

andromedad genesis gentx <WALLET> 100000000000uandr --chain-id andromeda-1

Then submit a pull request to the mainnet repo where you found the genesis.json

Create environment Variable:

MY_VALIDATOR_ADDRESS=$(andromedad keys show <KEY_NAME> -a --keyring-backend os)

Setting up persistent peers in config.toml

Add Persistent Peers to config.toml:

vim config.toml

Now connect to some peers nodes by setting persistent_peers.

Example

persistent_peers = "e4c2267b90c7cfbb45090ab7647dc01df97f58f9@andromeda-m.peer.stavr.tech:4376,258f523c96efde50d5fe0a9faeea8a3e83be22ca@seed.andromeda-1.andromeda.aviaone.com:1028"

Copy Genesis File:

git clone https://github.com/andromedaprotocol/mainnet
cd mainnet
cp genesis.json $HOME/.andromeda/config/

Starting the Network

andromedad start

Your node should now be catching up to the current state of the network!

Create Validator Command

andromedad tx staking create-validator \
  --amount=1000000 uandr \
  --pubkey=$(andromedad tendermint show-validator) \
  --moniker=<MONIKER> \
  --chain-id=andromeda-1 \
  --commission-rate="0.05" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1" \
  --gas="700000" \
  --from=<KEY_NAME>

Replace <MONIKER> and <KEY_NAME> above.

Setup andromedad systemd service (copy and paste all to create the file service)

Enable and activate the andromedad service.

sudo nano /etc/systemd/system/andromedad.service && sudo touch /etc/systemd/system/andromedad.service 

Insert content into andromedad.service:

[Unit]
Description=Andromeda Node
After=network-online.target

[Service]
User=root
ExecStart=/root/go/bin/andromedad start
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

Move file to systemd folder:

sudo mv /etc/systemd/system/andromedad.service /lib/systemd/system/
sudo systemctl enable andromedad.service && sudo systemctl start andromedad.service

Check info about node:

curl -s localhost:26657/status  | jq .result.sync_info.catching_up
#true output is syncing - false is synced
curl -s localhost:26657/status | jq .result.sync_info.latest_block_height
#this output is your last block synced
curl -s "http://:26657/status?"  | jq .result.sync_info.latest_block_height
#this output the public node last block synced

Was this helpful?