LINKS

**Website**
[<https://celestia.org/>](<https://celestia.org/>)

**Docs**
[<https://docs.celestia.org/>](<https://docs.celestia.org/>)

**Explorers**
[<https://celestia.explorers.guru/>](<https://celestia.explorers.guru/>)

**Github**
[<https://github.com/celestiaorg>](<https://github.com/celestiaorg>)

Install dependencies

# Update if needed
sudo apt update && sudo apt upgrade -y

# Insall packages
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu -y

# Install go
cd $HOME
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"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

****go version

Build celestia-node

cd $HOME 
rm -rf celestia-node 
git clone <https://github.com/celestiaorg/celestia-node.git> 
cd celestia-node
git checkout tags/v0.16.0
make build

sudo mv $HOME/celestia-node/build/celestia /usr/local/bin/

make cel-key

sudo mv $HOME/celestia-node/cel-key /usr/local/bin/

celestia version

Generate bridge wallet

CELESTIA_CHAIN=mocha
CELESTIA_BRIDGE_WALLET=BRIDGE_WALLET

cel-key add $CELESTIA_BRIDGE_WALLET --keyring-backend test --node.type bridge --p2p.network $CELESTIA_CHAIN

FUND BRIDGE ADDR

Check validator node RPC ports to set CORE RPC endpoints for bridge

# 1. check RPC ip and port on validator node
cat $HOME/.celestia-app/config/config.toml | sed -n '/\\[rpc\\]/,/laddr/p' | grep -Ev "#|^$"

# output example
# [rpc]
# laddr = "tcp://127.0.0.1:26657"

# 2. check GRPC port (make sure GRPC enabled) on validator node
cat $HOME/.celestia-app/config/app.toml | sed -n '/\\[grpc\\]/,/address = /p' | grep -Ev "#|^$"

# output example
# [grpc]
# enable = true
# address = "0.0.0.0:9090"

# 3. set vars
CORE_IP=http://127.0.0.1        # your validator node IP addr
CORE_IP_PORT=26657              # your validator node RPC PORT
CORE_GRPC_PORT=9090             # your validator node gRPC PORT

Init and config bridge

# Set BRIDGE RPC listen address and port
BRIDGE_RPC_ADDR="0.0.0.0"
BRIDGE_RPC_PORT="27758"     # default is 26658!

# Set GATEWAY listen address and port
GATEWAY_ADDR="0.0.0.0"
GATEWAY_PORT="27759"        # default is 26659!

# check vars
echo $CELESTIA_CHAIN,$CORE_IP,$CORE_IP_PORT,$CORE_GRPC_PORT,$BRIDGE_RPC_ADDR,$BRIDGE_RPC_PORT,$GATEWAY_ADDR,$GATEWAY_PORT,$CELESTIA_BRIDGE_WALLET | tr "," "\\n" | nl 
# output 9 lines

# init
celestia bridge init \\
  --p2p.network $CELESTIA_CHAIN \\
  --core.ip $CORE_IP \\
  --core.rpc.port $CORE_IP_PORT \\
  --core.grpc.port $CORE_GRPC_PORT \\
  --gateway \\
  --gateway.addr $GATEWAY_ADDR \\
  --gateway.port $GATEWAY_PORT \\
  --rpc.addr $BRIDGE_RPC_ADDR \\
  --rpc.port $BRIDGE_RPC_PORT \\
  --keyring.keyname $CELESTIA_BRIDGE_WALLET
  
  celestia bridge config-update --p2p.network mocha

Create and run service

tee $HOME/celestia-bridge.service > /dev/null <<EOF
[Unit]
  Description=celestia-bridge
  After=network-online.target
[Service]
  User=$USER
  ExecStart=$(which celestia) bridge start --p2p.network $CELESTIA_CHAIN
  Restart=on-failure
  RestartSec=10
  LimitNOFILE=65535
[Install]
  WantedBy=multi-user.target
EOF

sudo mv $HOME/celestia-bridge.service /etc/systemd/system/

sudo systemctl daemon-reload

sudo systemctl start celestia-bridge && journalctl -u celestia-bridge -o cat -f

# metrics
# <https://docs.celestia.org/nodes/celestia-node-metrics>

Calls examples

# REST CALL

# Get block header
curl -X GET http:/localhost:$GATEWAY_PORT/header/1

# RPC CALL

NODE_TYPE=bridge
BRIDGE_RPC_PORT=26658
CELESTIA_NODE_AUTH_TOKEN=$(celestia $NODE_TYPE auth admin --p2p.network mocha-4) && echo $CELESTIA_NODE_AUTH_TOKEN

curl -X POST -s \\
     -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" \\
     -H 'Content-Type: application/json' \\
     -d '{"jsonrpc":"2.0","id":0,"method":"p2p.Info","params":[]}' \\
     <http://localhost>:$BRIDGE_RPC_PORT | | jq -r .result.ID

# output
{
  "jsonrpc": "2.0",
  "result": {
    "ID": "12D3KooWArgZ4jEArqfuccKLANMkwXqLrses1nGb2VFfyPGATR1B",
    "Addrs": [
      "/ip6/2001:41d0:700:482b::/tcp/2121",
      "/ip6/::1/tcp/2121",
      "/ip4/51.195.89.43/udp/2121/quic-v1",
      "/ip6/2001:41d0:700:482b::/udp/2121/quic-v1",
      "/ip6/::1/udp/2121/quic-v1",
      "/ip4/51.195.89.43/tcp/2121"
    ]
  },
  "id": 0
}

curl -X POST -s \\
     -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" \\
     -H 'Content-Type: application/json' \\
     -d '{"jsonrpc":"2.0","id":0,"method":"header.LocalHead","params":[]}' \\
     <http://localhost>:$BRIDGE_RPC_PORT | jq -r .result.header.height

# p2p info
celestia rpc p2p Info --url <http://localhost>:$BRIDGE_RPC_PORT

# balance
celestia rpc state Balance --url <http://localhost>:$BRIDGE_RPC_PORT