Holochain developers—when you are building applications on the Holochain framework, you are looking for reliability above all else. That's why we are giving Holonix and HoloPort OS so much attention. Holonix and HoloPortOS are an operating system and a set of configuration tools, respectively, that will keep your Holochain environment up-to-date, so you can focus on making exciting and innovative hApps!
Holonix is designed to be an open-source "tooling commons," shared by Holochain Core and the wider ecosystem. HoloPortOS, HoloFuel, and the others will all use Holonix to lock dependencies across interoperable projects and coordinate changes over time.
- Predictable Decentralization
- Predictable Unpredictability
- Predictable, Portable Machines
- Getting Productive with Holonix
What is reliability, you might ask? In part, it’s predictability. It means knowing what something will do under a wide range of conditions, in other words, the same input always produces the same output.
For developers, Holochain Core should be a bit like running water or electricity; you should never have to wonder whether it's working properly.
What are some of the ways predictability can be ensured? Here are a few:
- Agents: In order for a Holochain application to be useful to its users, they need to be empowered to work individually and collectively to maintain network integrity. That means they need to be able to unambiguously identify bad data, trace it back to its source, and of course, create their own provable valid data. This can only happen if they trust their copy of the software. They should also have reasonable trust in the software of their peers.
- Components: Each layer in the developer's environment—from their own operating system, to Holochain Core code, to the zome code—should be aligned with one another so that nothing breaks.
- Tooling: There are many things to consider in this area! Holochain relies on many different tools—for example, Rust, the language in which Holochain is written and supplier of many important libraries. We also need good crypto, up-to-date operating systems (Windows/Mac/Linux) and related packages, testing, integrated development environments (IDEs), standard workflows, deployments, rapid development tools, setups to support demos and Hackathons—the list goes on and on.
Because Holochain is a distributed framework, agents need to be aware of all the benefits and drawbacks of working "without a net." Mistakes, for example, are harder to detect and recover from after you deploy your code into the wild. If something does go wrong, there's no central server to "roll back" your changes.
Additionally, beyond Holochain’s basic data integrity assurances, you have the responsibility to create authorization and data integrity rules that are appropriate to your application.
There are potential costs involved with being too lenient with who and what you allow on your network.
Much has been written about the problem of getting nodes in a distributed system to agree with one another. Most solutions strive for coordination protocols that ensure global consensus—which is fine—for some applications these solutions are appropriate. But if you’ve been with us for a while, you probably know that we invite developers to embrace the reality of relativity.
This doesn’t mean everything has to be a mess of existential meaninglessness. For starters, there is the CALM Principle, which says that as long as your functions only increase state, you completely eliminate the need for coordination protocols. This is a simple idea with huge consequences; it means that you can guarantee eventual data consistency among independent peers without any complicated logic. Holochain embeds CALM deeply into its design in multiple places.
How predictable should you be?
Decentralization introduces potential risks, so it's essential that apps and the systems on which they're built are rock solid. For most of the back-end, even tiny inconsistencies will break the whole system. Web front-ends can be much less strict about inconsistencies, but still benefit from increasingly reliable builds as projects mature.
How can we be predictable?
Computers are designed to be predictable, but also interact with the outside world. Unpredictability tends to compound in nasty ways, so we quarantine it by design. Unpredictable components could be a random number generator, hidden reference between components, time sensitive logic, or the black box of user behavior.
There are a number of different ways to ensure predictability at the code level, but very few options exist to keep the environment itself predictable. For example, different versions of the Rust compiler generate different binaries, and may not be at all compatible with source code. Most attempts to increase predictability focus on virtualisation-based approaches like “golden images,” which are fundamentally centralised, fragile, and difficult to audit. In fully centralised contexts, company IT departments might lock down their computers and mobile devices, or server administrators or cloud providers would manage things from on high.
Holochain is a distributed framework, so our options are limited to those that are open and extensible by design.
Predictable, Portable Machines
Holonix and HoloPortOS are able to create predictable, decentralized machines. HoloPortOS is a customized build of NixOS, which in turn is a Linux distribution powered by the Nix package manager. Our HoloPort devices are all powered by HoloPortOS. Meanwhile, Holonix is a standard set of NixOS configurations that make development and testing easier across the Holochain ecosystem. It’s basically a hybrid between messy personal machines and fully virtualised environments, giving you only the specific set of dependencies needed for Holochain development.
Holonix is an open-source environment, available natively on Linux and MacOS. (For now, Windows users will need a virtual machine for it to work on their computers.) It’s designed to be used by both Holochain Core and zome developers, so that they follow the same pattern in development. It’s continuously updated; the latest version of Holochain is always available. It also comes with virtually everything out of the box—deployments, integration with other systems, workflows, you name it. This takes a lot of the hassle out of dealing with things like dependencies. For example, Holonix uses "derivations" that are hashed like HC zomes to prevent your dependencies from getting out of sync. At the same time, customization for your own projects is a snap.
Getting Productive with Holonix
When you use Holonix, you’ll be working with nix-shell to create a sandbox where you can access Holochain and other tools. Holonix versions pin the versions of all dependencies, including Holochain itself. Holonix is available natively for MacOS and Linux—as we said above, there isn't a native solution for Windows users, but for now, Vagrant (a tool with which many web developers are familiar) will do the trick. Docker also works, but requires Windows Pro, Enterprise, or Education editions.
There are two ways to use Holonix. Go straight to the source at holochain.love, or configure a default.nix file on your machine for your own project. With holochain.love, you’ll always get the latest version of the code, but in the default configuration. To customize Holonix, you’ll need to create a default.nix file in your project that will run whenever you build in nix-shell.
Are you interested in learning more? The Get Started Section on the Holochain Developer Portal will walk you through the install process.
Thanks to Paul D’aoust and Amanda DHT.
Building with Holochain? We want to hear from you!
Are you building with Holochain? We would love to connect and hear more about your app/platform. Please, take a few moments to fill out this survey! Our goal is to list all the projects building on Holochain on our forum.