Setting up a Celestia Node, its Bridge and monitoring the whole thing with tenderduty

peloclick
5 min readMay 14, 2023

I was lucky enough to be selected as one of the validators of the Celestia incentiviced testnet, with the validator role.

As part of that role, one of the duties was, as expected, setting up the validator, its bridge, going through different updates and monitoring the performance of the whole setup.

The process is simple if you have some basic Linux knowledge. First we will setup the validator, then the bridge and then the monitoring.

The validator is the consensus part of the blockchain. The bridge node bridges blocks between the data availability network and the blockchain thus connecting the data availability layer and the consensus layer.

First, setup a basic Ubuntu Linux 20.04 setup knowing the recommended specs, using bare metal or a VPS, your choice:

Memory: 8 GB RAM
CPU: 6 cores
Disk: 500 GB SSD or NVMe Storage + 1Tb for the bridge
Bandwidth: 1 Gbps for Download/1 Gbps for Upload

In my case I went for the same hardware, where both the validator as well as the bridge run together, but they can be running on different machines.

First, we update our OS with:

sudo apt update && sudo apt upgrade -y

And then we install GoLang with:

ver=”1.20.2"
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

We can verify that the install went well with the command go version

Now, once the system is setup with the basics, we are going to install the celestia node app.

cd $HOME
rm -rf celestia-app (to be sure that no older version is there)
git clone https://github.com/celestiaorg/celestia-app.git
cd celestia-app/
APP_VERSION=v0.13.0 (or whichever version is the latest)
git checkout tags/$APP_VERSION -b $APP_VERSION
make install (this will compile the binary for our system and bring it to the go binaries path)

Now, we can check that the celestia-app binary has been properly compiled. Just use celestia-appd version to check it out

It is time to continue creating our validator. Since the celestia binary can be the same for the incentivized testnet (blockspace race), as well as for the mocha testnet, we are going to clone the files we need for the blockspace race:

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

Then we can init the chain, so that the basic files and configurations are created:

celestia-appd init “BloClick” — chain-id blockspacerace-0

(Where BloClick is the moniker you want to use)

Then we place the needed genesis file in its proper place, replacing that one that we’ve just created when we inited the chain:

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

To be sure that we set the install to use the genesis we’ve just moved, I recommend running this command:

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

Now, to be sure that Celestia starts again in case our node gets restarted or if the binary fails for any reason, it is totally recommended to setup celestia as a service. For that, we gotta use this sample:

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

[Service]
User=$USER
ExecStart=$HOME/go/bin/celestia-appd start
Restart=on-failure
RestartSec=5
LimitNOFILE=10000

[Install]
WantedBy=multi-user.target
EOF

And then, we can enable the service and start it:

sudo systemctl enable celestia-appd && sudo systemctl start celestia-appd && journalctl -u celestia-appd.service -f -o cat

We will see the node start syncing up. Since the chain might be running since some time ago, we gotta wait for it to sync. To check the status of our node we can check the block number against mintscan or any other blockchain explorer.

In the meantime, we are going to create a wallet:

celestia-appd keys add bloclick (Save your seeds!)

Where bloclick is the name of the wallet we want to use. The wallet needs funding with a faucet or with anybody else sending some tokens to us.

Once the node is synced up, we gotta create our validator:

celestia-appd tx staking create-validator \
— amount=10000000utia \
— pubkey=$(celestia-appd tendermint show-validator) \
— moniker=BloClick \
— chain-id=blockspacerace-0 \
— commission-rate=”0.05" \
— commission-max-rate=”0.20" \
— commission-max-change-rate=”0.1" \
— min-self-delegation=”1" \
— from=bloclick \
— evm-address=<Evm-address>

The Evm Address can be any EVM Address you have the private key of. For example, a new wallet (recommended) created in Metamask.

Now, it is time to continue with the Bridge

Once again, we gotta clone the repo of the bridge version we want to use:

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

Now that the bridge binaries are installed, we gotta init the bridge itself:

celestia bridge init — core.ip localhost — core.rpc.port 26657 — core.grpc.port 9090 — p2p.network blockspacerace

The bridge key needs funding too. To check its address run:

./cel-key list — node.type bridge — keyring-backend test — p2p.network blockspacerace

Similarly to the celestia node, we gotta setup a service for the bridge:

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

[Service]
User=$USER
ExecStart=/usr/local/bin/celestia bridge start — core.ip localhost — core.rpc.port 26657 — core.grpc.port 9090 — keyring.accname bloclick — metrics.tls=false — p2p.network blockspacerace
Restart=on-failure
RestartSec=3
LimitNOFILE=10000

[Install]
WantedBy=multi-user.target
EOF

Now we will enable and start the service with:

sudo systemctl enable cel-bridge && sudo systemctl start cel-bridge && journalctl -u cel-bridge -f -o cat

Don’t forget to save your mnemonics, as well as the priv_validator_key.json inside of the .celestia-app/config folder.

Lastly, we will setup Tenderduty on a different server to have some simple monitoring of the health of our node:

cd $HOME
git clone https://github.com/blockpane/tenderduty
cd tenderduty
go install
cp example-config.yml config.yml

We gotta configure tenderduty for our validator:

nano config.yml

where we will set:

chain_id: blockspacerace-0
valoper_address: our valoper in celestia

Since I have setup an RPC as well, I will use my own RPC in the configuration, but you can just use any of the shared RPCs to check the status of your node. It is a bad idea to use the same validator as an RPC.

Then save your changes and setup tenderduty as a service too:

sudo tee /etc/systemd/system/tenderduty.service << EOF
[Unit]
Description=Tenderduty for Celestia
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=5
TimeoutSec=180

User=ubuntu
WorkingDirectory=$HOME/tenderduty
ExecStart=$(which tenderduty)
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF

Then enable it as we did with the other services.

If we open the ip of the server where we’ve installed tenderduty, on the default port 8888 of tenderduty we will see the typical interface of it. Of course the same install can be used for many cosmos-tendermint based chains, as it is my case:

Feel free to ping me if you face any trouble while setting anything up!

--

--