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.24.4"
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 pull
git checkout v0.23.2-mocha

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 to submit blobs

Set CORE RPC endpoints for bridge

# set vars
CORE_IP="celestia-mocha-archive-rpc"              # your consensus node IP addr
CORE_GRPC_PORT=9090                               # your consensus 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_GRPC_PORT,$BRIDGE_RPC_ADDR,$BRIDGE_RPC_PORT,$GATEWAY_ADDR,$GATEWAY_PORT,$CELESTIA_BRIDGE_WALLET | tr "," "\\n" | nl 
# output 8 lines

# init
celestia bridge init \\
  --p2p.network $CELESTIA_CHAIN \\
  --core.ip $CORE_IP \\
  --core.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

Create and run service

# create service (archival)
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 --metrics.tls=true --metrics --metrics.endpoint otel.mocha.celestia.observer --keyring.keyname $CELESTIA_BRIDGE_WALLET --archival
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=27758
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