Bridge Node Setup for Mocha Testnet (mocha-4)
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.23.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"
[ ! -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-mocha
make build
sudo make install
make cel-key
Config and init app:
celestia bridge init --core.ip <RPC_NODE_IP> --p2p.network mocha
Once you start the Bridge Node, a wallet key will be generated for you. You will need to fund that address with Testnet 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 --p2p.network mocha
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 \
--p2p.network mocha --archival \
--metrics.tls=true --metrics --metrics.endpoint otel.celestia-mocha.com
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 --p2p.network mocha)
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-8.itrocket.net/testnet/celestia/bridge/null
sudo systemctl stop celestia-bridge
rm -rf ~/.celestia-bridge-mocha-4/{blocks,data,index,inverted_index,transients,.lock}
tar -I lz4 -xvf ~/celestia-bridge-snap.tar.lz4 -C ~/.celestia-bridge-mocha-4/
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-mocha-4/
Get wallet address:
cd $HOME/celestia-node
./cel-key list --node.type bridge --keyring-backend test --p2p.network mocha
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 --p2p.network mocha
Check bridge node status:
celestia header sync-state --node.store ~/.celestia-bridge-mocha-4/
Get Node ID:
celestia p2p info --node.store ~/.celestia-bridge-mocha-4/
(Optional) Add permissions for transferring keys to another server:
chmod -R 700 ~/.celestia-bridge-mocha-4
Reset node:
celestia bridge unsafe-reset-store --p2p.network mocha
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-mocha
make build
sudo make install
make cel-key
Update:
celestia bridge config-update --p2p.network mocha
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-mocha-4