December 20, 2023

Namada node installation

Validator Requirements
Minimum Hardware Requirements to run Validator // 8GB RAM / 1TB SSD / 4 Cores //
Recommended Hardware Requirements to run Validator // 16GB RAM / 1TB SSD / 8 Cores
OS : Linux OS Ubuntu 22.04.3 LTS

18.12.2023 Upgrade to v0.28.1:

cd $HOME
rm -rf namada 
git clone https://github.com/anoma/namada 
cd namada
wget https://github.com/anoma/namada/releases/download/v0.28.1/namada-v0.28.1-Linux-x86_64.tar.gz
tar -xvf namada-v0.28.1-Linux-x86_64.tar.gz
rm namada-v0.28.1-Linux-x86_64.tar.gz
cd namada-v0.28.1-Linux-x86_64
sudo mv namada namadan namadac namadaw /usr/local/bin/
sudo systemctl restart namadad && sudo journalctl -u namadad -f

Update packages and Install dependencies:

sudo apt update && sudo apt upgrade -y
sudo apt-get install -y make curl zip git-core libssl-dev pkg-config libclang-12-dev build-essential protobuf-compiler

Install GO:

cd $HOME
! [ -x "$(command -v go)" ] && {
VER="1.20.3"
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

Install Rust:

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

Replace your Validator and Wallet name, save and import variables into system. Change default port if needed.

NAMADA_PORT=26
echo "export NAMADA_PORT="$NAMADA_PORT"" >> $HOME/.bash_profile
echo "export ALIAS="CHOOSE_A_NAME_FOR_YOUR_VALIDATOR"" >> $HOME/.bash_profile
echo "export WALLET="CHOOSE_A_WALLET_NAME"" >> $HOME/.bash_profile
echo "export PUBLIC_IP=$(wget -qO- eth0.me)" >> $HOME/.bash_profile
echo "export TM_HASH="v0.1.4-abciplus"" >> $HOME/.bash_profile
echo "export CHAIN_ID="public-testnet-15.0dacadb8d663"" >> $HOME/.bash_profile
echo "export BASE_DIR="$HOME/.local/share/namada"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Protocol Buffers:

cd $HOME
curl -L -o protobuf.zip https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-x86_64.zip
mkdir protobuf_temp && unzip protobuf.zip -d protobuf_temp/
sudo cp protobuf_temp/bin/protoc /usr/local/bin/
sudo cp -r protobuf_temp/include/* /usr/local/include/
rm -rf protobuf_temp protobuf.zip

Install CometBFT:

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

Download and build Namada binaries:

cd $HOME
rm -rf $HOME/namada
git clone https://github.com/anoma/namada
cd $HOME/namada
wget https://github.com/anoma/namada/releases/download/v0.28.1/namada-v0.28.1-Linux-x86_64.tar.gz
tar -xvf namada-v0.28.1-Linux-x86_64.tar.gz
rm namada-v0.28.1-Linux-x86_64.tar.gz
cd namada-v0.28.1-Linux-x86_64
sudo mv namada namadan namadac namadaw /usr/local/bin/
if [ ! -d "$HOME/.local/share/namada" ]; then
    mkdir -p "$HOME/.local/share/namada"
fi

Check Namada version:

namada --version

Option 1
Join-network as Pre-Genesis Validator:

Move your pre-genesis folder to $BASE_DIR and join the network:

cd $HOME cp -r ~/.namada/pre-genesis $BASE_DIR/
namada client utils join-network --chain-id $CHAIN_ID --genesis-validator $ALIAS

Option 2
Join-network as Full Nodes or Post-Genesis Validator:

namada client utils join-network --chain-id $CHAIN_ID

Create Service file:

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

[Service]
User=$USER
WorkingDirectory=$BASE_DIR
Environment=TM_LOG_LEVEL=p2p:none,pex:error
Environment=NAMADA_CMT_STDOUT=true
Environment=NAMADA_LOG=info
ExecStart=$(which namada) node ledger run
StandardOutput=syslog
StandardError=syslog
Restart=always
RestartSec=10
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Set custom ports in config.toml:

sed -i.bak -e "s%:26658%:${NAMADA_PORT}658%g;
s%:26657%:${NAMADA_PORT}657%g;
s%:26656%:${NAMADA_PORT}656%g;
s%:26545%:${NAMADA_PORT}545%g;
s%:8545%:${NAMADA_PORT}545%g;
s%:26660%:${NAMADA_PORT}660%g" $HOME/.local/share/namada/public-testnet-15.0dacadb8d663/config.toml

Enable and start service:

sudo systemctl daemon-reload
sudo systemctl enable namadad
sudo systemctl restart namadad && sudo journalctl -u namadad -f

Create Post-Genesis Validator (skip this if you are a pre-genesis validator) (Option 2)

Create wallet:

namada wallet address gen --alias $WALLET

Or restore wallet:

namada wallet key derive --alias $WALLET --hd-path default

Check wallet list:

namada wallet key list

Fund your wallet from faucet

Create validator:(!) before creating a validator, you need to check the balance and make sure that the node is synchedCheck Sync status, once your node is fully synced, the output from above will sayfalse

curl http://127.0.0.1:26657/status | jq .result.sync_info.catching_up

Check your balance:

namada client balance --owner $WALLET

Init validator:

namada client init-validator \
 --alias $ALIAS \
 --account-keys $WALLET \
 --signing-keys $WALLET \
 --commission-rate 0.1 \
 --max-commission-rate-change 0.1 \
 --email $EMAIL

Stake your funds:

namada client bond \
 --source $WALLET  --validator $ALIAS  --amount 1000

Waiting more than 2 epoch and check your status:

namada client bonds --owner $ALIAS

=========================================================

Delete node

sudo systemctl stop namadad
sudo systemctl disable namadad
sudo rm -rf /etc/systemd/system/namadad.service
sudo systemctl daemon-reload
sudo rm $(which namada)
sudo rm -rf $HOME/.local/share/namada/public-testnet-15.0dacadb8d663

Addition info

Wallet operations

create a new keypair:

KEY_ALIAS="ptzruslan"; namada wallet key gen --alias $KEY_ALIAS

restore executed key:

namada wallet key restore --alias $KEY_ALIAS --hd-path default

view your address:

namada wallet address find --alias $KEY_ALIAS

add some tokens using faucet:

https://faucet.heliax.click/

check balance:

namada client balance --owner $KEY_ALIAS

check keys:

namada wallet key list

send payment from your address to validator-1:

namada client transfer --source <SENDER_ADDRESS> --target <RECEIVER_ADDRESS> --token NAM --amount 10 --signing-keys $KEY_ALIAS

Multisign

generate key_1:

namadaw key gen --alias my-key1

generate key_2 and etc:

namadaw key gen --alias my-key2

an implicit address can also be generated:

namadaw address gen --alias my-address

init non-multisig account (single signer):

namadac init-account --alias my-multisig-alias --public-keys my-key1 --signing-keys my-key1

init multisig account (at least 2 signers):

namadac init-account --alias my-multisig-alias --public-keys my-key1,my-key2 --signing-keys my-key1,my-key2 --threshold 2

submitting a multisignature transaction:

mkdir tx_dumps

create transaction:

namadac transfer --source my-multisig-alias --target some-established-account-alias --token NAM --amount 100 --signing-keys my-key1 --dump-tx --output-folder-path tx_dumps

signing the transaction:

namadac sign-tx --tx-path "<path-to-file>" --signing-keys my-key1 --owner my-multisig-alias

save as a variable offline_signature:

export SIGNATURE_ONE="offline_signature_FB7246E3FC43F59D8AEEC234EBFDB9DF1AC9BB7B14E536D05A7E2617CA41D4CD_0.tx"

submit transaction:

namadac tx --tx-path "tx_dumps/a45ef98a817290d6fc0efbd480bf66647ea8061aee1628ce09b4af4f4eeed1c2.tx" --signatures $SIGNATURE_ONE --signatures $SIGNATURE_TWO --owner my-multisig-alias --gas-payer my-key1

changing the multisig threshold:

namadac update-account --address my-multisig-address --threshold 1 --signing-keys my-key1,my-key2

one can check that the threshold has been updated correctly by running:

namadac query-account --owner my-multisig-address

changing the public keys of a multisig account:

namadac update-account --address my-multisig-address --public-keys my-key3,my-key4,my-key5 --signing-keys my-key1,my-key2

initialize an established account:

namada client init-account --alias establishment --public-keys ptzruslan  --signing-keys ptzruslan  --threshold 1

MASP

randomly generate a new spending key:

namadaw masp gen-key --alias <your-spending-key-alias>

create a new payment address:

namadaw masp gen-addr  --key <your-spending-key-alias> --alias <your-payment-address-alias>

send your shielding transfer:

namadac transfer --source <your-established-account-alias>  --target <your-payment-address-alias>  --token btc --amount <amount-to-shield>

view balance:

namadac balance --owner <your-spending-key-alias>

shielded transfers (once the user has a shielded balance, it can be transferred to another shielded address):

namadac transfer  --source <your-spending-key-alias> --target <destination-payment-address>  --token btc --amount <amount-to-transfer> --signing-keys <your-implicit-account-alias>

unshielding transfers (it is also possible to transfer the balance to a transparent account):

namadac transfer --source <your-spending-key-alias> --target <some-transparent-address-alias> --token btc  --amount <amount-to-unshield> --signing-keys <your-implicit-account-alias>

Validator operations

check sync status and node info:

curl http://127.0.0.1:26657/status | jq

check balance:

namada client balance --owner $ALIAS

check keys:

namada wallet key list

stake funds:

namadac bond --source $ALIAS --validator $ALIAS --amount 1000

check your validator bond status:

namada client bonds --owner $ALIAS

check all bonded nodes:

namada client bonded-stake

find all the slashes:

namada client slashes

non-self unbonding:

namada client unbond --source aliace --validator $ALIAS --amount 1.2

self-unbonding:

namada client unbond --validator $ALIAS --amount 0.3

withdrawing unbonded tokens:

namada client withdraw --source aliace --validator $ALIAS

Find Your Validator:

namadac find-validator --tm-address=$(curl -s localhost:26657/status | jq -r .result.validator_info.address) --node localhost:26657

Check epoch:

namada client epoch

Sync and Consensus

check logs:

sudo journalctl -u namadad -f

check sync status and node info:

curl http://127.0.0.1:26657/status | jq

check consensus state:

curl -s localhost:26657/consensus_state | jq .result.round_state.height_vote_set[0].prevotes_bit_array

full consensus state:

curl -s localhost:12657/dump_consensus_state

your validator votes (prevote):

curl -s http://localhost:26657/dump_consensus_state | jq '.result.round_state.votes[0].prevotes' | grep $(curl -s http://localhost:26657/status | jq -r '.result.validator_info.address[:12]')