Full node build

Set profile

Different people use different profiles in there environments. It's likely that by default you use .profile. You may also use something like .bashrc, or .zshrc. In your HOME directory type "ls -la" and look for one of these two. To see which shell you are running when the shell is opened you can add an echo statement to these files and see which one prints when you open your terminal.

In ~/.bashrc:

echo "This is .bashrc"

In ~/.zshrc:

echo "This is .zshrc"

In ~/.profile:

echo "This is .profile"

Set your profile variable here with whatever itialization file is printed upon opening your terminal shell:

export PROFILE_FILE=".profile"

Install Go

VERSION=1.21.7
wget -O go.tar.gz https://go.dev/dl/go$VERSION.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz
echo 'export GOROOT=/usr/local/go' >> "$PROFILE_FILE"
echo 'export GOPATH=$HOME/go' >> "$PROFILE_FILE"
echo 'export GO111MODULE=on' >> "$PROFILE_FILE"
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> "$PROFILE_FILE"
source "$PROFILE_FILE"
go version

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 
source $HOME/.cargo/env

Install CometBFT

cd $HOME
mkdir cometbft
wget https://github.com/cometbft/cometbft/releases/download/v0.37.2/cometbft_0.37.2_linux_amd64.tar.gz
tar xvf cometbft_0.37.2_linux_amd64.tar.gz -C ./cometbft
chmod +x cometbft/cometbft
sudo mv cometbft/cometbft /usr/local/bin/
rm -rf cometbft*

In order to check that the installation was successful, you can run the following command

cometbft version

Which should output something like:

0.37.2

Install Node

Install the current version of node binary.

USER="<YOUR USERNAME HERE>"
OPERATING_SYSTEM="Linux" # or "Darwin" for MacOS

latest_release_url=$(curl -s "https://api.github.com/repos/anoma/namada/releases/latest" | grep "browser_download_url" | cut -d '"' -f 4 | grep "$OPERATING_SYSTEM")
wget "$latest_release_url"
tar -xzvf namada-v0.31.5-Linux-x86_64.tar.gz
cd namada-v0.31.5-Linux-x86_64
sudo cp namada* /home/$USER/.cargo/bin/

In order to check that the installation was successful, you can run the following command

namada --version

Which should output something like:

Namada v0.31.0

Join the network as pre-genesis validator:

Once the chain-id has been distributed, it is possible to join the network with the CHAIN_ID:

export CHAIN_ID="shielded-expedition.88f17d1d14" ## (replace with the actual chain-id)  
export ALIAS="<ENTER YOU ALIAS HERE>" ## (replace with the actual chain-id)  
namada client utils join-network --chain-id $CHAIN_ID --genesis-validator $ALIAS

Join the network as post-genesis validator:

Once the chain-id has been distributed, it is possible to join the network with the CHAIN_ID:

  export CHAIN_ID="shielded-expedition.88f17d1d14" ## (replace with the actual chain-id)  
  namada client utils join-network --chain-id $CHAIN_ID 

***********IMPORTANT NOTE**************

: /home/$USER/.local/share/namada/shielded-expedition.b40d8e9055/cometbft/config/priv_validator_key.json

Running namada as a systemd service

The below assumes you have installed namada from source, with make install. It at least assumes the respective binaries are in /home/user/.cargo/bin/namada.

which namada ## (should return /home/user/.cargo/bin/namada)

The below makes a service file for systemd, which will run namada as a service. This is useful for running a node in the background, and also for auto-restarting the node if it crashes.

sudo nano /etc/systemd/system/namadad.service
[Unit]
Description=namada
After=network-online.target

[Service]
User=$USER
WorkingDirectory=/home/$USER/.cargo/bin
ExecStart=/home/$USER/.cargo/bin/namada node ledger run
Restart=always
RestartSec=10
ExecStartPre=-/usr/bin/rm -rf /home/$USER/.local/share/namada/shielded-expedition.88f17d1d14/tx_wasm_cache /home/$USER/.local/share/namada/shielded-expedition.88f17d1d14/vp_wasm_cache
Environment="CMT_LOG_LEVEL=p2p:none,pex:error"
Environment="RUST_BACKTRACE=full"
Environment="COLORBT_SHOW_HIDDEN=1"
Environment="NAMADA_CMT_STDOUT=true"
Environment="NAMADA_LOG_COLOR=true"
Environment="NAMADA_LOG_FMT=pretty"
Environment="NAMADA_LOG_ROLLING=daily"
Environment="CHAIN_ID=shielded-expedition.88f17d1d14"
Environment="VALIDATOR_ALIAS=VALIDATOR_ALIAS"
StandardOutput=journal
StandardError=journal
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

Enable the service with the below commands:

sudo systemctl daemon-reload
sudo systemctl enable namadad

Now you can manage the node through systemd commands:

  • Run the node

sudo systemctl start namadad
  • Stop the node

sudo systemctl stop namadad
  • Restart the node

sudo systemctl restart namadad
  • Show node logs

sudo journalctl -u namadad -f -o cat

Using a wallet from the namada extension

KEY_ALIAS="<ENTER YOUR KEY ALIAS HERE>"
namada wallet derive --alias $ALIAS --hd-path default --unsafe-dont-encrypt

Initializing a new validator account

The user must first generate a key pair for their validator account.

KEY_ALIAS="aliace"
namada wallet key gen --alias $KEY_ALIAS

Now choose a name for your validator:

export VALIDATOR_ALIAS="<your-validator-name>"
export EMAIL="<your-validator-email-for-communication>"

Request tokens from faucet

Go to https://faucet.heliax.click/ and input address

Initiate Validator

A validator account requires additional keys compared to a user account, so start by initializing a validator account:

namada client init-validator \
  --alias $VALIDATOR_ALIAS \  
  --signing-keys $KEY_ALIAS \  
  --commission-rate .1 \  
  --max-commission-rate-change .01

It is also possible to convert an established account to a validator account:

namada client become-validator \  
--address $ESTABLISHED_ACCOUNT_ADDRESS \  
--signing-keys $KEY_ALIAS \  
--commission-rate <enter-your-commission-rate> \  
--max-commission-rate-change <enter-decimal-rate> \  
--email $EMAIL

The validator account will now have the same alias as the established account.

When initializing a validator account, it is also mandatory to specify both the commission-rate charged by the validator for delegation rewards (in decimal format) as well as the maximum-commission-rate-change per epoch in the commission-rate. Both are expressed as a decimal between 0 and 1. The standard for mainnet will be set by social consensus, but for testnets, the standard has been 0.01 and 0.05, respectively.

This command will generate the keys required for running a validator:

  • Consensus key, which is used in signing blocks in CometBFT(opens in a new tab).

  • Validator account key for signing transactions on the validator account, such as token self-bonding, unbonding and withdrawal, validator keys, validity predicate, state and metadata updates.

Then, it submits a transaction to the ledger that generates the new validator account with established address, which can be used to receive new delegations.

The keys and the alias of the address will be saved in your wallet.

Bond tokens to your validator

namada client bond \
 --source "${KEY_NAME}" \
 --validator "${VAL_NAME}" \
 --amount 1000

*Notes on node crashes:

  1. When your node crashes with a stack overflow, you must kill the cometbft process manually. For example find the process id with ps aux | grep cometbft and then run kill -9 <pid>

  2. Then increase the file limit with ulimit -s 65520 and restart the node.

  3. You don't need to delete your DB directory.

Last updated

Logo

Made with ❤️ by WhisperNode // © 2024.