Skip to content

Celestia Node Setup Guide for Mocha Testnet

Celestia is a modular data availability network that securely scales with the number of users, making it easy for anyone to launch their own blockchain. By decoupling execution from consensus and introducing data availability sampling (DAS), Celestia enables a new generation of scalable blockchain architectures.

The following minimum hardware specifications are recommended for running a Celestia validator node:

ComponentMinimum Requirement
Memory8 GB RAM
CPU6 Cores
Disk500 GB SSD Storage
Bandwidth1 Gbps Download / 1 Gbps Upload

Update the local package index and install the necessary dependencies for building the Celestia binary.

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

Celestia requires Go. The following block installs version 1.21.1 and configures your shell profile.

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

Clone the official repository and build the celestia-appd binary from source.

Terminal window
cd $HOME
git clone https://github.com/celestiaorg/celestia-app.git
cd celestia-app
git checkout tags/v1.11.0 -b v1.11.0
make install

Initialize the configuration files for the Mocha testnet.

Terminal window
celestia-appd init "your-node-name" --chain-id mocha-4
celestia-appd config chain-id mocha-4
celestia-appd config keyring-backend test

Download the genesis file and configure gas prices, address books, and peers.

Terminal window
# Genesis and Gas
curl -Ls https://raw.githubusercontent.com/celestiaorg/networks/master/mocha-4/genesis.json > $HOME/.celestia-app/config/genesis.json
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.002utia\"|" $HOME/.celestia-app/config/app.toml
# Addrbook and Peers
curl -Ls https://snapshots.kjnodes.com/celestia-testnet/addrbook.json > $HOME/.celestia-app/config/addrbook.json
SEEDS="9aa8a73ea9364aa3cf7806d4dd25b6aed88d8152@celestia-testnet.seed.mzonder.com:11156"
PEERS="77244576dd7734b5f0b07a24a5d9a9ac3f6bd3d1@141.94.135.203:26656,59b72c3ef197ee18371a7bf2de5be0065e516843@62.171.148.127:26656,7c841f59c35d70d9f1472d7d2a76a11eefb7f51f@136.243.69.100:43656"
sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" $HOME/.celestia-app/config/config.toml
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.celestia-app/config/config.toml

To save disk space, configure custom pruning and disable the indexer if it is not required for your use case.

Terminal window
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
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.celestia-app/config/config.toml

Create a systemd service file to manage the node lifecycle and ensure it restarts automatically on failure.

Terminal window
sudo tee /etc/systemd/system/celestia-appd.service > /dev/null <<EOF
[Unit]
Description=Celestia Validator Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which celestia-appd) start --home $HOME/.celestia-app
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable celestia-appd

Accelerate the synchronization process by using a recent snapshot.

Terminal window
sudo systemctl stop celestia-appd
# Backup original state
cp $HOME/.celestia-app/data/priv_validator_state.json $HOME/.celestia-app/priv_validator_state.json.backup
# Reset and Download Snapshot
celestia-appd tendermint unsafe-reset-all --home $HOME/.celestia-app --keep-addr-book
curl -L https://snapshots.kjnodes.com/celestia-testnet/snapshot_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.celestia-app
# Restore state and start
mv $HOME/.celestia-app/priv_validator_state.json.backup $HOME/.celestia-app/data/priv_validator_state.json
sudo systemctl restart celestia-appd

Create a new wallet or recover an existing one. Ensure you save your mnemonic seed phrase.

Terminal window
celestia-appd keys add wallet

Before creating a validator, ensure your node is fully synchronized with the network.

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

Note: Proceed only if the output above is false.

Execute the staking transaction to register your node as a validator.

Terminal window
celestia-appd tx staking create-validator \
--amount=1000000utia \
--pubkey=$(celestia-appd tendermint show-validator) \
--moniker="Your_Moniker" \
--chain-id=mocha-4 \
--commission-rate=0.1 \
--commission-max-rate=0.2 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1000000 \
--from=wallet \
--keyring-backend=test \
--fees=36000utia \
--gas-adjustment=1.5 \
--gas=500000 \
-y