Loading

📚 Node installation

Update packages

sudo apt update && sudo apt upgrade -y

Install dependencies

sudo apt-get install -y make git-core libssl-dev pkg-config libclang-12-dev build-essential protobuf-compiler libudev-dev libprotobuf-dev

Install Go

cd $HOME && \
ver="{{goVersion}}" && \
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" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version

The output should be: go version go{{goVersion}} linux/amd64

Install Rust and Nodejs

sudo curl https://sh.rustup.rs -sSf | sh -s -- -y
. $HOME/.cargo/env
curl https://deb.nodesource.com/setup_18.x | sudo bash
sudo apt install nodejs -y

Download binary for work

cd $HOME
rm -rf namada
git clone {{binaryUrl}}
cd namada
git checkout {{nodeVersion}}
make build-release
sudo cp $HOME/namada/target/release/namada* /usr/local/bin/
namada --version

The output should be: Namada {{nodeVersion}}

cd $HOME
rm -rf cometbft
git clone https://github.com/cometbft/cometbft.git
cd cometbft
git checkout v0.37.11
make build
sudo cp $HOME/cometbft/build/cometbft /usr/local/bin/
cometbft version

The output should be: v0.37.11

Specify variables, for ease of work

echo 'export {{chainName}}_t_moniker="Validator_name"' >> $HOME/.bash_profile
echo 'export {{chainName}}_t_wallet="Wallet_name"' >> $HOME/.bash_profile
echo 'export {{chainName}}_t_port="111"' >> $HOME/.bash_profile
echo 'export NAMADA_NETWORK_CONFIGS_SERVER="https://github.com/anoma/namada-mainnet-genesis/releases/download/mainnet-genesis"' >> $HOME/.bash_profile
source $HOME/.bash_profile

Initialize the node

For genesis validator:
namada client utils join-network --chain-id {{chainId}} --genesis-validator $namada_t_moniker
For post-genesis validator:
namada client utils join-network --chain-id {{chainId}}
Add persistent peers and seed:
PEERS={{peersChain}}
sed -i.bak -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" ~/.{{dirName}}/{{chainId}}/config.toml
SEED=tcp://6b0ffcce9b59b91ceb8eea5d4599e27707e3604a@seeds.stakeup.tech:10224
sed -i.bak -e "s|^seeds =.*|seeds = \"$SEED\"|" ~/.{{dirName}}/{{chainId}}/config.toml

Optional Settings

Change port
cd $HOME/.{{dirName}}/{{chainId}} && \
sed -i.bak \
    -e "s/:\s*26656/:${{{chainName}}_t_port}56/g" \
    -e "s/:\s*26657/:${{{chainName}}_t_port}57/g" \
    -e "s/:\s*26658/:${{{chainName}}_t_port}58/g" \
    -e "s/:\s*26545/:${{{chainName}}_t_port}45/g" \
    -e "s/:\s*26660/:${{{chainName}}_t_port}59/g" \
    -e "s/:\s*8545/:${{{chainName}}_t_port}61/g" \
config.toml

Create a service file

sudo tee /etc/systemd/system/namada.service > /dev/null <<EOF
[Unit]
Description=namada
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.local/share/namada
Environment=TM_LOG_LEVEL=p2p:none,pex:error
Environment=NAMADA_CMT_STDOUT=true
ExecStart=$(which namada) ledger run 
StandardOutput=syslog
StandardError=syslog
Restart=always
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
              
sudo systemctl daemon-reload &&
sudo systemctl enable {{appName}} &&
sudo systemctl restart {{appName}} && sudo journalctl -u {{appName}} -f -o cat