Celestia Light Node on Mobile - Mocha

Setup Celestia Light Client (Mocha Testnet) on Mobile, ARM based device with Linux installed, this example using Pinephone with Mobian.

(last update: 17/5/23)

Light Node: conducts data availability sampling on the Data Availability network.

This Guide is for running a Light node on an ARM device. such as a Mobile phone with Debian installed. This is experimental, the steps should be similar for other OS some setup might not be compatible and there may be extra difficulties. This is tested with Mobian.

A setup script, for easier install is available here:

Hardware Requirements : CPU: Single Core/ 2GB RAM/ Disk: 5 GB SSD/ 56Kbps Download/upload

Mobile with Linux

If you can figure how to flash a phone with Linux, I’ll be using Mobian: a version of Debian compatible with ARM chips.

The process should be similar for any compatible OS and device. I am using PinePhone an Open Source phone supporting existing Linux-on-phone projects. This has only 3GB RAM and an internal flash memory of 32GB eMMC, CPU: 64-bit Quad-core 1.2 GHz ARM Cortex A-53.

Download OS and Image writer


NOTE: this install method is now outdated (17/5/23)

as of April 3, 2022 release, Jumpdrive is no longer supported to flash the latest images of Mobian to pinephone, Towboot is now required, more information here:

last supported image: mobian-pinephone-phosh-20220327.img.gz


Here we can head to Mobian, head over to images>pinephone>weekly and download mobian-pinephone-phosh-20211107.img.gz

To experiment with other linux based mobile OS, they can be found here.

Now we need a image writer to flash the OS to the SD card, we can use BalenaEtcher. just head to download and select for whatever OS you want to handle the SD card preparation. To run on Linux, we need to

Add Etcher Debian repository: will need curl sudo apt install curl

curl -1sLf \
   'https://dl.cloudsmith.io/public/balena/etcher/setup.deb.sh' \
   | sudo -E bash

update system

sudo apt-get update

Install balenaEtcher on Ubuntu Linux

sudo apt-get install balena-etcher-electron

This can be uninstalled later with

sudo apt-get remove balena-etcher-electron
sudo rm /etc/apt/sources.list.d/balena-etcher.list
sudo apt-get update

Format SD card

Write the Image to SD Card

With balenaEtcher opened, we select ‘flash from file’ this will open your folders, navigate to the folder containing our Mobian image and select

Select Target, SD card, should be inserted into your device and recognized if formatted correctly will appear like so

Then click on ‘Flash’ and wait for the process to finish, then we can insert the SD into our phone and boot.

Alternative: flashing the internal Memory

If we want to just use the internal memory, we need Jumpdrive, can be downloaded here, using BalenaEtcher we can Flash the Jumpdrive image to a microSD card.

Insert the SD with Jumpdrive installed to your phones SD card slot, and when switched on it will enter a boot mode that makes your phone recognized as an external device that can be selected to write too via BalenaEtcher following the same steps above.

Initial boot

The Default Password for Mobian is: 1234

This will be the initial set-up which is self-explanatory, select your preferred language and time zone, etc. We can also configure network settings and connect to WiFi.

“Kings Cross” is the Terminal for Mobian.

Install SSH

Not only is it much easier for inputting commands, in the case of pinephone with mobian you can get locked out of the GUI when under root should the device fall asleep. Find ip with ip a and connect via putty or similar ssh program.

sudo apt-get install openssh-server
sudo systemctl enable ssh

if you have trouble see this thread.

Setup Celestia Light Node - Script (easy)

The Easiest way to install Celestia Light node is via the script below and downloading the script for ARM devices,

from the $HOME directory, download and make executable

wget https://raw.githubusercontent.com/GLCNI/celestia-node-scripts/main/multi-network/light-node-ARM.sh && chmod a+x light-node-ARM.sh

to run script

./light-node-ARM.sh

Setup Celestia Light Node - Manual (advanced)

Update Device

For Mobian update via the built in software updater, do not run apt upgrade, as it will update packages that are not compatible with ARM it will make your phone go crazy.

Change to root user

sudo -i

Install packages

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

This command will take a while approximately 20-30 minutes

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

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

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

Set up wallet

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)

./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.