Bridge Node Setup for Celestia Mainnet - celestia
Setting up a bridge node
Update packages and Install dependencies:
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 :
cd ~
! [ -x "$(command -v go)" ] && {
VER="1.22.6"
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"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source ~/.bash_profile
}
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
go version
Install Celestia-node:
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.20.4
make build
sudo make install
make cel-key
Config and init app:
celestia bridge init --core.ip <RPC_NODE_IP>
Once you start the Bridge Node, a wallet key will be generated for you. You will need to fund that address with Mainnet tokens to pay for PayForBlob transactions. You can find the address by running the following command:
cd $HOME/celestia-node
./cel-key list --node.type bridge --keyring-backend test
Create Service file:
sudo tee /etc/systemd/system/celestia-bridge.service > /dev/null <<EOF
[Unit]
Description=celestia Bridge
After=network-online.target
[Service]
User=$USER
ExecStart=$(which celestia) bridge start --archival \
--metrics.tls=true --metrics --metrics.endpoint otel.celestia.observer
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Enable and start service:
sudo systemctl daemon-reload
sudo systemctl enable celestia-bridge
sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge -fo cat
Get your node's peerId information:
❗NOTE: You can only generate an auth token after initializing and starting your celestia-node.
NODE_TYPE=bridge
AUTH_TOKEN=$(celestia $NODE_TYPE auth admin)
Then you can get the peerId of your node with the following curl command:
curl -X POST \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":0,"method":"p2p.Info","params":[]}' \
http://localhost:26658
Bridge Node Snapshot (Shwap, Archive)
updated every available 24/7 (every server stores last 2 snapshots)
height: null agosize: B
# install dependencies, if needed
sudo apt install aria2 jq lz4 unzip -y
Download and unpack snapshot
cd $HOME
aria2c -x 16 -s 16 -o celestia-bridge-snap.tar.lz4 https://server-9.itrocket.net/mainnet/celestia/bridge/null
sudo systemctl stop celestia-bridge
rm -rf ~/.celestia-bridge/{blocks,data,index,inverted_index,transients,.lock}
tar -I lz4 -xvf ~/celestia-bridge-snap.tar.lz4 -C ~/.celestia-bridge/
sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge -fo cat
Delete snapshot file
rm ~/celestia-bridge-snap.tar.lz4
Cheat sheet
Check bridge wallet balance:
celestia state balance --node.store ~/.celestia-bridge/
Get wallet address:
cd $HOME/celestia-node
./cel-key list --node.type bridge --keyring-backend test
Restore an existing cel_key:
KEY_NAME="my_celes_key"
cd ~/celestia-node
./cel-key add $KEY_NAME --keyring-backend test --node.type bridge --recover
Check bridge node status:
celestia header sync-state --node.store ~/.celestia-bridge/
Get Node ID:
celestia p2p info --node.store ~/.celestia-bridge/
(Optional) Add permissions for transferring keys to another server:
chmod -R 700 ~/.celestia-bridge
Reset node:
celestia bridge unsafe-reset-store
Upgrade
Stop bridge node:
sudo systemctl stop celestia-bridge
Download binary:
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.20.4
make build
sudo make install
make cel-key
Update:
celestia bridge config-update
Start bridge node:
sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge -fo cat
Delete bridge node
sudo systemctl stop celestia-bridge
sudo systemctl disable celestia-bridge
sudo rm /etc/systemd/system/celestia-bridge*
rm -rf $HOME/celestia-node $HOME/.celestia-bridge