Celestia - Validator Node

RPC: https://celestia-mocha-rpc.cryptomolot.com/

Type of node: Validator Node

ChainID: mocha4

Resources

Hardware requirements

6 cores

8 GB

500 GB NVME

100 mbps

Linux (Ubuntu 20.04 x64)

Installation 💾

Install dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Install GO 1.22.2

sudo rm -rf /usr/local/go && \
curl -L https://go.dev/dl/go1.22.2.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local && \
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && \
source .bash_profile && \
go version

Set vars (change <wallet-name> , <moniker> and port)

echo "export WALLET="<wallet-name>"" >> $HOME/.bash_profile
echo "export MONIKER="<moniker>"" >> $HOME/.bash_profile
echo "export CELESTIA_CHAIN_ID="mocha-4"" >> $HOME/.bash_profile
echo "export CELESTIA_PORT="26"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Get binary

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

git checkout tags/v1.13.0 -b v1.13.0
make install

cd $HOME
rm -rf networks
git clone https://github.com/celestiaorg/networks.git
celestia-appd init $MONIKER --chain-id $CELESTIA_CHAIN_ID
cp $HOME/networks/mocha-4/genesis.json $HOME/.celestia-app/config
sed -i -e "s|^target_height_duration *=.*|timeout_commit = \"11s\"|" $HOME/.celestia-app/config/config.toml

Set config and init

celestia-appd config node tcp://localhost:${CELESTIA_PORT}657
celestia-appd config keyring-backend test
celestia-appd config chain-id mocha-4
celestia-appd init $MONIKER --chain-id $CELESTIA_CHAIN_ID

Get genesis and addrbook

wget -O $HOME/.celestia-app/config/genesis.json https://testnet-files.itrocket.net/celestia/genesis.json
wget -O $HOME/.celestia-app/config/addrbook.json https://testnet-files.itrocket.net/celestia/addrbook.json

Add seeds and peers in config.toml

SEEDS="5d0bf034d6e6a8b5ee31a2f42f753f1107b3a00e@celestia-testnet-seed.itrocket.net:11656"
PEERS="daf2cecee2bd7f1b3bf94839f993f807c6b15fbf@celestia-testnet-peer.itrocket.net:11656,e726816f42831689eab9378d5d577f1d06d25716@164.152.163.148:36656,c17c0cbf05e98656fee5f60fad469fc528f6d6de@65.109.25.113:11656,a95320e4abc5f2eaa4183ce41b0c3f180b8bcc4d@138.201.85.176:20156,7bb64cb482c0c6869df808a2c0ee7b6c3216079e@94.130.35.35:17656,59b72c3ef197ee18371a7bf2de5be0065e516843@62.171.148.127:26656,21833c6e07b2cb848ec0da6f405cd06f8e51eeed@65.109.88.22:26656,ca328c8c75dbbc9d753ed50a52dfcb02af829a29@85.207.33.76:26656,bc76a0ddb6b5fd0089ee82938181f1e5219414b6@62.169.25.91:26656,33acbad5e87d62df89a498b27f180d3e020ff9f0@65.108.235.238:26656,3cd0b4f0d84a6e87ec85b35a061c9bacc5b7be15@104.243.40.16:11656,9a6ecd59ecf02a97edb663ce73fb643d07ec087d@162.19.19.41:26656,d61e37eadcc45d382abf8fb11b7851d4342bece6@93.159.130.38:35656,e3bd52521309b0958da511188ae863fcf613548b@5.75.182.123:11656,43e9da043318a4ea0141259c17fcb06ecff816af@141.94.73.39:43656,6cabdecd60b320c9481df4e63678623026283fab@136.243.94.113:26656,5a7566aa030f7e5e7114dc9764f944b2b1324bcd@65.109.23.114:11656,5615ba73e88e3613749b188634793ffd9095bc1b@158.247.202.9:26656,ac68d93b828f8f491d01e30d734355207aa20eb2@65.109.106.211:22656,3dde9caede9f1930211e62859c6d85e3b5086bd8@218.155.161.169:30592,7f7041ab4af1dc5abf917357da3bfdc0bddda5cf@148.113.8.66:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.celestia-app/config/config.toml

Set minimum gas-price, enable prometheus and disable indexing

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.002utia"|g' $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

set custom ports in app.toml

sed -i.bak -e "s%:1317%:${CELESTIA_PORT}317%g;
s%:8080%:${CELESTIA_PORT}080%g;
s%:9090%:${CELESTIA_PORT}090%g;
s%:9091%:${CELESTIA_PORT}091%g;
s%:8545%:${CELESTIA_PORT}545%g;
s%:8546%:${CELESTIA_PORT}546%g;
s%:6065%:${CELESTIA_PORT}065%g" $HOME/.celestia-app/config/app.toml

set custom ports in config.toml

sed -i.bak -e "s%:26658%:${CELESTIA_PORT}658%g;
s%:26657%:${CELESTIA_PORT}657%g;
s%:6060%:${CELESTIA_PORT}060%g;
s%:26656%:${CELESTIA_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${CELESTIA_PORT}656\"%;
s%:26660%:${CELESTIA_PORT}660%g" $HOME/.celestia-app/config/config.toml

configure pruning

sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.celestia-app/config/app.toml

Create a service

sudo tee /etc/systemd/system/celestia-appd.service > /dev/null <<EOF
[Unit]
Description=Celestia node
After=network-online.target

[Service]
User=$USER
WorkingDirectory=$HOME/.celestia-app
ExecStart=$(which celestia-appd) start --home $HOME/.celestia-app
Restart=on-failure
RestartSec=5
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload

Download snapshot for fast sync

backup priv_validator_state.json

cp $HOME/.celestia-app/data/priv_validator_state.json $HOME/.celestia-app/priv_validator_state.json.backup

download and extract files from archive

curl https://testnet-files.itrocket.net/celestia/snap_celestia.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.celestia-app

move priv_validator_state.json back

mv $HOME/.celestia-app/priv_validator_state.json.backup $HOME/.celestia-app/data/priv_validator_state.json

Start the node and check logs

sudo systemctl restart celestia-appd && sudo journalctl -u celestia-appd -f

Check sync status. false = synced

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

Create or recover wallet

Dont forget to save mnemonic

create wallet

celestia-appd keys add $WALLET

recover wallet

celestia-appd keys add $WALLET --recover

set your wallet var

WALLET_ADDRESS=$(celestia-appd keys show $WALLET -a)
VALOPER_ADDRESS=$(celestia-appd keys show $WALLET --bech val -a)
echo "export WALLET_ADDRESS="$WALLET_ADDRESS >> $HOME/.bash_profile
echo "export VALOPER_ADDRESS="$VALOPER_ADDRESS >> $HOME/.bash_profile
source $HOME/.bash_profile

Request tokens from the faucet 🆓

Request tokens from discord "faucet" channel https://discord.com/invite/YsnTPcSfWQ

Check wallet balance

celestia-appd query bank balances $WALLET_ADDRESS

Create a Validator

celestia-appd tx staking create-validator \
--amount 1000000utia \
--from $WALLET \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(celestia-appd tendermint show-validator) \
--moniker "moniker" \
--identity "" \
--website "" \
--details "" \
--chain-id mocha-4 \
--gas auto --gas-adjustment 1.5 --gas-prices 0.005utia \
-y

Useful commands ⚙️

Sync status

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

Node status

celestia-appd status 2>&1 | jq

Query your validator

celestia-appd q staking validator $(celestia-appd keys show $WALLET --bech val -a) 

Delegate tokens to your validator

celestia-appd tx staking delegate $(celestia-appd keys show $WALLET --bech val -a) 1000000utia --from $WALLET --chain-id mocha-4 --gas auto --gas-adjustment 1.5 --gas-prices 0.005utia -y 

Delete node 🗑️

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

Last updated