⚙️Initial Node Configuration

Setup

You should pay attention to the following guides on how to manually setup your Egochain Node.

REQUIREMENTS

Before starting, make sure you read the Requirement section to ensure your hardware client meets the necessary requirements.

Install the software packages required for compilation

apt update 
apt install ca-certificates curl gnupg lsb-release make gcc git jq wget -y

Install Go

wget https://golang.org/dl/go1.22.2.linux-amd64.tar.gz

rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz

rm -f go1.22.2.linux-amd64.tar.gz

 echo 'export PATH=$PATH:/usr/local/go/bin' >> .bashrc

echo 'export GOPATH=$(go env GOPATH)' >> .bashrc

echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> .bashrc

source .bashrc

View go version

go version

The output should be: go version go1.22.2 linux/amd64

Compiling and installing Egochain

mkdir egochain && cd egochain

 git clone https://github.com/EgorasMarket/Egochain-Blockchain.git .

make install


egaxd version

If the software is installed successfully, the output should be: 5c20649b

Configuring chain ID

egaxd config chain-id egax_5439-1

Initialising Node

To commence, we must initialise the node to generate all essential validator and node configuration files.

egaxd init awsvalidator9 --chain-id egax_5439-1

Please be advised that the validator name is limited to ASCII characters exclusively.

The init command typically generates the config and data folders within ~/.egaxd (i.e., $HOME) by default. Among these, the app.toml and config.toml files in the config directory are the most crucial for configuration purposes.

Note, you could specify --home to overwrite the default work directory.

Getting the genesis file and seed

Setting up Genesis

To connect to an existing network, or start a new one, a genesis file is required.

Verify the genesis.json file available at this link and transfer it to the config directory: $HOME/.egaxd/config/genesis.json. This file contains genesis details such as the chain ID and balances of genesis accounts.

sudo apt install -y unzip wget

wget -O ~/.egaxd/config/genesis.json https://www.genesis.egochain.org/genesis.json

Then verify the correctness of the genesis configuration file:

egaxd validate-genesis

Setting up Seed

A seed node is a node who relays the addresses of other peers which they know of. These nodes constantly crawl in the network to try to reach more peers. The addresses which the seed node relays, get saved into a local address book. Once these addresses are in the address book, you will connect to those addresses directly.

Now, you should tell your node how to connect with other nodes that are already existing on the network.

In order to do so, you will use the seeds and persistent_peers values of the $HOME/.egaxd/config/config.toml file. file.

To ensure your node can connect with other peers, it's crucial to include robust seed nodes in the

sudo nano $HOME/.egaxd/config/config.toml 

Keep scrolling until you locate the sections labeled seeds = "" and persistent_peers = "" .

Replace it with the following value respectively.

persistent_peers = "82542e294657a27262911a1f30b6ab40f11a6b59@24.144.93.20:26656"

seeds = "82542e294657a27262911a1f30b6ab40f11a6b59@24.144.93.20:26656"

Include the node in the system service

echo "[Unit]
Description=Egaxd Node
After=network.target
#
[Service]
User=$USER
Type=simple
ExecStart=$(which egaxd) start
Restart=on-failure
LimitNOFILE=65535
#
[Install]
WantedBy=multi-user.target" > $HOME/egaxd.service; sudo mv $HOME/egaxd.service /etc/systemd/system/

sudo systemctl enable egaxd.service && sudo systemctl daemon-reload

Starting the node

Begin the node and synchronise it to the latest block height, which is 1246864 at the time of writing. Keep in mind that the initial synchronisation may take a longer time to complete and also check egoscan.io for the latest block height.

systemctl start egaxd 

Check logs

journalctl -u egaxd -f

Once the node is fully synchronised with the network, open your JSON-RPC ports 4590 and 4591. Port 4591 is for your WebSocket connection.

Setting up your firewall

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 4590 proto tcp
sudo ufw allow from any to any port 4591 proto tcp

# enable ufw
sudo ufw enable


# check ufw is running
sudo ufw status

Congratulations! You've successfully connected your node to the network. For detailed API documentation, please follow this link.

Your web socket URL is: http://youripaddress:4591, and the HTTP address is http://youripaddress:4590.

Switching off State Sync

Use this command to switch off your State Sync mode, after node fully synced to avoid problems in future node restarts!

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1false|" $HOME/.egaxd/config/config.toml

Check node status

The node should connect to the peers and start syncing. You can check the status of the node by executing:

egaxd status | jq

After your node is fully synced, you can consider running your node as a validator node.

Last updated