Celestia Validator Node

Guide to install Celestia Full node & Validator node.

This is a set up guide for a Validator Node on Celestia’s Mamaki Testnet, this also applies to set up a full node, up until Step 7.

Mamaki test network is deprecated now and replaced with Mocha test network, please see this guide for updated instructions

1. Set Up Dependencies

First, make sure to update and upgrade 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

Firewall Settings

we need to enable firewall and open ports on our device

sudo ufw allow 26657/tcp
sudo ufw allow 26656/tcp          #Port listen for incom TXs, config
sudo ufw allow 9090/tcp
sudo ufw enable

sudo ufw status

IMPORTANT: If you are going to remote into this server, make sure to enable SSH before enabling ufw

sudo ufw allow ssh

Additional Ports

These are additional ports from some additional bootstrap Peers to help with syncing (these additional peers are added later, and can change)

#these ports are to the ones in additional peers, add in the same method as above
16656,57030,41768,52552,43656,50674,41622,2665,41914,36126,41636,49656,47474,54244,44306,38360,57914,37462,37898,37754,5603,39208,49052,36656,26676,26666

Install Golang

remove any existing installation

sudo rm -rf /usr/local/go
sudo rm -rf ~/go
cd $HOME
sudo wget https://golang.org/dl/go1.18.2.linux-amd64.tar.gz
sudo tar -xvf go1.18.2.linux-amd64.tar.gz
sudo rm go1.18.2.linux-amd64.tar.gz
sudo mv go /usr/local

Now we need to add the /usr/local/go/bin directory to $PATH:

mkdir ~/go
echo 'GOROOT=/usr/local/go' >> ~/.bashrc
echo 'GOPATH=~/go' >> ~/.bashrc
echo 'PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc

make changes to the applicable file, should now be persistent in the .bashrc

source .bashrc

Confirm installation

go version

This should Return

go version go1.18.2 linux/amd64

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 ‘mamaki testnet’ announcements for the latest version (currently this is v0.6.0)

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

check if the binary was successfully compiled, will output help example commands

celestia-appd --help

3. Initialise Node and Set P2P networks

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

set variables with whatever you want in <> but do not change Network: mamaki

CELESTIA_NODENAME="<YOUR_NODE_NAME>" 
CELESTIA_WALLET="<YOUR_WALLET_NAME>" 
CELESTIA_CHAIN="mamaki"

save the variables

echo 'export CELESTIA_CHAIN='$CELESTIA_CHAIN >> $HOME/.bashrc
echo 'export CELESTIA_NODENAME='${CELESTIA_NODENAME} >> $HOME/.bashrc
echo 'export CELESTIA_WALLET='${CELESTIA_WALLET} >> $HOME/.bashrc
source $HOME/.bashrc

Initialize the application node

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

Copy the config genesis file

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

Set to validator mode (IF YOU ONLY WANT TO RUN A FULL NODE SKIP THIS LINE)

sed -i 's/mode = \"full\"/mode = \"validator\"/g' $HOME/.celestia-app/config/config.toml

Set up P2P Networks: Bootstrap Peers and Additional Peers

update bootstrap peers

BOOTSTRAP_PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/mamaki/bootstrap-peers.txt | tr -d '\n')

check

echo $BOOTSTRAP_PEERS

Set, add to config

sed -i.bak -e "s/^bootstrap-peers *=.*/bootstrap-peers = \"$BOOTSTRAP_PEERS\"/" $HOME/.celestia-app/config/config.toml 

Additional Peers

NOTE: there may be additional bootstrap peers to add to this list to help with connections, check the discord and add to the config.toml

There are additional bootstrap peers that can be added from here

curl -s https://rpc-mamaki.pops.one/net_info | jq -r '.result.peers[] | .url'

Other peers from here

to make changes to the config, and paste them in manually

sudo nano $HOME/.celestia-app/config/config.toml

To save time, you can copy from below and place in between the quotes on

bootstrap-peers = “<place here no spaces,to separate>”

f22ac1824018940e3c0e033faf6e227cfcd551f7@138.201.197.163:26656,c9e17ca0213ab914df984ed496382c8f41611053@89.58.45.204:26656,0ec6fc175a1551fccd0cadea3634127028181394@144.91.110.89:16656,eb372537fe0ebbb3944f5c5a0f18671b41f46fc1@144.91.108.185:26656,a46bbdb81e66c950e3cdbe5ee748a2d6bdb185dd@161.97.168.77:26656,f2d39a19a00c39b53371875f166ef698e9d3cefe@62.171.144.137:26656,4d4e405e09bda7ffe2ecf3f3fea1d5083b7b983a@167.86.115.64:26656,28aaa8865f3e9bba69f257b08d5c28091b5b3167@176.57.150.79:57030,96a8049fbb32c6a381dce56ca9a5773b7a2de967@65.108.121.245:41768,7516179c6e045ab88d5732eb372f6dcb405e9778@167.86.103.3:26656,ec072065bd4c6126a5833c97c8eb2d4382db85be@88.99.249.251:52552,43e9da043318a4ea0141259c17fcb06ecff816af@141.94.73.39:43656,1471df8ca8d4cb8de70b433e89c576234e91faae@65.108.211.139:26656,1d5f32e1b162b7dd289dce98fbf59fcb1cd916ba@195.201.168.245:50674,13b561f16f887ec8ff869a333ed0843550653354@95.217.75.51:41622,f4b42993f568436b1b57e85c977394b78cb5de1a@159.65.217.114:26656,824688ae0e2ce5faa64b5400828a4c288ba7dafd@210.245.49.112:2665,87fe0966d3beb31d2321ee8048ad2ee661803a7e@38.242.253.97:41914,b23fafe9639e66cd4f033dc4634f31de15e62b0d@168.119.101.224:36126,d541469b73bf72d3a51b1d9d63f0f6e5ba50cd52@65.108.208.50:41636,9df8dfe8a9f4dbfb56c42c27ee1498dae7181237@167.86.101.213:26656,5273f0deefa5f9c2d0a3bbf70840bb44c65d835c@80.190.129.50:49656,111406eca3ac81942ee53b40f85d38aca29a1d80@65.108.244.33:26656,37848b6d7c056a361d5618c4259ca56014a503de@167.86.104.21:26656,01a31c666a4cdc4a00b65419ea7d00239db9bf83@167.86.102.105:26656,38f9f7e6443afc9ed58c2d67a39979b2c847b9d2@167.86.105.208:26656,13e773f70a4ad3ad31f3d905daf67b671b2b8796@167.86.103.158:26656,fd0068b09c42dfdc853a52287d23dce7f9639ee3@34.133.49.93:47474,0668202f7e86708f13d03590a9feabaf8c790e21@161.97.167.111:54244,1a79b2e2cf2bbe5275a4a58c3425d77e9b678e82@38.242.202.182:44306,32c6d8b4f92c1b4ed89ed29c76c3e197af7712ad@167.86.105.58:26656,966a6f1277960e329a57d1f2ad52adbf86113340@167.86.102.218:26656,b5b1c7edcd83288c227b98126ab0dae7df956893@82.165.254.199:38360,e858b9b4b935e776bf10a800609cfdbcbbbf3b27@193.178.172.37:26656,99761b052d2a000ec4f80a279a5564f179d98363@185.144.99.9:26656,177348c40c8d3a0f8a09712fb04faf32bd24ab98@38.242.202.184:26656,6fb6838a41dbe35a04e90407bd9349fc2fbf122f@178.18.252.222:57914,a9d734d78ab0b7a2bd4e54b594de6d9a9fe0ff86@65.21.110.127:37462,cecb5d553aac65e9333a0e5853563289d2f0977f@62.171.191.66:37898,8a6368c28fa5d8c1aa4375762102cf6359d64e0b@5.161.138.28:37754,ee8cbe0fe4a8ebc915c246a655432820eb80a858@167.86.101.104:26656,288fc07e7c53b5afbe4b82da4069ce096332127e@167.86.105.91:26656,876a5d0177a25215cf1cd110662bcc96e773e54a@181.188.232.25:26656,0bacf8ea7273f7698fc702ee0fc2dfb1b29fc384@35.208.160.145:56034,f22ac1824018940e3c0e033faf6e227cfcd551f7@138.201.197.163:26656,cecb5d553aac65e9333a0e5853563289d2f0977f@62.171.191.66:39208,042e4429682d79acabed912f0cd5a5ea0921d352@167.86.101.7:26656,e151b6f494aa0f503a2d8da5e6daf78ec5ff8dab@185.229.119.123:49052,e4429e99609c8c009969b0eb73c973bff33712f9@141.94.73.39:43656,09263a4168de6a2aaf7fef86669ddfe4e2d004f6@142.132.209.229:26656,13d8abce0ff9565ed223c5e4b9906160816ee8fa@94.62.146.145:36656,72b34325513863152269e781d9866d1ec4d6a93a@65.108.194.40:26676,322542cec82814d8903de2259b1d4d97026bcb75@51.178.133.224:26666,5273f0deefa5f9c2d0a3bbf70840bb44c65d835c@80.190.129.50:49656,7145da826bbf64f06aa4ad296b850fd697a211cc@176.57.189.212:26656,5a4c337189eed845f3ece17f88da0d94c7eb2f9c@209.126.84.147:26656,ec072065bd4c6126a5833c97c8eb2d4382db85be@88.99.249.251:26656,cd1524191300d6354d6a322ab0bca1d7c8ddfd01@95.216.223.149:26656,2fd76fae32f587eceb266dce19053b20fce4e846@207.154.220.138:26656,1d6a3c3d9ffc828b926f95592e15b1b59b5d8175@135.181.56.56:26656,fe2025284ad9517ee6e8b027024cf4ae17e320c9@198.244.164.11:26656,fcff172744c51684aaefc6fd3433eae275a2f31b@159.203.18.242:26656,f7b68a491bae4b10dbab09bb3a875781a01274a5@65.108.199.79:20356,6c076056fc80a813b26e24ba8d28fa374cd72777@149.102.153.197:26656,180378bab87c9cecea544eb406fcd8fcd2cbc21b@168.119.122.78:26656,88fa96d09a595a1208968727819367bd2fe8eabe@164.70.120.56:26656,84133cfde6e5fcaf5915436d56b3eef1d1996d17@45.132.245.56:26656,42b331adaa9ece4c455b92f0d26e3382e46d43f0@161.97.180.20:36656,c8c0456a5174ab082591a9466a6e0cb15c915a65@194.233.85.193:26656,6a62bf1f489a5231ddc320a2607ab2595558db75@154.12.240.49:26656,d0b19e4d133441fd41b4d74ac8de2138313ad49e@195.201.41.137:26656,bf199295d4c142ebf114232613d4796e6d81a8d0@159.69.110.238:26656,a46bbdb81e66c950e3cdbe5ee748a2d6bdb185dd@161.97.168.77:26656,831cd61b04ac95155f101723b851af53460d4d65@65.108.217.169:26656,550ab50ad0df01408928a3479e643286a47b4fc9@46.4.213.197:26656,43e9da043318a4ea0141259c17fcb06ecff816af@141.94.73.39:43656,45d0154bea2e0bbffec343894072f5feab19d242@65.108.71.92:43656,2e4084408b641a90c299a499c32874f0ab0f2956@65.108.44.149:22656,de6ba05f3ed583a12c396c182e5126ed65a32514@154.53.44.239:26656,d6fb487ff10d9878449beaa89007da15ec43057f@194.163.137.209:26656

Set Consensus Configuration Options

sed -i 's/timeout-commit = ".*/timeout-commit = "25s"/g' $HOME/.celestia-app/config/config.toml
sed -i 's/peer-gossip-sleep-duration *=.*/peer-gossip-sleep-duration = "2ms"/g' $HOME/.celestia-app/config/config.toml

Set P2P Configuration Options

max_num_inbound_peers=40 
max_num_outbound_peers=10 
max_connections=50 
sed -i -e "s/^use-legacy *=.*/use-legacy = false/;\
s/^max-num-inbound-peers *=.*/max-num-inbound-peers = $max_num_inbound_peers/;\
s/^max-num-outbound-peers *=.*/max-num-outbound-peers = $max_num_outbound_peers/;\
s/^max-connections *=.*/max-connections = $max_connections/" $HOME/.celestia-app/config/config.toml

above is the recommended settings since 0.0.6 release, these can be changed manually by

sudo nano $HOME/.celestia-app/config/config.toml

Other things recommended to change- from the 0.5.3 Release
use-legacy = false
pex = true
peer-gossip-sleep-duration=”2ms”

4. Configure Pruning

For lower disk space usage, recommend setting up pruning using the configurations below.

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

for pruning "100-0" you should disable snapshots to avoid conflict with 100-blocks pruning and 1500-blocks snapshot-interval

sed -i 's/snapshot-interval *=.*/snapshot-interval = 0/g' $HOME/.celestia-app/config/app.toml

Reset Before Starting the Node

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

Config Client

celestia-appd config chain-id $CELESTIA_CHAIN

creates an application CLI configuration file, needed for wallet later

celestia-appd config keyring-backend test

5. Quick Sync with Snapshot (Optional)

Syncing from Genesis can take a long time, depending on your hardware. Using this method you can synchronize your Celestia node very quickly by downloading a recent snapshot of the blockchain. If you would like to sync from the Genesis, then you can skip this part.

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

Takes about 10-15 mins to download

6. Start the Celestia-App with SystemD

Set up celestia-appd as a background process.

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 and start the process

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

Confirm its running

systemctl status celestia-appd

Output the Logs

journalctl -u celestia-appd.service -f

To Check for Sync State

curl -s localhost:26657/status | jq .result | jq .sync_info

Allow to sync before continuing

7. Create Wallet

If you need to create a wallet and connect to Mamaki Testnet network

Download Keplr and create wallet

Install Keplr for chrome, and follow the steps to ‘create new wallet’ remember to save your seed phrase.

Connect Keplr to Mamaki Network

https://aviaone.com/celestia-connect-wallet-keplr-testnet-mamaki.html
if you have kerplr installed and active, you will be prompted to connect network, allow this

Request Test Tokens from the Faucet

find your address on the Keplr app after selecting the correct network for Celestia (Mamaki), copy your address from Keplr and request from the Celestia discord (LINK) on the ‘faucet’ channel

$request celestia1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Import Wallet

celestia-appd keys add $CELESTIA_WALLET --recover

Enter Seed

save address and valoper address (validator) as variables. The valoper address is the wallets validator address, which appears in different format but derived from the same seed.

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

We can get our address by running the command below

celestia-appd keys show $CELESTIA_WALLET

to display wallets in stored within the node

celestia-appd keys list

To Delete old wallets

celestia-appd keys delete OLD_WALLET --keyring-backend=test

8. Create Validator and Run

Double Check that you are Synced before continuing

curl -s localhost:26657/status | grep block_height

Check Balance, also confirm wallet set correctly

celestia-appd q bank balances $CELESTIA_ADDR

Check Variables

echo $CELESTIA_NODENAME $CELESTIA_CHAIN $CELESTIA_WALLET

Connect Validator

1TIA = 1,000,000 uTIA

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="1" \
 --from=$CELESTIA_WALLET

This is for the first time creating validator, it will output a transaction is successful and you should be able to find in the block explorer to confirm its success.

Problems with this transaction may be a result of your node not being synced properly, double check, there’s additional ways to check sync under ‘Other commands’ section.

Download and save "$HOME/.celestia-app/config/priv_validator_key.json" to your PC!

This is important, to backup and recover your validator should you have a failure on this device. If you don’t know how to do this, there is a part on ‘Migration’ towards the end of this document, which describes the process on backing this up.

Other Commands

check validator

celestia-appd q staking validator $CELESTIA_VALOPER

Output active set

celestia-appd q staking validators --limit=3000 -oj \ | jq -r '.validators[] | select(.status=="BOND_STATUS_BONDED") | [(.tokens|tonumber / pow(10;6)), .description.moniker] | @csv' \ | column -t -s"," | tr -d '"'| sort -k1 -n -r | nl

Edit Avatar

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

Change Moniker

celestia-appd tx staking edit-validator --from=$CELESTIA_WALLET --new-moniker <new_moniker_here> --chain-id mamaki --fees 500utia

Delegate to Validator (including your own)

example from docs

celestia-appd tx staking delegate celestiavaloper1q3v5cugc8cdpud87u4zwy0a74uxkk6u43cv6hd <ammount>utia --from=$CELESTIA_WALLET --chain-id=mamaki

Block Explorer

View Logs Methods

journalctl -u celestia-appd.service -f
journalctl -u celestia-appd -f -o cat

Check Sync Methods

curl -s localhost:26657/status | jq .result | jq .sync_info
curl -s localhost:26657/status | grep block_height
this is the result of two ways to check sync, in this case an error with peers :0 resulting in the block height being off from the explorer
this is the result of two ways to check sync, in this case an error with peers :0 resulting in the block height being off from the explorer

Latest block height: your nodes latest block height this should match the explorer

Max peer block height: the max height of peers you are connected to, should be close to your own if you are connected to peers

Unjail

when your validator misses signing for a period it could end up in ‘jail’ basically you receive a penalty slash and kicked out of the active set, your validator will still be active but not earning rewards or producing blocks, until you manually unjail

celestia-appd tx slashing unjail --from=$CELESTIA_WALLET --chain-id mamaki --fees=4000utia --keyring-backend=test

Migration Procedure

Should you wish to migrate device to another, for a variety of reasons such as hardware failure/ upgrades or expected downtime. I’ve had to do this recently myself, so I am documenting a process for reference to minimise downtime.

  1. Backup Priv_validator_key.json

On the Old Device that you wish to retire Locate priv_validator_key.json it should be in here by default

cd .celestia-app/config
ls -la

copy to a backup folder, double check the username with, replace with yours

echo $USER
mkdir /home/<user>/backups
sudo cp /home/<user>/.celestia-app/config/priv_validator_key.json /home/<user>/backups

extract this file, the method I’m using is to copy the contents of the file carefully to an external device, assuming you are accessing the server via a local device

change permissions

sudo chown USER:USER /home/<user>/backups/priv_validator_key.json

Open the file for editing, in order to copy

sudo nano /home/<user>/backups/priv_validator_key.json

copy the contents carefully to a .txt file locally, to load onto the New server later.

NOTE: echo $CELESTIA_WALLET the variable set up in this device build, want to label to same in the next build. (keep CELESTIA_NODENAME consistent too)

2. Start Node & Sync New Server

follow the steps for a validator up until Create wallet (Step 7) allow this node to fully sync, use snapshot (Step 5) to do this for a fast migration.

3. Replace the Priv_validator_key.json on New Server

Stop the Node, IMPORTANT make sure you stop your node, before replacing the key

sudo systemctl stop celestia-appd

Open the priv_validator_key.json on the New Device for editing. In order to replace.

sudo nano /home/<user>/.celestia-app/config/priv_validator_key.json

replace the contents carefully with the old key data

4. Ensure our Old Node is Stopped

To avoid slashing with possible double signing, head back to the Old Device and make sure we are shut down

sudo systemctl stop celestia-appd

confirm

sudo systemctl status celestia-appd

To be extra safe, having already backed up the important files, delete old wallet

celestia-appd keys delete <your old wallet name> --keyring-backend=test
celestia-appd keys list

should display nothing

This device can be shut down, and reinstalled.

5. Recover Wallet on New Server

celestia-appd keys add $CELESTIA_WALLET --recover

Double check

celestia-appd keys list

check this is your wallet address, good idea to double check the environment variables and wallet output the same

6. Restart node on New Server

we don’t need to create a validator again, simply restart the service.

sudo systemctl daemon-reload
sudo systemctl start celestia-appd
journalctl -u celestia-appd.service -f

Upgrading Celestia - PENDING

Latest image at time of writing 0.6.0, any updated binaries (see announcements on discord) can be replaced.

Making Changes on a Running Node- PENDING

should you wish to change any settings such as P2P configuration settings

Stop Node

sudo systemctl stop celestia-appd
systemctl status celestia-appd
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.