Running a Celestia light node on a Pixel 3 XL
May 26th, 2023

Introduction 👋

You may have seen people running Celestia light nodes from various locations (and devices) around the world and you’re curious how you run a light node of your own.

This tutorial will teach you how to install and run a Celestia light node on a Pixel 3 XL (Android phone) without root access.

Celestia is a modular consensus and data network, built to enable anyone to easily deploy their own blockchain with minimal overhead.

Let’s get started

Prerequisites 📱

  • A Google Pixel 3XL (or similar device)

    • UserLAnd installed on the device. You can try to use Termux if you’d like, but I ran into errors when running apk update.

Setup 🏗️

UserLAnd

First, you’ll want to open UserLAnd and select “Alpine Linux” as the distribution you’d like to run on the phone.

Updating and installing dependencies

Now, we’ll update and upgrade packages. You can update and upgrade packages in Alpine just like you would in a typical Linux distribution. However, you won't use sudo. Here's the equivalent command:

apk update

Install packages. To install packages, you'll use the apk command, which is a wrapper around the APT package manager. Here's how to install the packages you've listed:

apk add curl tar wget clang pkgconfig libressl-dev jq alpine-sdk bash

Golang

Next, we’re ready to install Golang. We will use Golang to build the Celestia node binary, which will allow us to run the Celestia light node.

Install Golang with:

apk add go

At the time of writing this, when I queried go version I see that I’m using go version go1.20.4 linux/arm64.

Installing celestia-node ✨

Now that we have our dependencies installed, we’re ready to install Celestia node!

Run the following on your phone’s terminal to download the repository:

cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git

Now, change into the $HOME/celestia-node directory and checkout to version v0.10.0:

cd celestia-node/
git checkout tags/v0.10.0

Next, we’ll build the binary:

make build

Once that’s complete, install celestia-node:

make install

Now, build the cel-key utility:

make cel-key

If you run celestia in your terminal, your output should look like this:

A successful installation of Celestia node.
A successful installation of Celestia node.

Initializing your node 🟡

Now that we have celestia-node installed along with its dependencies, we’re ready to initialize our node. This will create a node store and a key for our node to run on.

celestia light init --p2p.network blockspacerace

Be sure to save your mnemonic!

Start the Celestia light node on your phone 🟢

We’re ready to start the node!

celestia light start --p2p.network blockspacerace --core.ip https://rpc-blockspacerace.pops.one --gateway --gateway.addr 127.0.0.1 --gateway.port 26659
The logs from a Celestia light node running on a Pixel 3XL (Android ARM)
The logs from a Celestia light node running on a Pixel 3XL (Android ARM)

Congratulations! You now have a Celestia light node running on your Android phone 🎉

Checking your balance 🧮

You may want to submit a PFB of your own from your Android device, but you’ll need to fund the key first to do this!

Check your address by looking at your saved celestia light init […flags] output or by running this command in the $HOME/celestia-node directory:

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

The output will show your address and some other details:

using directory:  /home/userland/.celestia-light-blockspacerace-0/keys
- address: celestia1y3adcgl4dsv9v42cjggqzglhh70ytt7k7626k9
  name: my_celes_key
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AwSe3bGnqVYaEb5EcKnnksrau5QGgPEetDpXneL9rZxP"}'
  type: local

Now that you have your address, you can head over to the faucet and request some testnet tokens on Blockspace Race!

Check your balance with:

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

You’ll see a balance returned, in TIA * 10^(-6):

{"denom":"utia","amount":"692000"}

Using the da-tui by distractedm1nd 👾

If you’re interested in using a Celestia node text-based user interface (TUI) built by distractedm1nd, you’ve come to the right place! If you’re looking to learn more, you can visit the repository on Github.

Setting this up yourself should be pretty quick and can be done with the following commands:

cd $HOME
git clone https://github.com/distractedm1nd/da-tui.git
cd da-tui
go run main.go ws://localhost:26658 $(celestia light auth admin --p2p.network blockspacerace)

Troubleshooting 🐞

Please note that this is a beta test of running Celestia node on an Android device. I notice an error that seems to be related to firewalls and networking, which I haven’t resolved yet.

2023-05-25T17:28:13.307Z        ERROR   basichost       basic/basic_host.go:349       failed to resolve local interface addresses     {"error": "route ip+net: netlinkrib: permission denied"}

If you think you know how to fix this, please DM me on Twitter @JoshCStein! Otherwise, happy node-running!

Next steps 🟣

If you’re looking to play around more with your node on Android, you’ll first need to let it sync all the headers to the latest block. Until then, you will not be able to retrieve data from the network.

If you want to submit some PFBs and see what writing to the DA network is like in practice, check out based64.xyz.

Subscribe to joshcs.eth ⚡️
Receive the latest updates directly to your inbox.
Nft graphic
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.
More from joshcs.eth ⚡️

Skeleton

Skeleton

Skeleton