celestia-tools/guides/bridge/README.md
Navigation
Navigation
- Hardware requirements
- 1. Create a
celestia-bridgeuser - 2. Update and install packages
- 3. Install Go
- 4. Clone
celestia-noderepository - 5. Build the
celestiabinary - 6. Install it
- 7. Build
cel-keybinary for birdge's keys managment - 8. Initialize a bridge node
- 9. Make sure to make a backup of the menomic
- 11. You can check your wallet address by running the following command
- 12. Increase Buffer Sizes
- 13. Create a systemd service file
- 14. Start the service
- 15. Logs example
- 16. Fund your wallet with a few TIA tokens HERE and check the balance
- 17. Get your auth token to make RPC requests
- 18. Get your Node ID
- 19. Setup a monitoring & alerting using our solution with Datadog dashboard
- 1. Create a
- Useful commands
Hardware requirements
- Memory: 4 GB RAM (minimum)
- CPU: 6 cores
- Disk: 10 TB SSD Storage
- Bandwidth: 1 Gbps for Download/1 Gbps for Upload
- Ubuntu Linux 20.04 (LTS)
1. Create a celestia-bridge user
sudo useradd celestia-bridge -m -s /bin/bash -p ""
sudo usermod -aG sudo celestia-bridge
sudo su - celestia-bridge
2. Update and install packages
sudo apt update && sudo apt upgrade -y && \
sudo apt install curl tar wget clang pkg-config libssl-dev libleveldb-dev jq build-essential bsdmainutils git make ncdu htop unzip bc fail2ban htop -y
3. Install Go
cd $HOME && \
ver="1.21.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" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
4. Clone celestia-node repository
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node
git checkout tags/v0.12.4
5. Build the celestia binary
make build
6. Install it
# This will put celestia bin the /usr/local/bin/ dir
sudo make install
# Make sure it works
celestia version
7. Build cel-key binary for birdge's keys managment
make cel-key
sudo mv ./cel-key /usr/local/bin/
# Make sure it works
cel-key help
8. Initialize a bridge node
# It will generate a new wallet named my_celes_key
cd $HOME
celestia bridge init --core.ip rpc-celestia-mocha.trusted-point.com --p2p.network mocha
9. Make sure to make a backup of the menomic
NAME: my_celes_key
ADDRESS: celestia1rhw4ddktqh83ryw1wq4cnl5jt6ln65n0wv3f432
MNEMONIC (save this somewhere safe!!!):
ritual gym delay inspire load ....
11. You can check your wallet address by running the following command
cel-key list --keyring-backend test --node.type bridge --keyring-dir $HOME/.celestia-bridge-mocha-4/keys
12. Increase Buffer Sizes
sudo sysctl -w net.core.rmem_max=2500000
sudo sysctl -w net.core.rmem_max=2500000
13. Create a systemd service file
sudo tee <<EOF >/dev/null /etc/systemd/system/celestia-bridge.service
[Unit]
Description=Celestia Bridge Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which celestia) bridge start --core.ip rpc-celestia-mocha.trusted-point.com --p2p.network mocha-4 --core.grpc.port 9099 --core.rpc.port 26698 --keyring.accname my_celes_key --node.store $HOME/.celestia-bridge-mocha-4
Restart=on-failure
RestartSec=3
LimitNOFILE=1400000
[Install]
WantedBy=multi-user.target
EOF
14. Start the service
sudo systemctl enable celestia-bridge && \
sudo systemctl start celestia-bridge && \
sudo journalctl -u celestia-bridge.service -f -o cat
15. Logs example
16. Fund your wallet with a few TIA tokens HERE and check the balance
celestia state balance --node.store /home/celestia-mocha-bridge/.celestia-bridge-mocha-4
Example output:
#{
# "result": {
# "denom": "utia",
# "amount": "10000000"
# }
#}
To make this call you need to make sure Gateway is enabled in /home/celestia-mocha-bridge/.celestia-bridge-mocha-4/config.toml
# [Gateway]
# Address = "localhost"
# Port = "26659"
# Enabled = true
17. Get your auth token to make RPC requests
TOKEN=$(celestia bridge auth admin --p2p.network mocha-4)
echo $TOKEN
18. Get your Node ID
curl -X POST \
-s \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":0,"method":"p2p.Info","params":[]}' \
http://localhost:26658 | jq .result.ID
19. Setup a monitoring & alerting using our solution with Datadog dashboard
Useful commands
Restart
sudo systemctl restart celestia-bridge
Stop
sudo systemctl stop celestia-bridge
Check logs
sudo journalctl -u celestia-bridge.service -f -o cat
Upgrade celstia-node
cd celestia-node
git fetch
git checkout tags/<version>
make build
make install
# Check th version
celestia --version
# Restrt the node
sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge.service -f -o cat
Get your Node ID
TOKEN=$(celestia bridge auth admin --p2p.network mocha-4)
echo $TOKEN
curl -X POST \
-s \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":0,"method":"p2p.Info","params":[]}' \
http://localhost:26658 | jq .result.ID
Get Bridge's local height
curl -X POST \
-s \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":0,"method":"header.LocalHead","params":[]}' \
http://localhost:26658 | jq .result.header.height
Get Bridge's network height
curl -X POST \
-s \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":0,"method":"header.NetworkHead","params":[]}' \
http://localhost:26658 | jq .result.header.height
Check balance
celestia state balance --node.store /home/celestia-mocha-bridge/.celestia-bridge-mocha-4
Example output:
#{
# "result": {
# "denom": "utia",
# "amount": "10000000"
# }
#}
To make this call you need to make sure Gateway is enabled in /home/celestia-mocha-bridge/.celestia-bridge-mocha-4/config.toml
# [Gateway]
# Address = "localhost"
# Port = "26659"
# Enabled = true
Delete the node
# DO NOT FORGET TO BACKUP YOUR KEYS at /home/celestia-bridge/.celestia-bridge-mocha-4/keys/
sudo su - celestia-bridge
sudo systemctl stop celestia-bridge && \
sudo systemctl disable celestia-bridge && \
sudo rm /etc/systemd/system/celestia-bridge.service && \
sudo rm -rf celestia-node .celestia-bridge-mocha-4


