Skip to main content

Light Node

Hardware requirements

  • Memory: 2 GB RAM
  • CPU: Single Core
  • Disk: 25 GB SSD Storage
  • Bandwidth: 56 Kbps for Download/56 Kbps for Upload

Setting up light node

Server preparing

sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade

light-1

Install Go

ver="1.20.2" 
cd $HOME
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

light-2

Check Go version

go version

You should see output like:

light-3

Download the binary file

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

light-4

Check Celestia version

celestia version
info

Check the latest celestia-node version here

Create key for node

note

Change f5nodes to your moniker

  • Create a new key
./cel-key add f5nodes --keyring-backend test --node.type light --p2p.network blockspacerac

light-6

  • Restore an existing key using a mnemonic (optional)
./cel-key add f5nodes --keyring-backend test --node.type light --p2p.network blockspacerace --recover

light-6

Then we can go to #faucet channel for “Blockspace Race” and request test tokens in format:

$request <celestia1ux3y......> 

Initialize Light node

note

Change f5nodes to your moniker

celestia light init \
--keyring.accname f5nodes \
--p2p.network blockspacerace

light-7

Create a service file

sudo tee <<EOF >/dev/null /etc/systemd/system/celestia-lightd.service
[Unit]
Description=celestia-lightd Light Node
After=network-online.target

[Service]
User=$USER
ExecStart=/usr/local/bin/celestia light start --core.ip https://rpc-blockspacerace.pops.one/ --core.grpc.port 9090 --gateway --gateway.addr localhost --gateway.port 26659 --metrics.tls=false --metrics --metrics.endpoint otel.celestia.tools:4318 --p2p.network blockspacerace
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF

light-8

Start the node

sudo systemctl enable celestia-lightd
sudo systemctl start celestia-lightd && sudo journalctl -u celestia-lightd.service -f -o cat

light-9

Useful commands

Check wallet

cd celestia-node
./cel-key list --node.type light --keyring-backend test --p2p.network blockspacerace

Check balance

curl -X GET http://127.0.0.1:26659/balance

Get light node ID

AUTH_TOKEN=$(celestia light auth admin --p2p.network blockspacerace)
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

Check logs

sudo journalctl -u celestia-lightd.service -f -o cat

Submitting a PayForData transaction

curl -X POST -d '{"namespace_id": "0c204d39600fddd3",
"data": "f1f20ca8007e910a3bf8b2e61da0f26bca07ef78717a6ea54165f5",
"gas_limit": 80000, "fee": 2000}' http://localhost:26659/submit_pfd

Delete node

cd $HOME
sudo systemctl stop celestia-lightd
sudo systemctl disable celestia-lightd
sudo rm /etc/systemd/system/celestia-lightd.service
sudo systemctl daemon-reload
rm -f $(which celestia-lightd)
rm -rf $HOME/.celestia-lightd
rm -rf $HOME/celestia-lightd