# Celestia Bridge Node - Mocha

By [GLCstaked](https://paragraph.com/@glcstaked) · 2023-01-03

---

**Set up guide for a Bridge Node on Celestia Mocha Testnet**

Bridge nodes connect the data availability layer and the consensus layer while also having the option of becoming a validator. Validators do not have to run bridge nodes, but are encouraged to in order to relay blocks to the data availability network.

**Bridge Node Functions**

*   Import and process “raw” headers & blocks from a trusted Core process (meaning a trusted RPC connection to a celestia-core node) in the Consensus network.
    
*   Validate and erasure code the “raw” blocks
    
*   Supply block shares with data availability headers to Light Nodes in the DA network.
    

**Hardware Requirements**:

4vCPU / 8GB RAM / 250GB SSD / 1 Gbps Download/100 Mbps Upload OS: Ubuntu Linux 20.04 (LTS) x64

See Official guides for [Celestia on setting up a Bridge node here](https://docs.celestia.org/nodes/bridge-node/), This document is designed for an easy step by step setup

1\. Install Celestia-node
-------------------------

**Dependencies**

This will require the same prerequisite software dependencies **installed in** **Step 1** of the Validator Node guide, this guide is intended for running a Bridge node in parallel to a Validator/full node, so should already be installed. However this could be run separate.

[https://mirror.xyz/0xf3bF9DDbA413825E5DdF92D15b09C2AbD8d190dd/AM4qp-HcHmTDu3rFLVyQVBGlqnSeLElKzrZ\_iSoFHW4](https://mirror.xyz/0xf3bF9DDbA413825E5DdF92D15b09C2AbD8d190dd/AM4qp-HcHmTDu3rFLVyQVBGlqnSeLElKzrZ_iSoFHW4)

**Change to root**

    sudo -i
    

**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.6.1
    make install
    make cel-key
    

You should be in `celestia-node` directory, verify installed correctly

![](https://storage.googleapis.com/papyrus_images/39303bafa7841c1cce5f269b203d09d8ce2ac601c69bd0136c10f0f47aa97cbb.png)

**_NOTE: celestia app_** _is what was installed for validator node_

2\. Initialise the Bridge node
------------------------------

    celestia bridge init --core.ip <ip-address>:<port>
    

`--core.ip` port defaults to 9090, RPC Endpoints can be found [here](https://docs.celestia.org/nodes/mamaki-testnet/#rpc-endpoints):

Example

    celestia bridge init --core.ip https://rpc-mocha.pops.one:9090
    

![Output should look similar](https://storage.googleapis.com/papyrus_images/a7ef91b8d7319637856477b492ecc2a675752e1713db351bc7fa7d34977a8ffe.png)

Output should look similar

We now have a working directory `.celestia-bridge` and our config should be found at `./config.toml`

3\. Run the Bridge Node
-----------------------

Start the Bridge Node with a connection to a validator node's gRPC endpoint (which is usually exposed on port 9090), find addresses above.

    celestia bridge start --core.ip <ip-address>
    

**Connect to your own validator**

to connect to your own validator use the above command like so

    celestia bridge start --core.ip http://localhost:9090
    

**Connect to a core team public endpoint**

otherwise using one of the public endpoints like so

    celestia bridge start --core.ip https://rpc-mocha.pops.one:26657
    

![If working, you should see logs without ERRORs and similar to above](https://storage.googleapis.com/papyrus_images/03692e61b4998ff101d395ce031d5df0843517406b0f74e9cb528c86637e5e71.png)

If working, you should see logs without ERRORs and similar to above

Stop the node with `ctrl + c`, as it will be set up as a system service to run continuously in the background.

4\. Wallet
----------

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 `PayForData` transactions.

**Find address to fund**

    ./cel-key list --node.type bridge --keyring-backend test
    

![](https://storage.googleapis.com/papyrus_images/59ab612f5a3672bdcd4ee03dda615ae3c0e76e4f938962384a7b811364de6a92.png)

**Use Existing Key**

The custom key must exist inside the Celestia bridge node directory at the correct path default: `~/.celestia-bridge/keys/keyring-test`.

Recover Key, with existing seed

    ./cel-key add <name_of_custom_key> --keyring-backend test --node.type bridge --recover
    

add flag to the start command from step 3. or to the system service file later at step 5.

    --keyring.accname <name_of_custom_key>
    

**Fund the bridge node wallet**

Fund the address for the bridge from another wallet, such as sending from validator node/full consensus node. in the working directory

    celestia-appd tx bank send [from_key_or_address] [to_address] [amount] --chain-id mamaki --fees  [fee] -y
    

5\. Set up as system service
----------------------------

This is a working example, using your own validator gRPC endpoint on the same server, and bridge wallet named ‘`bridgewallet`’

`--core.ip <ip-address>`

`--keyring.accname bridgewallet <name_of_custom_key>`

    tee <<EOF >/dev/null /etc/systemd/system/celestia-bridge.service
    [Unit]
    Description=celestia-bridge Cosmos daemon
    After=network-online.target
    
    [Service]
    User=root
    ExecStart=/usr/local/bin/celestia bridge start --core.ip http://localhost:9090 --keyring.accname bridgewallet
    Restart=on-failure
    RestartSec=3
    LimitNOFILE=4096
    
    [Install]
    WantedBy=multi-user.target
    EOF
    

**Enable and Start Service**

    systemctl enable celestia-bridge
    systemctl daemon-reload
    systemctl start celestia-bridge 
    

Check Status

    systemctl status celestia-bridge
    

Check logs

    journalctl -u celestia-bridge.service -f
    

![If the service file is created correctly, you should be able to see the node running like so](https://storage.googleapis.com/papyrus_images/6264ff26ac5289a3913b42da5082f125e3dcf1d7cf95bf349743692368d76f4e.png)

If the service file is created correctly, you should be able to see the node running like so

Making Changes
--------------

such as changing the gRPC endpoint you will need to edit the service file

stop the service

    systemctl stop celestia-bridge
    

Open service for editing

    nano /etc/systemd/system/celestia-bridge.service
    

Restart the service

    systemctl daemon-reload
    systemctl start celestia-bridge

---

*Originally published on [GLCstaked](https://paragraph.com/@glcstaked/celestia-bridge-node-mocha)*
