# Celestia - Bridge Node

Type of node: **Bridge Node**

ChainID: **mocha-4**

## Resources

|         |                                         |
| ------- | --------------------------------------- |
| Website | <https://celestia.org/>                 |
| Github  | <https://github.com/celestiaorg/>       |
| x.com   | <https://x.com/CelestiaOrg>             |
| Discord | <https://discord.com/invite/YsnTPcSfWQ> |
| Docs    | <https://docs.celestia.org/>            |

## Hardware requirements

<table data-view="cards"><thead><tr><th>CPU</th><th>RAM</th><th>Storage</th><th>Network</th><th>OS</th></tr></thead><tbody><tr><td>8 cores</td><td>64 GB</td><td>10 TB SSD</td><td>1 Gbps</td><td>Linux (Ubuntu 20.04 x64)</td></tr></tbody></table>

## Installation 💾

Install dependencies

```bash
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 1.22.2

```bash
sudo rm -rf /usr/local/go && \
curl -L https://go.dev/dl/go1.22.2.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local && \
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && \
source .bash_profile && \
go version
```

Install celestia-node

```bash
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.28.4-mocha
make build
sudo make install
make cel-key
```

Init app

{% hint style="info" %}
you can find other core-ip if this one stops working - <https://docs.celestia.org/nodes/mocha-testnet#rpc-endpoints>
{% endhint %}

```bash
celestia bridge init --core.ip full.consensus.mocha-4.celestia-mocha.com --p2p.network mocha
```

Next, we get the address of the wallet to be funded. To pay for transactions

```bash
cd $HOME/celestia-node
./cel-key list --node.type bridge --keyring-backend test --p2p.network mocha
```

Request tokens from the faucet 🆓

> Request tokens from discord "faucet" channel <https://discord.com/invite/YsnTPcSfWQ>

Create service file

```bash
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
EOF
```

Enable and start service

```bash
sudo systemctl daemon-reload
sudo systemctl enable celestia-bridge && sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge -f
```

**Get your node's peerID**

```bash
NODE_TYPE=bridge
AUTH_TOKEN=$(celestia $NODE_TYPE auth admin --p2p.network mocha)

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
```

Get NodeID

```bash
celestia p2p info --node.store $HOME/.celestia-bridge-mocha-4/
```

## Useful commands ⚙️

Check bridge node status

```bash
celestia header sync-state --url "http://127.0.0.1:26657" --node.store $HOME/.celestia-bridge-mocha-4/
```

Check bridge wallet balance

```bash
celestia state balance --url "http://127.0.0.1:26657" --node.store $HOME/.celestia-bridge-mocha-4/ 
```

## Upgrade Bridge Node

Stop bridge node

```bash
sudo systemctl stop celestia-bridge
```

Download and install new binary

```bash
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.25.2-mocha  
make build 
sudo make install 
make cel-key
```

Update config

```bash
celestia bridge config-update --p2p.network mocha
```

Start bridge node

```bash
sudo systemctl restart celestia-bridge && sudo journalctl -u celestia-bridge -f
```

## Delete node 🗑️

```bash
sudo systemctl stop celestia-bridge && sudo systemctl disable celestia-bridge
sudo rm /etc/systemd/system/celestia-bridge*
rm -rf $HOME/celestia-node $HOME/.celestia-app $HOME/.celestia-bridge-mocha-4
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cryptomolot.gitbook.io/cryptomolot-docs/testnets/celestia/celestia-bridge-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
