# Celestia Validator Node - Mocha

By [GLCstaked](https://paragraph.com/@glcstaked) · 2023-01-03

---

**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](https://docs.celestia.org/nodes/validator-node), 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](https://storage.googleapis.com/papyrus_images/2bb19027681e4d5845ecc0f73aa4904dd1f2a0a421e2962cde4eadd85d847fe7.png)

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](https://storage.googleapis.com/papyrus_images/63c5712a8659748183cd3d8129f9292e07305b33d5e1633e5216705681d5c6e7.png)

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/](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
    

![](https://storage.googleapis.com/papyrus_images/842fb40a86b5ebd8112fa235d2d0701d8dc0ffbac06ffa248e58451e452bfa44.png)

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
    

![](https://storage.googleapis.com/papyrus_images/34f5cf9c6b915fc22a7befe50368688eabcd3af5846ec371e5c27ab9abd988f0.png)

**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

![](https://storage.googleapis.com/papyrus_images/9e949bf831451ffe654469351fb423a22e30b6587f572790eacc9a6e9fd8f8e7.png)

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

![](https://storage.googleapis.com/papyrus_images/95a08357a1ec1cf71487bce153e5dc78db0f8cf0eb8ab32f4f7eff5af210d689.png)

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

![](https://storage.googleapis.com/papyrus_images/b3971793b8f3f59334484da7ddb1d38c9f769978f35c9bea50a03d9bd3bdf3d7.png)

**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**

[https://docs.celestia.org/nodes/validator-node#setup-qgb-keys](https://docs.celestia.org/nodes/validator-node#setup-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

[

Main Project Information | Celestia (TIA) Blockchain Explorer
-------------------------------------------------------------

Fast, simple and secure blockchain solution to stake your crypto assets and earn yields. Stake with the best validator. High performance. Delivered.

https://celestia.explorers.guru

![](https://storage.googleapis.com/papyrus_images/030b6823bbbc5c364994f87d58d84713a878042a0e390fd9e5c99b98d7188a6a.png)

](https://celestia.explorers.guru/)

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

---

*Originally published on [GLCstaked](https://paragraph.com/@glcstaked/celestia-validator-node-mocha)*
