Creating a Validator & Bridge node for Celestia

Staking4All
6 min readMay 15, 2023

--

Celestia is a modular consensus and data network, built to enable anyone to easily deploy their own blockchain with minimal overheads.

Installing a Celestia Validator

Below we have put together a video explaining and showing you how to create your own validator node on Celestia.

Continue reading to see all the steps and commands used in the video.

Step 1 — Install base node and setup Ubuntu

Create a node on your favourite cloud provider and install your preferred Linux operating system. For this guide we used Ubuntu version 20.04 LTS. To follow this guide easily, we recommend using Ubuntu as well. Make sure to update the packages. It is important to set up a firewall and add any ports we may need.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ufw
sudo ufw allow 22/tcp
sudo ufw allow 26656/tcp
sudo ufw enable
sudo ufw status

Install Git as well as the other packages required for the Celestia node set up.

--install git
sudo apt-get install git
--install pre-requisites
sudo apt install build-essential jq -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential git make ncdu -y

Step 2 — Create a user

We create a user that we will utilise for the rest of the installation. It is not good practice to use the root user.

--create user
sudo adduser celestia
sudo usermod -a -G sudo celestia
su — celestia

Step 3 — Install binary

We start by installing the latest version of Go.

ver="1.20.1" 
cd $HOME
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

Next we clone the Celestia code repository and build the binary.

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

celestia-appd --help

Step 4 — Configure Validator

Create your validator wallet and be sure to save your mnemonic key as well as your wallet address. It is very important to save this in a safe place.

celestia-appd keys add <wallet.name>

Initialise data in daemon’s home directory and then download the genesis file.

--Initialise
celestia-appd init training-validator --chain-id blockspacerace-0

--Download genesis
wget -O $HOME/.celestia-app/config/genesis.json "https://raw.githubusercontent.com/celestiaorg/networks/master/blockspacerace/genesis.json"

Now we add the persistent peers and seeds in the config file.

--add seeds and peers
SEEDS="0293f2cf7184da95bc6ea6ff31c7e97578b9c7ff@65.109.106.95:26656,8f14ec71e1d712c912c27485a169c2519628cfb6@celest-test-seed.theamsolutions.info:22256"
PEERS="be935b5942fd13c739983a53416006c83837a4d2@178.170.47.171:26656,cea09c9ac235a143d4b6a9d1ba5df6902b2bc2bd@95.214.54.28:20656,5c9cfba00df2aaa9f9fe26952e4bf912e3f1e8ee@195.3.221.5:26656,7b2f4cb70f04f2e9befb6ace66ce1ac7b3bea5b4@178.239.197.179:26656,7ee2ba21197d58679cfc1517b5bbc6465bed387a@65.109.67.25:26656,dc0656ab58280d641c8d10311d86627255bec8a1@148.251.85.27:26656,ccbd6262d0324e2e858594b639f4296cc4952c93@13.57.127.89:26656,a507b2bda6d2974c84ae1e8a8b788fc9e44d01f7@142.132.131.184:26656,9768290c60a746ee97ef1a5bcb8bee69066475e8@65.109.80.150:2600"
sed -i -e 's|^seeds *=.*|seeds = "'$SEEDS'"|; s|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.celestia-app/config/config.toml
sed -i -e "s/^seed_mode *=.*/seed_mode = \"$SEED_MODE\"/" $HOME/.celestia-app/config/config.toml

--will update the below file, can nano to view changes
nano $HOME/.celestia-app/config/config.toml

Step 5 — Start and test the node, then create a service

We start and test our node on the command line to make sure it is working. It will start looking for peers and then start syncing.

celestia-appd start

Once we see it is working, we stop the node by typing Ctrl+c . Then create a systemd service that can run in the background.

sudo nano /etc/systemd/system/celestia-appd.service
[Unit]
Description=celestia-appd Cosmos daemon
After=network-online.target
[Service]
User=celestia
ExecStart=/home/celestia/go/bin/celestia-appd start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target

Start the service and check service status.

sudo service celestia-appd start
sudo service celestia-appd status

This command is used to check the logs of the node that is now running in the background.

journalctl -f -u celestia-appd.service

Step 6 — Wait for your node to sync

We use this command to check the node sync status, pay attention to the ‘latest block height’ parameter, it will increment as you sync new blocks. You will see that the ‘catching up’ parameter is true, this means that the node is not yet in sync with the Celestia network. It will take several hours for your node to sync.

You can run this command again every few hours to check your node sync status. When you see that the ‘catching up’ parameter is ‘false’ and the ‘latest block height’ parameter is the same as Celestia network’s latest block, your node is in sync.

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

It is possible to sync the node faster using snapshots or statesync, we do not cover this in this guide.

Step 7 — Get Testnet tokens

We need to get testnet tokens for our wallet. Let’s check our wallet balance, you will see that the balance is zero.

celestia-appd query bank balances <insert.your.wallet.address>

Go to the Celestia faucet in the Celestia Discord server to collect testnet tokens. Just follow the steps. Now check your wallet balance again to make sure you have received the tokens.

Step 8 — Create validator

Now that we have our testnet tokens, we can create our validator. Remember to replace <wallet.name> with your own wallet name that you created earlier.

celestia-appd tx staking create-validator \
--amount=1000000utia \
--pubkey=$(celestia-appd tendermint show-validator) \
--moniker=<insert.your.validator.name> \
--chain-id=blockspacerace-0 \
--commission-rate=0.1 \
--commission-max-rate=0.2 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1000000 \
--from=training-validator \
--evm-address=<insert.your.eth.wallet.address> \
--fees 600utia \
--gas auto \
--gas-adjustment 1.4

You can visit the Celestia explorer and view the active validators in the validator section. Your node will only be visible here when you have accumulated enough delegations to be in the top 100. Navigate to the ‘inactive’ section and search for your validator name. Your validator will be visible here until you get enough delegations to move to the ‘active’ list.

Installing Celestia Bridge Node

Here is a video for you to follow and visually see how to install the Celestia Bridge node.

If videos are not your thing, below are the steps

Step 1 — Install Binary

The Celestia bridge uses a different binary. You therefore need to download and build this respective binary.

cd $HOME 
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.9.4
make build
make install
make cel-key

--check the version
celestia version

Step 2— Initialise the Celestia Bridge

Some keys are created in this process. Ensure to back them up.

celestia bridge init --core.ip 127.0.0.1 --p2p.network blockspacerace

Step 3— Start and test the node, then create a service

You can then do a quick test with this.

celestia bridge start --core.ip 127.0.0.1 --p2p.network blockspacerace

We can then create systemd service to run this more efficiently.

sudo nano /etc/systemd/system/celestia-bridge.service

Add these contents in the file.

[Unit]
Description=celestia-appd Cosmos daemon
After=network-online.target
[Service]
User=$USER
ExecStart=/home/celestia/celestia-node/build/celestia bridge start --core.ip 127.0.0.1 --p2p.network blockspacerace --metrics.tls=false --metrics --metrics.endpoint otel.celestia.tools:4318
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target

Then you can start your service.

sudo systemctl enable celestia-bridge
sudo systemctl start celestia-bridge

You now have a successful bridge running.

Monitor Your Validator Node

Once you up and running you can now monitor your validator node with our Telegram bot 🤖

About Staking4All

Staking4All provides non-custodial delegation services to Proof-of-Stake public blockchains. We enable cryptocurrency holders to take part in decentralized governance while holding onto and earning interest from their cryptocurrencies.

We are an experienced staking service provider for blockchain projects. Join our community today and earn rewards for helping secure networks.

Visit our Website, Twitter or our Blog to learn more about Staking4all.

--

--