Chainlink on Raspberry Pi

Leo Vigna
4 min readApr 19, 2020

--

Decentralized IoT Oracles

Chainlink provides a simple solution for decentralized smart contract platforms that need a way to integrate external data into their execution logic. While currently, the main use case is in the development of reliable price feeds, one could imagine other use cases such as leveraging IoT sensors in the determination of insurance contracts.

Currently, the couple of hackathon projects we’ve come across have leveraged an HTTP external initiator to make calls to a central Chainlink node. This creates a point of failure and censorship at the node level as it is possible that the IoT provider/owner will be a different entity than the Chainlink node provider. One could imagine 100+ IoT devices each connecting to one Chainlink node service provider. While this could be mitigated by having the IoT device connect to many different nodes, it could be interesting to explore an architecture where the IoT devices themselves are responsible for writing data on-chain and each running their own Chainlink node. This is particularly interesting in the context of future scaling with off-chain threshold signatures.

In the context of decentralized systems, running your own node, or at least having many independently run nodes, is critical to ensuring the robustness of the system as nodes are the mechanism by which decentralized protocol rules are verified. As some say, “Not your node, not your rules.” A number of projects have therefore looked to create lightweight projects that can enable running decentralized systems. These range from commercial products like Casa Node, opensource Android implementations of Bitcoin Core, and DIY Raspberry Pi projects running Ethereum or Lightning nodes. We at Vulcan Link wanted to explore the possibility of running a Chainlink node on a Raspberry Pi. This could serve as a bare-metal fallback node solution for your cloud provisioned node, or an onboard Chainlink node solution for your IoT device project.

Below a short tutorial on our Raspberry Pi setup and a few comments on porting Chainlink’s docker image to ARM64.

Chainlink on Raspberry Pi Guide

Install Ubuntu Server

We use Ubuntu Server over Raspbian as it provides better resources for running Kubernetes using microk8s. You can use Etcher to flash your Raspberry Pi’s SD card. If you’re starting from scratch, we recommend this quick guide (Kubernetes not required but preferred for running other services alongside): https://ubuntu.com/blog/single-node-kubernetes-on-raspberry-pi-microk8s-ubuntu

Install Docker / microk8s

Depending on whether you just want to run Chainlink or wish to use container orchestration using Kubernetes, you can install Docker or microk8s.

Install docker sudo apt install docker.io

Install microk8s sudo snap install microk8s --channel=1.18 --classic

Pull the ARM64 chainlink docker image

As an alternative, you can also build from source though the purpose of this guide is to provide a pre-built ARM64 compatible docker image.

If using docker, pull the image with docker pull vulcanlink/chainlink. If using Kubernetes, Kubernetes will handle this for you. Just make sure you are using the vulcanlink/chainlink image as the official Chainlink image is not built for the ARM64 architecture.

WARNING: Note that this image is built with the latest develop branch source and is therefore not meant for production. We will soon also be releasing versioned images that correspond to the official Chainlink releases. More details on the image can be found on Dockerhub https://hub.docker.com/repository/docker/vulcanlink/chainlink/

Chainlink setup

Follow the official Chainlink setup guide. https://docs.chain.link/docs/running-a-chainlink-node

Note that the ARM64 image does not include the Chainlink web app but you will be able to connect to the node via the API or CLI.

Chainlink Web Dashboard (coming soon)

As mentioned, our Chainlink image ships without the Chainlink web app for efficiency purposes. This enables us to reduce the image size from 136MB to 40.5MB. Stay tuned for an update on how to run the Chainlink web app either on-board the Raspberry Pi, or from a separate device.

Porting to ARM64

The current official Chainlink builds do not run on Raspberry Pi or any ARM CPU architectures. ARM is a RISC-based architecture. RISK stands for Reduced Instruction Set Computer. With fewer instructions, the ARM architecture enables more energy-efficient computing while sacrificing some relative speed when compared to the more complex x86 architecture.

ARM’s energy efficiency has led to its wide-scale adoption in mobile devices and IoT devices while x86 has remained dominant in the rest of the market. Because of the architecture difference, the current Chainlink image is AMD64 (x86) only and will not run on Raspberry Pi. We, therefore, built the ARM64 image as an alternative that can run on IoT devices.

About Vulcan Link

We are a Paris-based Chainlink node operator working on actively maintaining 30+ reliable data feeds and developing decentralized applications that leverage smart contracts with external data. We believe in building trust through transparency by contributing to opensource projects. If you’d like us to add other data feeds to feeds.link, feel free to reach out through our links below!

Find us at vulcan.link

Follow us on Twitter @vulcanlink for updates on new projects like this one.

If you’d like to contribute, join us on Telegram and Discord

--

--