Celestia Bridge Node Setup

Install dependencies

Install all required packages for building and running the node (compilers, utilities, monitoring tools, compression libraries).

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make gcc tar clang pkg-config libssl-dev ncdu -y

Install Go

Install Go (programming language required for building the node). Make sure you set the correct version.

cd $HOME
VER="1.24.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"

Clone repository and build

Set the required version

export VER=

Download the Celestia Node source code, switch to the desired version, and build the binary.

cd $HOME
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout $VER
make build

Build cel-key for key management.

make cel-key
mv cel-key /usr/local/bin/

Initialize the node.

Add new wallet(key) for the node.

export WALLET_NAME=
cel-key add $WALLET_NAME --keyring-backend test --node.type bridge

Init the node with your archive RPC GRPC_CONSESUS_NODE_IP and GRPC_CONSESUS_NODE_PORT and wallet(key).

$HOME/celestia-node/build/celestia bridge init -core.ip <GRPC_CONSESUS_NODE_IP>  --core.port <GRPC_CONSESUS_NODE_PORT> --keyring.keyname $WALLET_NAME

Create folder structure for releases and copy binary

Organize binaries by version, move the built binary, and create a symlink for the active release.

mkdir -p $HOME/.celestia-node/releases/$VER/bin
mv $HOME/celestia-node/build/celestia $HOME/.celestia-node/releases/$VER/bin
ln -sfn $HOME/.celestia-node/releases/$VER $HOME/.celestia-node/active-release

ℹ️ During the next upgrade, create a new subfolder for the new binary inside the releases folder and simply update the active-release symlink to point to this new binary’s folder.
This approach is convenient for both automatic and manual updates, as well as for quickly rolling back to the previous version.

Set PATH environment

Add the active-release binary folder to your PATH so you can run celestia from anywhere.

echo "export PATH=${HOME}/.celestia-node/active-release/bin:\$PATH" >> $HOME/.profile
source $HOME/.profile

Create systemd service

Create a systemd service file for auto-start and managing the node.

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

[Service]
User=$USER
Restart=on-failure
RestartSec=3
LimitNOFILE=1000000

ExecStart=$(which celestia) bridge start \  
--p2p.network mocha \  
--archival \  
--metrics.tls=true --metrics --metrics.endpoint otel.mocha.celestia.observer

[Install]
WantedBy=multi-user.target
EOF

Start the node

Reload systemd configs, enable the service at boot, start the node and follow logs.

systemctl daemon-reload
systemctl enable celestia-bridge
systemctl restart celestia-bridge && journalctl -o cat -fu celestia-bridge

Check node status

Get the current node height, network head, and lag:

echo "Node height: $(celestia header sync-state --node.store /nodes/celestia-bridge/ | jq -r '.result.height'); \
Network head: $(celestia header network-head --node.store /nodes/celestia-bridge/ | jq -r '.result.header.height')" | \
awk -F'[: ]+' '{print $1" "$2": "$3"\n"$4" "$5": "$6"\nLag: "($6-$3)}'