Skip to content

feat: Upgrade Holochain versions #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- rework
pull_request:

concurrency:
Expand All @@ -17,9 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v27
uses: cachix/install-nix-action@v30
with:
install_url: https://releases.nixos.org/nix/nix-2.24.4/install
install_url: https://releases.nixos.org/nix/nix-2.26.2/install
- uses: cachix/cachix-action@v15
with:
name: holochain-ci
Expand Down
47 changes: 14 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,20 @@ as an input. Something like:
}
```

This flake attempts to provide Holochain for its upcoming and stable releases. Currently, this would be the 0.4
development versions and the stable 0.3 version.
This flake attempts to provide Holochain for its upcoming and stable releases. Currently, this would be the 0.5
development versions, the 0.4 stable versions and the 0.3 maintenance versions.

There isn't necessarily a migration path between minor versions of Holochain, so please refer to Holochain documentation
when upgrading. Just changing the version that you are consuming from this flake is unlikely to work.

For Holochain 0.4 onwards, before you can get started, you will need a seed bundle for DPKI. You can use the CLI provided
by this project to generate one. For example:

```shell
nix develop -c node ./seed-tool/index.js generate --out root.bundle
# Provide a password

nix develop -c node ./seed-tool/index.js derive --root root.bundle --out mymachine.bundle
# Provide the password from step 1 again
# Provide a password for this device bundle
````

Keep the `root.bundle` safe. It's the device bundle that you will need to deploy.

The following is a very rough, sample flake. It will get you up and running but you likely want to make improvements.
The following is a very rough, sample flake. It will get you up and running, but you likely want to make improvements.

```nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=24.05";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.11";
hc-nixos = {
url = "github:ThetaSinner/hc-nixos?ref=rework";
url = "github:ThetaSinner/hc-nixos?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
Expand All @@ -58,27 +44,22 @@ The following is a very rough, sample flake. It will get you up and running but
modules = [
./configuration.nix
hc-nixos.nixosModules.hcCommon # Adds groups and users
hc-nixos.nixosModules.lair-keystore-0_5 # Define the Lair service
hc-nixos.nixosModules.lair-keystore-for-0_4 # Define the Lair service
hc-nixos.nixosModules.conductor-0_4 # Define the Conductor service
({ pkgs, ... }: {
environment.etc."lair-myMachine/device.bundle".text = "<contents of mymachine.bundle>";

services.lair-keystore-0_5 = {
services.lair-keystore-for-0_4 = {
enable = true;
id = "lair-05";
id = "lair";
package = hc-nixos.inputs.holonix-0_4.packages.x86_64-linux.lair-keystore;
passphrase = "pass"; # Secret, conductor must launch with the same phrase
deviceSeed = "myMachine-seed"; # Not secret, just a name
seedPassphrase = "<chosen in step 2 above>"; # Secret
};

services.conductor-0_4 = {
enable = true;
id = "conductor-04";
lairId = "lair-05";
id = "conductor";
lairId = "lair";
package = hc-nixos.inputs.holonix-0_4.packages.x86_64-linux.holochain;
keystorePassphrase = "pass"; # Secret, see Lair
deviceSeed = "myMachine-seed"; # Not secret, see Lair
};

# Include the Holochain tools and sqlcipher which can be useful for debugging or fixing corrupted sqlite databases etc.
Expand Down Expand Up @@ -117,11 +98,11 @@ sudo nixos-rebuild switch

You are free to override the configuration, run with an embedded Lair keystore or even run multiple Holochain versions
side by side. I've started adding NixOS tests to demonstrate some different ways of running Holochain and showing how
to configure it. You may use the tests under `tests` as a reference if you want some hints on how to do this.
to configure it. You may use the tests under `tests` as a reference if you want some hints about how to do this.

Please note that the tests are not intended to be secure or production ready. They are just a way to demonstrate how
to configure Holochain in different ways. It's left to you to ensure that your Holochain configuration is appropriate
for your use case.
Please note that the tests are not intended to be secure or production ready. They are primarily for verification and
to demonstrate how to configure Holochain in different ways. It's left to you to ensure that your Holochain
configuration is appropriate for your use-case.

### Testing interactively with a VM

Expand Down
Loading