Celestia Validator Node - Mocha

Set up guide for a Validator Node on Celestia’s Mocha Testnet, this also applies to set up a Consensus full node, up to Step 7.

Validator Node’s are responsible for the proof-of-stake consensus on the Celestia network, validators put up stake to be economically incentivised to keep the network secure and in doing so get rewarded.

Consensus Full Node, talk to other full nodes via peer-to-peer networking to verify the chain state. Consensus concerns how the network comes to agreement on the state of balances and accounts for the Celestia chain. Every Validator will run a consensus full node, but its not necessary for a full node to run a validator.

Note there can only be 100 active validators, nodes with the highest stake + delegation. If a validator does not have the required votes it will be inactive, still a live peer on the network but will not be selected to produce blocks until it reaches the active set.

Hardware Requirements:

4vCPU / 8GB RAM / 250GB SSD / 1 Gbps Download/100 Mbps Upload
OS: Ubuntu Linux 20.04 (LTS) x64

See Official guides for Celestia on setting up a Validator here, This document is designed for an easy step by step setup

1. Setup Dependencies

Update the OS

sudo apt update && sudo apt upgrade -y

Install essential packages for Celestia

These are essential packages that are necessary to execute many tasks like downloading files, compiling and monitoring the node:

sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu -y

Change to Root User

Most of the packages to install work best under root, to enter root in the terminal with sudo -i which can be exited back to normal user with exit anytime.

shell prefix under root
shell prefix under root

Install Golang

remove any existing installation

cd $HOME
sudo rm -rf /usr/local/go
sudo rm -rf ~/go

Install Go and extract

ver="1.19.4"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"

Add Go to PATH

echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Adding to the PATH variable is to allow Linux shell to know where to look for executable files is easy, to confirm this try go version

You should have an output like this
You should have an output like this

2. Install Celestia Application

For Celestia Validator Node setup: running a Celestia App daemon with an internal Celestia Core node. https://docs.celestia.org/developers/celestia-app/, the application will be configured as a validator later.

Install Celestia App

create a binary file named celestia-appd inside $HOME/go/bin folder which will be used later to run the node. Check the Discord ‘Mocha Testnet’ announcements for the latest version (currently this is v0.11.0)

cd $HOME
git clone https://github.com/celestiaorg/celestia-app.git
cd celestia-app
git checkout v0.11.0
make install

confirm installation with, in the directory

celestia-appd version

3. Set Variables

CELESTIA_NODENAME="MY_NODE"
CELESTIA_WALLET="MY_WALLET"
CELESTIA_CHAIN="mocha"                      # do not change

Save Variables

echo "export CELESTIA_CHAIN=$CELESTIA_CHAIN
export CELESTIA_NODENAME=${CELESTIA_NODENAME}
export CELESTIA_WALLET=${CELESTIA_WALLET}
" >> $HOME/.bash_profile

source $HOME/.bash_profile

you should be able to echo the $VAR and see the correct result returned, or check the .bash_profile itself

4. Initialise Node

celestia-appd init $CELESTIA_NODENAME --chain-id $CELESTIA_CHAIN

Copy Genesis

Download network configs, and move to .celestia-app

cd $HOME
git clone https://github.com/celestiaorg/networks
cp $HOME/networks/mocha/genesis.json $HOME/.celestia-app/config/

Reset

celestia-appd tendermint unsafe-reset-all --home $HOME/.celestia-app

5. Configurations

Peers and Seeds

SEEDS="9aa8a73ea9364aa3cf7806d4dd25b6aed88d8152@celestia.seed.mzonder.com:11156"
sed -i "s|^seeds *=.*|seeds = \"$SEEDS\"|" $HOME/.celestia-app/config/config.toml

Pruning and Snapshots

pruning_keep_recent="10000"
pruning_interval=$(shuf -n1 -e 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)
snapshot_interval="5000"

sed -i "s/^pruning *=.*/pruning = \"custom\"/;\
s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/;\
s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/;\
s/^snapshot-interval *=.*/snapshot-interval = $snapshot_interval/" $HOME/.celestia-app/config/app.toml

This sets the values we want for certain variables stored in $HOME/.celestia-app/config/app.toml

Client Config

celestia-appd config chain-id $CELESTIA_CHAIN --home $HOME/.celestia-app
celestia-appd config keyring-backend test

6. Run Node with SystemD

tee $HOME/celestia-appd.service > /dev/null <<EOF
[Unit]
Description=celestia-appd
After=network-online.target
[Service]
User=$USER
ExecStart=$(which celestia-appd) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Move to directory

mv $HOME/celestia-appd.service /etc/systemd/system/

Enable Service and Start

systemctl enable celestia-appd
systemctl daemon-reload
systemctl start celestia-appd 

Display Logs

journalctl -u celestia-appd -f -o cat

It will take a while to find peers, be patient

Once Peers have been found, it will begin syncing, logs should look similar to this

7. Setup Validator Key (Validator Only)

Before continuing the node must be synced this can be checked with

curl -s localhost:26657/status

This outputs the sync info, and catching_up will be false once synced

Recover existing key

celestia-appd keys add $CELESTIA_WALLET --recover

Input your seed/mnemonic, (assuming this wallet has tokens and set up for mocha Testnet)

Check Balance

celestia-appd q bank balances $CELESTIA_ADDR

Save addresses to Variables

The validator address (VALOPER) is a derived address from your seed that is different from the normal address

CELESTIA_ADDR=$(celestia-appd keys show $CELESTIA_WALLET -a)
echo $CELESTIA_ADDR
echo 'export CELESTIA_ADDR='${CELESTIA_ADDR} >> $HOME/.bash_profile

CELESTIA_VALOPER=$(celestia-appd keys show $CELESTIA_WALLET --bech val -a)
echo $CELESTIA_VALOPER
echo 'export CELESTIA_VALOPER='${CELESTIA_VALOPER} >> $HOME/.bash_profile
source $HOME/.bash_profile

Set up QGB Keys

celestia-appd keys add ORCHESTRATOR_ADDRESS

SAVE THE SEED THAT IS OUTPUT

Save Orchestrator address to variables

ORCHESTRATOR_ADDRESS=$(celestia-appd keys show ORCHESTRATOR_ADDRESS -a)
echo $ORCHESTRATOR_ADDRESS
echo 'export ORCHESTRATOR_ADDRESS='${ORCHESTRATOR_ADDRESS} >> $HOME/.bash_profile

Save an EVM address to variables

This should be an address under your control

EVM_ADDRESS=<ETH ADDRESS WALLET HERE>
echo $EVM_ADDRESS
echo 'export EVM_ADDRESS='${EVM_ADDRESS} >> $HOME/.bash_profile

8. Create Validator

celestia-appd tx staking create-validator \
--amount=1000000utia \
--pubkey=$(celestia-appd tendermint show-validator) \
--moniker=$CELESTIA_NODENAME \
--chain-id=$CELESTIA_CHAIN \
--commission-rate=0.1 \
--commission-max-rate=0.2 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1000000 \
--from=$CELESTIA_WALLET \
--evm-address=$EVM_ADDRESS \
--orchestrator-address=$ORCHESTRATOR_ADDRESS \
--fees 5000utia \
--gas auto \
--gas-adjustment 1.5

NOTE: 1000000 is equal to 1 TIA

Check the Validator

celestia-appd q staking validator $CELESTIA_VALOPER

this will only work after the transaction is confirmed, may take a few minutes. alternatively validator can be seen on an explorer

Additional Commands

Change Moniker

celestia-appd tx staking edit-validator --identity "YOUR_KEYBASE_ID" --from $CELESTIA_WALLET --fees 500utia

Delegate More

celestia-appd tx staking delegate $CELESTIA_VALOPER 10000000utia --from=$CELESTIA_WALLET --fees 500utia
Subscribe to GLCstaked
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.