Celestia on Mobile

Celestia Light Client on Mobile (Linux/ARM)

Nodes on Celestia

A light client allows some security with lower resources, it makes an honest majority assumption that the validator set (which has its own economic incentives) is acting within the rules. this allows you to follow the chain but not have to verify everything yourself.

Celestia node operators can run several options on the network:
• Bridge Node (This node bridges blocks between the Data-Availability network and the Consensus network)
• Validator Node (Node operators who run a Bridge Node have the option to also participate in Consensus by becoming a validator)
• Light Client (Light clients conduct data availability sampling on the Data Availability network)

Light Client on Mobile (Linux/ARM)

Using a Linux based phone, made by 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

Comes with an expansion slot for micro SD, which we will be using for our Linux distribution as the pre-installed Manjaro OS is difficult to get working with what we intend to run. This Is cost efficient $150 Really low specs phone and could run a light client no problem.

Download OS and Image writer

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

Other OS can be found here, I’ve tried with Ubuntu Touch & Manjaro and had too many problems that I can’t solve. PinePhone is set to boot from SD if it contains a compatible OS

Mobian: a version of Debian compatible with ARM chips, it’s the closest I could get to Ubuntu Linux

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

  • Unzip the download
  • Assign Execute Permissions to the AppImage File
  • Run

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

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.

The Default Password for Mobian is: 1234

Head over to Kings Cross, which is the Terminal for Mobian.

Easiest way to follow this doc is to copy the commands here to a .txt file and save to a USB, if you connect this to your phone via the USB it should recognize the drive and be able to open the text file.

Update

Sudo apt update

Do not run apt upgrade, as it will update packages that are not compatible with ARM it will make your phone go crazy, for updating it should be done via the software updater that comes with the OS

Install packages

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 minutes, so don’t panic and come back to it when you get a notification on the phone saying ‘command completed’

Install Go

Celestia Node is built with Go, and we need to download a version compatible with ARM, the version can be changed by replacing the 1.18.1 with whatever version, but I got it working with 1.18.1


cd $HOME
wget "https://golang.org/dl/go1.18.1.linux-arm64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go1.18.1.linux-arm64.tar.gz"
rm "go1.18.1.linux-arm64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

go version

if all successful you should see the version of Go returned like so

Build Celestia

cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node
git checkout v0.2.0
make install

This also takes a while, when finished run the following

export PATH=$PATH:$HOME/go/bin

celestia version

Like with checking the Go version we should see the version of Celestia returned

Start the Light Client

To start the light client run this

celestia light init

Now we need to add bootstrap peers for our light client to sync to, check in with the Celestia community should these change.

BootstrapPeers="[\"/dns4/andromeda.celestia-devops.dev/tcp/2121/p2p/12D3KooWKvPXtV1yaQ6e3BRNUHa5Phh8daBwBi3KkGaSSkUPys6D\", \"/dns4/libra.celestia-devops.dev/tcp/2121/p2p/12D3KooWK5aDotDcLsabBmWDazehQLMsDkRyARm1k7f1zGAXqbt4\", \"/dns4/norma.celestia-devops.dev/tcp/2121/p2p/12D3KooWHYczJDVNfYVkLcNHPTDKCeiVvRhg8Q9JU3bE3m9eEVyY\"]"

sed -i -e "s|BootstrapPeers *=.*|BootstrapPeers = $BootstrapPeers|" $HOME/.celestia-light/config.toml

Create system service for client

This allows Celestia light client to run in the background, if you close the terminal or restart the phone, it will allow you to use the phone for other things


sudo tee /etc/systemd/system/celestia-light.service > /dev/null <<EOF
[Unit]
  Description=celestia-light
  After=network-online.target
[Service]
  User=$USER
  ExecStart=$(which celestia) light start
  Restart=on-failure
  RestartSec=10
  LimitNOFILE=4096
[Install]
  WantedBy=multi-user.target
EOF

You will be prompted here and need to allow, the next commands enable and start the service which will output the logs to the terminal

sudo systemctl enable celestia-light
sudo systemctl daemon-reload
sudo systemctl restart celestia-light && journalctl -u celestia-light -f -o cat 

Node is running in the background now, we can use CTRL + C to exit the logs and return to terminal and close it.

To check services running

sudo systemctl status celestia-light

and to run the logs again to check

sudo journalctl -u celestia-light -f -o cat 
Subscribe to GLCstaked
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.