Celestia Light Node Raspberry Pi - Mocha

Setup a Celestia Light Client on ARM based single board computer such as Raspberry Pi/Rock SBCs, this example using a Raspberry Pi4-B

Light Nodes conduct data availability sampling on the Celestia Data Availability network. More info on Light nodes found here.

Raspberry Pi is the most popular single board computer, uses ARM based CPU and the steps for installation are the same for any ARM device including mobile here. A setup script, for easier install is available here:

Hardware – using a Raspberry Pi 4 Model B with 4GB RAM, Storage 32GB mSD Card
OS: Ubuntu desktop 22.04.1 LTS

1. Getting Ubuntu on Raspberry Pi

Download R-Pi Imager

You can install this on Windows or OS of choice, you need something to flash the OS image of Ubuntu to the SBC board, in this case a Raspberry pi 4. This is software to flash the OS image to bootable storage for the SBC.

Download Ubuntu OS image

Ubuntu for ARM can be found here.

Easiest to work with is the Ubuntu Desktop image. You can find on this page suitable OS version for which version of SBC, in this case ‘Ubuntu Desktop 22.04.1 LTS 64bit’

for 20.04 LTS you can install a server version for R-Pi here. ‘Raspberry Pi Generic (64-bit ARM) preinstalled server image’. UI can be installed via terminal sudo apt-get install ubuntu-desktop

Format Storage

Using an SD card as this is where the R-Pi will boot from first (by default), first format the card before it can be flashed with the image installed previous, can use the disk management tool on windows.

Flash SD with Ubuntu

Using the Raspberry Pi Imager tool, Select ‘use custom image’ for the operating system we previously downloaded (Ubuntu 22.04.1), then select the storage (ensure formatted and connected), click on write to start the process, can take a while to complete.

Setup Ubuntu on Device (R-pi)

On first start-up it’s the same for setting up ubuntu anywhere else, follow the on-screen prompts, this only needs to be done once. Once logged in connect to the internet and update the device via the ‘software updater’.

Setup Celestia Light node via Script - Easy

Easier way to install Light client is via the script below and downloading for ARM devices, this just automates the steps from this document. Or to do manually follow from Step 2.

This must be done as root user sudo -i

wget https://raw.githubusercontent.com/GLCNI/celestia-node-scripts/main/light-node-ARM/cel-light-arm.sh

make executable and run script

chmod a+x cel-light-arm.sh
./cel-light-arm.sh

2. Install Dependencies

Change to root user

sudo -i

Can exit root anytime with exit

Install packages

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

Install Go

cd /tmp && wget https://go.dev/dl/go1.19.1.linux-arm64.tar.gz
tar -C /usr/local/ -xzf go1.19.1.linux-arm64.tar.gz 

add go to PATH

cd /usr/local/ && echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bashrc && echo "export GOROOT=/usr/local/go" >> ~/.bashrc && echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> /home//.bashrc && echo "export GOROOT=/usr/local/go" >> /home//.bashrc && source ~/.bashrc && source /home/*/.bashrc

confirm go installed

go version

3. 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.0
make install				
make cel-key

Initiate node as a light client

celestia light init

4. Create system service to run light node

Requires gRPC endpoint to connect to a validator node, replace the $RPC_ENDPOINT with : available endpoint from here:

tee <<EOF >/dev/null /etc/systemd/system/celestia-lightd.service
[Unit]
Description=celestia-lightd Light Node
After=network-online.target
[Service]
User=root
ExecStart=/usr/local/bin/celestia light start --core.ip $RPC_ENDPOINT 
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target"
EOF

Enable and start service

systemctl enable celestia-lightd
systemctl daemon-reload
systemctl start celestia-lightd

Logs can be viewed with

journalctl -u celestia-lightd.service -f

The service can be stopped with

systemctl stop celestia-lightd

5. Wallet Setup

A wallet is created for you on start up, to pay for data transactions this must be funded, you can find wallet with (in ./celestia-node)

cd celestia-node
./cel-key list --node.type light --keyring-backend test
Subscribe to GLCstaked
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.