Skip to content

How to upgrade the Holochain version of a project with Nix

Guillem Córdoba edited this page Nov 24, 2021 · 8 revisions

This guide will show you how to upgrade the holochain version to the latest released one.

  1. Starting from this default.nix file in the the root folder of your project:
let
  holonixRev = "f3ecb117bdd876b8dcb33ad04984c5da5b2d358c";

  holonixPath = builtins.fetchTarball "https://github.com/holochain/holonix/archive/${holonixRev}.tar.gz";
  holonix = import (holonixPath) {};
  nixpkgs = holonix.pkgs;
in nixpkgs.mkShell {
  inputsFrom = [ holonix.main ];
  packages = [
    # Additional packages go here
  ];
}
  1. Get the newest holonix revision:
git ls-remote https://github.com/holochain/holonix main | grep -oE '[0-9a-z]{40}'

This will give some output like this:

401b69bdb120c5a4680b03eaa3f95b011e0c5cf1
  1. Replace the contents of the holonixRev variable with the output of the previous command.

  2. Re-run nix-shell again.

  3. Go into the Cargo.toml of your zomes and:

  • Upgrade the hdk version: see available versions here.
  • Upgrade the holo_hash version: see available versions here.

That's it! Try to compile your hApp and fix any breaking changes fro the HDK in your code.