cIRI

cIRI is the low level implementation of an IOTA node in C, designed to provide the same functionality as the IOTA Reference Implementation (IRI). It allows users to become part of the IOTA network by acting as a transaction relay and a network information provider via an HTTP interface.

Because cIRI has much lower hardware requirements when compared to its Java old brother, it is well suited for many of the Embedded Systems supported by the Yocto Project. That’s one of the reasons I chose it to be my first project on meta-iota. I reported that work in my first article IOTA cIRI on a BeagleBone Black with Yocto Project and OpenEmbedded. Although this article is based on a BeagleBone Black, it should work for any other boards with a Yocto/OpenEmbedded Board Support Package (BSP). If you need help applying the tutorial to other boards, feel free to write a comment below, DM me on Discord (Bernardo [IF]#8478) or send me an email (bernardo.araujo@iota.org).

Unfortunately, with the upcoming Coordicide, it is likely that cIRI won’t stick around for a long time. At some point of 2020 or 2021, the network will eventually migrate to post-Coordicide node implementation bee. We have to wait and see how this project evolves, but I must admit I look forward to throwing bee into the meta-iota mix 🤓

The enTangled team chose Bazel as the cIRI build system. I found out that Mr. Hongxu Jia from WindRiver has already done an amazing job of porting Bazel into YP/OE on his meta-tensorflow layer. Nevertheless, a few adaptations were introduced into the cIRI recipe so the Bazel workspace would integrate well with BitBake and also so that snapshot, sql and config files were populated into the final package.

So let’s talk about the BitBake recipe that made this possible. You can find the recipe at recipes-iota/ciri/ciri_0.1.0.bb on the master branch of the meta-iota repository.

The SRC_URI variable lists the enTangled repository, as well as a list of patches and miscellaneous files that are meant to allow Bazel to behave correctly inside BitBake. While the patches are handled automatically by BitBake’s do_patch() task, the miscellaneous files need to be manipulated explicitly inside the do_configure_append() task to prepare the build environment so Bazel and BitBake work together correctly.

The do_compile() task is responsible for invoking Bazel with the correct parameters. Next, the do_install() does the job of populating the target root filesystem with the cIRI executable binary, as well as snapshot files, sqlite3 schemas and the conf.yml configuration template file.

Since the Bazel adaptation inside BitBake requires many workarounds, I hope the enTangled team considers porting cIRI to CMake as well. If that day ever comes, I want to adapt the cIRI recipe to use CMake instead of Bazel.