How light is your light node — Running Celestia on an eBook reader

WayneWayner
6 min readMay 15, 2023

--

To make blockchain technology accessible to everyone, light nodes have been developed to provide a more user-friendly experience with fewer hardware requirements. Ideally, a light node should be able to run on low end hardware like a Raspberry PI, which would ensure compatibility with a wide range of consumer devices such as phones, laptops, and desktop computers.

To test the compatibility of Celestia with lightweight hardware, we took an unconventional route and chose to run the software on the weakest hardware device we had on hand — an Amazon Kindle Paperwhite from 2021.

Please note that running Celestia on an Amazon Kindle requires jailbreaking the device to access the underlying Linux operating system. We won’t cover the details of how to jailbreak your device in this article, but it’s important to be aware that doing so will void your warranty and potentially damage your device.

Hardware

Celestia light node sys requirements:
https://docs.celestia.org/nodes/light-node/

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

Amazon Kindle Paperwhite 2021 specifications:

  • Memory: 512MB RAM
  • CPU: Dual Core ARM32 bit 2GhZ
  • Disk: 8GB Storage ( theres also a 32GB version but I was sure I won’t ever fill up that 8GB. I was so wrong.)
  • Bandwidth: Wi-Fi 802.11b/g/n 2.4 GHz => 72.2 Mbps

When it comes to running Celestia on a device like the Amazon Kindle Paperwhite 2021, there are a few things to consider in terms of system requirements. First, let’s take a closer look at the device’s CPU. While the dual-core ARM32 bit 2Ghz CPU may not be as powerful as some of our other devices, it should be sufficient for running Celestia. However, it’s important to note that the CPU is only 32-bit architecture, which could potentially cause compatibility issues with certain software.

Moving on to RAM, the Kindle Paperwhite has 512MB, which is significantly less than the 2GB recommended for running Celestia. This could pose a challenge, as the OOM (out of memory) killer can be unforgiving when it comes to memory-intensive applications like blockchain nodes. We may need to optimize our memory usage and be mindful of potential memory leaks to ensure stable performance.

Finally, storage is another consideration. The Kindle Paperwhite has 8GB of storage, which may not be sufficient for storing a full blockchain. However, we can mitigate this issue by assuming that we will only handle heavily pruned blockchain data, which should significantly reduce the amount of storage required.

Overall, while the Kindle Paperwhite may not meet all of Celestia’s recommended system requirements, with some optimization and careful consideration of the limitations, it might be possible to run Celestia on this device.

Prepare your Kindle

Preparing your jailbroken Kindle is a crucial step to run Celestia on it. To get started, you will need to install the KUAL and Alpine Linux on your Kindle.

Please note that the current version of ready-to-go Alpine Linux might be outdated, and the apk add command may not work on it. Therefore, it is recommended running the build script to get an updated version of Alpine Linux. However, if you prefer a quicker setup process, you can use the prebuilt, older version of Alpine Linux which will be auto downloaded through KUAL and my precompiled Celestia app.

Build the application

Unfortunately, building Celestia on the Kindle itself might not be possible due to several reasons:

  1. The Kindle uses a FAT32 file system which only supports file sizes up to 4GB. As a result, the Alpine Linux .ext3 image and its storage would also be limited to 4GB, which is insufficient for building the application.
  2. The Kindle runs a special Linux build that doesn’t come with a package manager (such as apt or apk), which makes it challenging to install the necessary dependencies.

The solution is simple: cross-compile Celestia on your PC or use the precompiled version I have provided. While I recommend compiling the application yourself for security reasons, you can use the precompiled version if you’re feeling lazy.

To compile Celestia yourself, you need to add cross-compiler capabilities to your machine. If you’re using Ubuntu, follow these steps:

# Install crosscompiler
sudo apt-get install gcc-arm-linux-gnueabi

# Edit makefile to compile for arm CPU
nano Makefile


## build: Build celestia-node binary.
build:
@echo "--> Building Celestia"
@GOOS=linux GOARCH=arm go build -o build/ ${LDFLAGS} ./cmd/celestia
.PHONY: build

# Build
make build

# Check version
build/celestia version

```
Semantic version: v0.9.5-dev
Commit: 2fa72c7199e5b93772a2c7e25141cfbd28f16a8e
Build Date: Mo 15. Mai 21:15:23 CEST 2023
System version: arm/linux
Golang version: go1.20.4
```

If you want to attempt building the application using Alpine Linux in a chroot environment on a more powerful machine, follow these steps. (Note: This will most likely run out of memory on your kindle during build).

# Edit the alpine linux build script create_kindle_alpine_image.sh to use more memory
IMAGESIZE=20480 #Megabytes

# Build the image
sudo bash create_kindle_alpine_image.sh

# Chroot into the kindle image (happens automatically after build)

sudo apk add git go make
git clone https://github.com/celestiaorg/celestia-node
cd celestia-node
git checkout v0.9.4
make build
sudo make install
exit

# Now you need to resize the fs back to work on fat32

resize2fs path/to/your/image/alpine.ext3 3G

Running Celestia

You now have everything you need to run Celestia on your Kindle. Follow the steps below:

  1. Start your Kindle and open KUAL.
  2. Choose Alpine Linux from the list of available applications.
  3. Select “Drop into Alpine Linux shell” for shell access or “Start Alpine Linux Desktop” for a full graphical user interface.
  4. If you don’t already have a terminal open, open one now.

5a. Download the pre-compiled Celestia binary from my GitHub repository using the following command:

cd /home/alpine/
wget https://github.com/WayneWayner/celestia-tooling/releases/download/v0.9.5/celestia

5b. Alternatively, if you want to use your own build, you can upload the binary to Transfer.sh from your other machine using the following command:

# Upload the binary from your PC
curl --upload-file celestia https://transfer.sh/celestia
# Then, on your Kindle, download the binary using the following command: 
cd /home/alpine/
wget https://transfer.sh/<ID>/celestia

6. Make the Celestia binary executable:

chmod +x celestia

7. Create a directory for Celestia’s data and configuration files:

mkdir .celestia

8. Initialize Celestia by running the following command, replacing the placeholders with the appropriate values for your node:

./celestia light init --p2p.network blockspacerace --node.store /home/alpine/.celestia

9. Start Celestia with the following command:

./celestia start --p2p.network blockspacerace --node.store /home/alpine/.celestiacelestia --core.ip 65.109.19.168

That’s it! Celestia should now be up and running on your Kindle.

Conclusion

The Celestia light node is up and running on your Kindle Paperwhite, even though it may not be super performant due to the limited RAM. But it is still capable of keeping up with the chain head.

Now, you can use your Kindle to run a blockchain node and participate in the decentralized network. It can be a fun project and a great way to learn about blockchain technology.

Here some use cases for running the Celestia node on your Kindle Paperwhite include:

  • Running the node while on a holiday at the beach in Bora Bora, when you are tired of reading books and want to engage with the blockchain instead.
  • Taking your Kindle Paperwhite underwater and using the WiFi functionality to connect to the network when your router is just 50cm away.
  • Bringing your Kindle Paperwhite on a camping trip and running the node on battery power while enjoying the great outdoors.

In summary, running a blockchain node on your Kindle Paperwhite may not be the most practical use case, but it is definitely a unique and fun one.

Links

Github WayneWayner celestia-tooling

Github WayneWayner Celestia Kindle

Alpine Linux Kindle

Jailbreak info

Celestia

Celestia docs

--

--

WayneWayner
WayneWayner

No responses yet