Basic tools for a validator node in Celestia

Cumulo
Cumulo.pro
Published in
7 min readDec 19, 2022

The first modular blockchain

Table of contents

Β· πŸ“Œ Overview
· 🌐 Useful links
∘ Social media:
∘ Explorers:
Β· βš™οΈHardware requirements
Β· πŸ›  Manual installation
∘ Updating packages and installing dependencies
∘ Environment variables
∘ Install go
∘ Download and compile binaries
∘ Setup the P2P networks
∘ Configure and start the application
∘ Download genesis
∘ Set seeds and peers
∘ Configure pruning
∘ Set the minimum gas price
∘ Activate prometheus
∘ Clean up old data
Β· ♻️ Fast synchronisation with snapshot (Optional)
Β· πŸ›Ž Service with SystemD
∘ Create the service file
∘ Enable, start service and check logs
Β· πŸ—Wallet
∘ Create wallet
∘ Restore wallet
∘ Deposit funds into your wallet
Β· Configure the QGB Keys
Β· πŸ“Validator
∘ Create validator
∘ Check synchronisation status
∘ Check your balance
∘ Create validator
Β· πŸ›Ž SystemD commands
∘ Stop the service
∘ Start service
∘ Restart service
∘ Check logs
∘ Check status
Β· πŸ“ˆ Node information
∘ Synchronization information
∘ Node information
∘ Validator information
∘ Get peers
Β· πŸ” Wallet operation
∘ Check balance
∘ Wallet Key List
∘ Create a new wallet
∘ Wallet recovering
∘ Delete wallet
∘ Transfer funds
Β· πŸ’¬ Governance
∘ List all proposals
∘ Vote YES
∘ Vote NO
∘ Refrain
· 🚰 Staking, delegation and rewards
∘ Withdraw all rewards
∘ Withdraw commission
∘ Delegate Stake
Β· βœ”οΈ Validator operation
∘ Edit validator
∘ Validator information
∘ Jailing information
∘ Validator unjailing
Β· πŸ—‘ Delete node

πŸ“Œ Overview

Celestia is the first modular blockchain with a scalable general purpose data availability layer for decentralised applications and trust-minimised sidechains.

The core idea of Celestia is to decouple transaction execution (and validity) from the consensus layer, so that the consensus is only responsible for a) ordering transactions and b) guaranteeing their data availability. They believe that is the next generation of scalable blockchain architectures.

TIA is the native token of Celestia.

Chain ID: mocha | arabica

🌐 Useful links

● Website: https://celestia.org/

● GitHub: https://github.com/celestiaorg

● Celestia documentation: https://docs.celestia.org/

● Frequently Asked Questions: https://celestia.org/faq/

● Cumulo Spanish Resources: http://cumulo.pro/celestia.html

Social media:

● Twitter: https://twitter.com/CelestiaOrg

● Telegram: https://t.me/CelestiaCommunity

● Discord: https://discord.gg/celestiacommunity

● Blog: https://blog.celestia.org/

● LinkedIn: https://www.linkedin.com/company/celestiaorg/

● Youtube: https://www.youtube.com/@celestia7066

Explorers:

● https://celestia.explorers.guru/

● https://testnet-explorer.brocha.in/celestia/

βš™οΈHardware requirements

● Memory: 8 GB RAM

● CPU: Quad-Core

● Disk: 250 GB of storage

● Bandwidth: 1 Gbps for Download/100 Mbps for Upload

πŸ›  Manual installation

Updating packages and installing dependencies

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

Environment variables

To set environment variables replace your wallet and moniker <YOUR_WALLET_NAME> < YOUR_MONIKER>, save and import the variables into the system.

echo "export CELESTIA_WALLET="<YOUR_WALLET_NAME>"" >> $HOME/.bash_profile
echo "export CELESTIA_MONIKER="<YOUR_MONIKER>"" >> $HOME/.bash_profile
echo "export CELESTIA_CHAIN_ID="mocha"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Install go

cd $HOME
VER="1.19.1"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm -rf "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

Download and compile binaries

cd $HOME
rm -rf celestia-app
git clone https://github.com/celestiaorg/celestia-app.git
cd celestia-app/
APP_VERSION=v0.11.0
git checkout tags/$APP_VERSION -b $APP_VERSION
make install

Setup the P2P networks

cd $HOME
rm -rf networks
git clone https://github.com/celestiaorg/networks.git

Configure and start the application

celestia-appd config chain-id mocha
celestia-appd init $CELESTIA_MONIKER --chain-id mocha

Download genesis

cp $HOME/networks/mocha/genesis.json $HOME/.celestia-app/config

Set seeds and peers

Peers

peers=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/mocha/peers.txt | tr -d '\n')
bootstrap_peers=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/mocha/bootstrap-peers.txt | tr -d '\n')
sed -i.bak -e 's|^bootstrap-peers *=.*|bootstrap-peers = "'"$bootstrap_peers"'"|; s|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.celestia-app/config/config.toml

You can find more peers here:

Configure pruning

PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="10"

sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \
\"$PRUNING_KEEP_RECENT\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.celestia-app/config/app.toml

Set the minimum gas price

sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0utia\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.celestia-app/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.celestia-app/config/config.toml

Activate prometheus

sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.celestia-app/config/config.toml

Clean up old data

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

♻️ Fast synchronisation with snapshot (Optional)

You can sync your Celestia node quickly by downloading a recent snapshot:

cd $HOME
rm -rf ~/.celestia-app/data
mkdir -p ~/.celestia-app/data
SNAP_NAME=$(curl -s https://snaps.qubelabs.io/celestia/ | \
egrep -o ">mocha.*tar" | tr -d ">")
wget -O - https://snaps.qubelabs.io/celestia/${SNAP_NAME} | tar xf - \
-C ~/.celestia-app/data/

πŸ›Ž Service with SystemD

Create the service file

sudo tee <<EOF >/dev/null /etc/systemd/system/celestia-appd.service
[Unit]
Description=celestia-appd Cosmos daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$HOME/go/bin/celestia-appd start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF

Enable, start service and check logs

sudo systemctl daemon-reload
sudo systemctl enable celestia-appd
sudo systemctl restart celestia-appd
sudo journalctl -u celestia-appd -f

πŸ—Wallet

Create wallet

Don’t forget to save the mnemonic.

celestia-appd keys add $CELESTIA_WALLET

Restore wallet

celestia-appd keys add $CELESTIA_WALLET --recover

Deposit funds into your wallet

Before creating a validator, you have to deposit funds in your wallet, go to the Celestia Discord server and request them in the faucet channel.

$request <address wallet>

Configure the QGB Keys

This step helps you prepare for when the Quantum Gravity Bridge is ready to be deployed. You need to perform this step before running a validator, by configuring 2 additional keys.

● EVM-address: This flag must contain a 0x EVM address. Here, you can add any Ethereum-based address. You can also modify it later if you decide to change your address. To get this wallet address you can use a MetaMask address or an Ethereum wallet.

● orchestrator-address: This flag must contain a newly generated Celestia address. Validators can use their existing Celestia addresses, but it is recommended to create a new one:

celestia-appd keys add ${CELESTIA_WALLET}_2

You can set both values as environment variables:

ERC20_ADDRESS="0xdd5xxxxxxxxxxxxxxxx3a2720840001bC5F87D7x"
CELESTIA_WALLET_ADDRESS=$(celestia-appd keys show $CELESTIA_WALLET -a)
CELESTIA_VALOPER_ADDRESS=$(celestia-appd keys show $CELESTIA_WALLET --bech val -a)
ORCHESTRATOR_ADDRESS=$(celestia-appd keys show ${CELESTIA_WALLET}_2 -a)
echo "export CELESTIA_WALLET_ADDRESS="${CELESTIA_WALLET_ADDRESS} >> $HOME/.bash_profile
echo "export CELESTIA_ORCHESTRATOR_ADDRESS="${ORCHESTRATOR_ADDRESS} >> $HOME/.bash_profile
echo "export CELESTIA_VALOPER_ADDRESS="${CELESTIA_VALOPER_ADDRESS} >> $HOME/.bash_profile
echo "export EVM_ADDRESS=""$ERC20_ADDRESS" >> $HOME/.bash_profile
source $HOME/.bash_profile

πŸ“Validator

Create validator

Before creating a validator, you should make sure that the node is synchronised and check the balance of your wallet.

Check synchronisation status

Once your node is fully synchronised, the output will read false.

celestia-appd status 2>&1 | jq .SyncInfo

Check your balance

celestia-appd query bank balances $CELESTIA_WALLET_ADDRESS

Create validator

celestia-appd tx staking create-validator \
--amount 1000000utia \
--from $CELESTIA_WALLET \
--commission-max-change-rate "0.01" \
--commission-max-rate "0.2" \
--commission-rate "0.05" \
--min-self-delegation "1" \
--pubkey $(celestia-appd tendermint show-validator) \
--moniker $CELESTIA_MONIKER \
--chain-id $CELESTIA_CHAIN_ID \
--evm-address "$EVM_ADDRESS" \
--orchestrator-address "$CELESTIA_ORCHESTRATOR_ADDRESS" \
--gas auto \
--gas-adjustment 1.3 \
--fees 1000utia

You can add the flags β€” website β€” security-contact β€” identity β€” details (optional)

--website <WEB_SITE_URL> \
--security-contact <YOUR_CONTACT> \
--identity <KEYBASE_IDENTITY> \
--details <YOUR_VALIDATOR_DETAILS>

πŸ›Ž SystemD commands

Stop the service

sudo systemctl stop celestia-appd

Start service

sudo systemctl start celestia-appd

Restart service

sudo systemctl restart celestia-appd

Check logs

sudo journalctl -u celestia-appd -f

Check status

sudo systemctl status celestia-appd

πŸ“ˆ Node information

Synchronization information

celestia-appd status 2>&1 | jq .SyncInfo

Node information

celestia-appd status 2>&1 | jq .NodeInfo

Validator information

celestia-appd status 2>&1 | jq .ValidatorInfo

Get peers

echo $(celestia-appd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.celestia-appd/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

πŸ” Wallet operation

Check balance

celestia-appd query bank balances $CELESTIA_WALLET_ADDRESS

Wallet Key List

celestia-appd keys list

Create a new wallet

celestia-appd keys add $CELESTIA_WALLET

Wallet recovering

celestia-appd keys add $CELESTIA_WALLET --recover

Delete wallet

celestia-appd keys delete $CELESTIA_WALLET

Transfer funds

celestia-appd tx bank send $CELESTIA_WALLET_ADDRESS <ANOTHER_CELESTIA_WALLET_ADDRESS> 800000000utia --gas auto --gas-adjustment 1.3

πŸ’¬ Governance

List all proposals

celestia-appd query gov proposal 1

Vote YES

celestia-appd tx gov vote 1 yes --from $CELESTIA_WALLET --chain-id $CELESTIA_CHAIN_ID --gas-adjustment 1.4 --gas auto -y

Vote NO

celestia-appd tx gov vote 1 no --from $CELESTIA_WALLET --chain-id $CELESTIA_CHAIN_ID --gas-adjustment 1.4 --gas auto -y

Refrain

celestia-appd tx gov vote 1 abstain --from $CELESTIA_WALLET --chain-id $CELESTIA_CHAIN_ID --gas-adjustment 1.4 --gas auto -y

🚰 Staking, delegation and rewards

Withdraw all rewards

celestia-appd tx distribution withdraw-all-rewards --from $CELESTIA_WALLET --chain-id $CELESTIA_CHAIN_ID --gas auto --gas-adjustment 1.3

Withdraw commission

celestia-appd tx distribution withdraw-rewards $CELESTIA_VALOPER_ADDRESS --from $CELESTIA_WALLET --commission --fees 20utia

Delegate Stake

celestia-appd tx staking delegate $CELESTIA_VALOPER_ADDRESS 10000000utia --from $CELESTIA_WALLET --chain-id $CELESTIA_CHAIN_ID --gas=auto --gas-adjustment 1.3

βœ”οΈ Validator operation

Edit validator

celestia-appd tx staking edit-validator \
--moniker=$NODENAME \
--identity=<keybase_id> \
--website="<website>" \
--details="<validator_description>" \
--chain-id=$CELESTIA_CHAIN_ID \
--from=$CELESTIA_WALLET
--fees=200utia

Validator information

celestia-appd status 2>&1 | jq .ValidatorInfo

Jailing information

celestia-appd q slashing signing-info $(celestia-appd tendermint show-validator)

Validator unjailing

celestia-appd tx slashing unjail --broadcast-mode=block --from $CELESTIA_WALLET --chain-id $CELESTIA_CHAIN_ID --gas auto --gas-adjustment 1.5

πŸ—‘ Delete node

sudo systemctl stop celestia-appd
sudo systemctl disable celestia-appd
sudo rm -rf /etc/systemd/system/celestia-appd*
sudo systemctl daemon-reload
sudo rm $(which celestia-appd)
sudo rm -rf $HOME/.celestia-appd
sudo rm -fr $HOME/ celestia-appd
sed -i "/CELESTIA_/d" $HOME/.bash_profile

Authors: Sami & Mon

--

--