Summary
This week, we’re going to focus on one particular item that we think will help the dev community enormously by avoiding some dependency conflicts when it comes to building hApps. We’re applying insights from our own HoloCentral Team to show you how building and maintaining hApps only requires a few changes to configuration files in Holonix to keep them current with Holochain Core. This improvement will be implemented later this week. We hope this advice will reduce your workload as we continue to evolve a more integrated solution.
An Improvement for Developing Your hApp on Any Version
As you likely know, Holochain Core is written in Rust — more specifically, the nightly builds of Rust. We do this because many features that we need for Holochain, such as WASM, futures, etc. aren’t yet available in Rust beta. This means that Core doesn’t have a stable version to which developers can turn when building their own apps on Holochain. Therefore, new releases of Holochain Core can potentially lead to breakages in hApps throughout the ecosystem.
In the past, we’ve worked on various ways to help developers avoid these kinds of dependency issues, including launching the Holonix Development Environment and publishing a Quick Start Page to streamline Holochain installation. In addition, in the coming weeks we plan to introduce new solutions via Holonix to help resolve dependency issues in hApp development in a more comprehensive way.
Today, we want to share an insight from our HoloCentral Team offering a quick path to controlling dependencies in your hApps.
For those who aren’t aware, the HoloCentral Team manages the Holo infrastructure, including cloud hosting, HoloFuel, and HoloPort devices. Actually, the Holo Hosting app is a hApp itself, meaning that any lessons the HoloCentral Team learns while developing it are likely applicable to the developers of other hApps. One of the oldest maxims in software development is that developers should “eat their own dog food,” in other words, they should use the tools they build. In this case, doing so has yielded what we believe is a useful solution for managing dependencies in hApp development.
And the Solution is…
In short, it involves using tooling supplied by the holo-nixpkgs repository, which is set up to provide stable dependencies. Copy three files over into your own environment — default.nix, pkgs.nix, and shell.nix. The default.nix file specifies which hApp is being configured; the pkgs.nix file downloads a tarball of the packages you’ll be using for building the hApp; and the shell.nix file configures the shell environment. Tweak these files to point to your hApp, then set up your hApp’s DNA via the nix-build function in Holonix.
From there, you can develop against either a local or built-in version of Rust. You can access cached binary assets, available from both nixos.org and holo.host, when it’s time to test and move to production. You can then integrate the DNA with CI services like Hydra or CircleCI.
We have an example hApp repository to show how this all works and we encourage you to look at the files to see how you can configure your own hApp files to achieve similar results.
One last thing to keep in mind — as we mentioned earlier, we are currently working to push out some Holonix updates that will allow you to build your hApps with a greater degree of control over dependencies. These updates will likely change some of the info in this Dev Pulse, but for now, we hope this advice will be valuable to you as you work on your hApps.
Holochain Development Status:
- Released: 0.0.29-alpha2
- Next: 0.0.30-alpha1
For all changes related to this release, please see the changelog.