ORAI CHAIN

New Validator Node Setup on Oraichain using Statesync 

Latest Version Information

Fetching latest version...

Step 1: Install necessary updates

This setup is focused on Normal User with Sudo Privilages  


sudo apt update && sudo apt upgrade -y
sudo apt install git curl wget tar lz4 unzip jq build-essential pkg-config clang bsdmainutils make ncdu -y
        
    

Step 2: Install Go

Login into USER & Install Go programming language. If installed successfully, go version will be shown

cd
version="1.22.1"
wget "https://golang.org/dl/go$version.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$version.linux-amd64.tar.gz"
rm "go$version.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

go version
        
    

Step 3: Install and configure Oraichain

Git Clone Oraichain to Install and configure Oraichain

cd
git clone https://github.com/oraichain/orai orai
cd orai
git checkout v0.42.3
cd orai
go mod tidy
make install
        
    

Step 4: Initialize Oraichain node

Initialize Oraichain node with your own NodeName  and get the genesis file from the official Oraichain website

cd
oraid init NodeName --chain-id Oraichain
wget -O $HOME/.oraid/config/genesis.json "https://raw.githubusercontent.com/oraichain/oraichain-static-files/master/genesis.json"
        
    

Step 5: Provide seed node  

Configure Oraichain seed node

SEEDS="e18f82a6da3a9842fa55769955d694f62f7f48bd@seed1.orai.zone:26656,893f246ffdffae0a9ef127941379303531f50d5c@seed2.orai.zone:26656,4fa7895fc43f618b53cd314585b421ee47b75639@seed3.orai.zone:26656,defeea41a01b5afdb79ef2af155866e122797a9c@seed4.orai.zone:26656"
sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" $HOME/.oraid/config/config.toml

        
    

Step 6: Setup systemd service

Setup systemd service for Oraichain:

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

Paste following in oraid.service file, ensure to replace USER with your operating system's user name. Save it.

[Unit]
Description=Oraid Daemon
#After=network.target
StartLimitInterval=350
StartLimitBurst=10

[Service]
Type=simple
User=USER
ExecStart=/home/USER/go/bin/oraid start --home /home/USER/.oraid
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target

[Service]
LimitNOFILE=1048576
        
    

Step 7: Apply StateSync

Following script will apply statesync settings.

sudo bash -c "cat > $HOME/ss.sh <<'EOF'

SNAP_RPC=\"https://orai-rpc.imdev.app:443\"
LATEST_HEIGHT=\$(curl -s \$SNAP_RPC/block | jq -r .result.block.header.height)
BLOCK_HEIGHT=\$((LATEST_HEIGHT - 2000))
TRUST_HASH=\$(curl -s \"\$SNAP_RPC/block?height=\$BLOCK_HEIGHT\" | jq -r .result.block_id.hash)
echo \$LATEST_HEIGHT \$BLOCK_HEIGHT \$TRUST_HASH

sed -i.bak -E \"s|^(enable[[:space:]]+=[[:space:]]+).*$|\\1true| ; \\
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\\1\\\"\$SNAP_RPC,\$SNAP_RPC\\\"| ; \\
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\\1\$BLOCK_HEIGHT| ; \\
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\\1\\\"\$TRUST_HASH\\\"|\" \$HOME/.oraid/config/config.toml

grep 'rpc_servers\\|trust_height\\|trust_hash' \$HOME/.oraid/config/config.toml
EOF"

sudo chmod +x ss.sh

./ss.sh

        
    

Step 8: Start and enable the service

Start and Enable the service so that it always starts on boot & on failure   

sudo systemctl daemon-reload
sudo systemctl restart systemd-journald
sudo systemctl start oraid
sudo systemctl enable oraid
journalctl -fu oraid
        
    

Info

We prioritize blockchain above everything. Stake with us and get good passive income.