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 -yInstall :
cd ~
! [ -x "$(command -v go)" ] && {
VER="1.25.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 versionInstall Celestia-node:
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.28.5-mocha
make build
sudo make install
make cel-keyConfig and init app:
celestia bridge init --core.ip <RPC_NODE_IP> --p2p.network mochaOnce 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 mochaCreate 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.mocha.celestia.observer
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOFEnable and start service:
sudo systemctl daemon-reload
sudo systemctl enable celestia-bridge
sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge -fo catGet 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:26658Cheat 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 mochaRestore 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 mochaCheck 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-4Reset node:
celestia bridge unsafe-reset-store --p2p.network mochaUpgrade
Stop bridge node:
sudo systemctl stop celestia-bridgeDownload binary:
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.28.5-mocha
make build
sudo make install
make cel-keyUpdate:
celestia bridge config-update --p2p.network mochaStart bridge node:
sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge -fo catDelete 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