Skip to main content

Installation

Minimum hardware requirement

4-8 Cores, 16G Ram, 500G NVME, Ubuntu 22.04 - 24.04

Installation of required packages

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Installation GO

cd ~
VER="1.23.4" # Make sure that this version does not broke any other apps you run!
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
go version

Downloading and installing node

cd $HOME && wget https://github.com/Bookings-cpu/nexarail/releases/download/v0.1.0-rc1-validator-recovery-hotfix/nexaraild-linux-amd64
chmod +x nexaraild-linux-amd64
mv nexaraild-linux-amd64 $HOME/go/bin/nexaraild
nexaraild version

Set node configuration

nexaraild init "NodeName" --chain-id nexarail-mainnet-1

sed -i.bak -e "s/^chain-id *=.*/chain-id = \"nexarail-mainnet-1\"/;" ~/.nexarail/config/client.toml
sed -i.bak -e "s/^keyring-backend *=.*/keyring-backend = \"file\"/;" ~/.nexarail/config/client.toml

Downloading genesis and addressbook

wget -O $HOME/.nexarail/config/genesis.json "https://github.com/Bookings-cpu/nexarail/releases/download/mainnet-genesis-nexarail-mainnet-1/genesis.json"
sha256sum ~/.nexarail/config/genesis.json
# f84f5f03d4d54945153c3f68e20e9864fc03c7f35dbeec2b40274f18d152db32
# Set seeds and peers and gas
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.025unxrl\"/;" ~/.nexarail/config/app.toml
external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.nexarail/config/config.toml
peers="00d72b25d01c9939974e6a10f99d39a8d9ddee40@nexarail-mainnet-peer.nodesync.top:26656,[email protected]:32656,[email protected]:60756"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.nexarail/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.nexarail/config/config.toml
sed -i -e "s/^filter_peers *=.*/filter_peers = \"true\"/" $HOME/.nexarail/config/config.toml

# Set indexer
indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.nexarail/config/config.toml

# Set pruning
pruning="custom"
pruning_keep_recent="100"
pruning_interval="50"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.nexarail/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.nexarail/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.nexarail/config/app.toml

# Change ports

echo "export PORT="42"" >> $HOME/.bash_profile
source $HOME/.bash_profile

sed -i -e "s%:26657%:${PORT}57%" $HOME/.nexarail/config/client.toml
sed -i -e "s%:26658%:${PORT}58%; s%:26657%:${PORT}57%; s%:6060%:${PORT}60%; s%:26656%:${PORT}56%; s%:26660%:${PORT}60%" $HOME/.nexarail/config/config.toml
sed -i -e "s%:1317%:${PORT}17%; s%:9090%:${PORT}90%; s%:8545%:${PORT}45%; s%:8546%:${PORT}46%; s%:6065%:${PORT}65%" $HOME/.nexarail/config/app.toml

# Download latest chain data snapshot

curl -o - -L https://snapshots.nodesync.top/Mainnet/NexaRail/nexarail_latest.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.nexarail

Creating service file

tee /etc/systemd/system/nexaraild.service > /dev/null <<EOF
[Unit]
Description=nexaraild
After=network-online.target

[Service]
User=$USER
ExecStart=$(which nexaraild) start --home $HOME/.nexarail
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable nexaraild

Start node

sudo systemctl start nexaraild && journalctl -u nexaraild -f -o cat