From 43d9215bfcd53d74d115b2e1b0d0e9d9b1f3b6ec Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Mon, 31 Mar 2025 20:37:34 +0100 Subject: [PATCH 1/5] chore: Update for DPKI integration --- CONTRIBUTING.md | 21 ++++----------------- Cargo.lock | 4 ++-- Makefile | 18 +----------------- README.md | 2 +- crates/holochain_deepkey_dna/Cargo.toml | 2 +- dnas/deepkey/dna.yaml | 1 - 6 files changed, 9 insertions(+), 39 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7782bfc..bc5b9cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,34 +48,21 @@ detailed API References. #### DNA Bundle ```bash -make dna/deepkey.dna +make dnas/deepkey.dna ``` -#### [Deepkey types crate](https://crates.io/crates/hc_deepkey_types) +#### [Holochain Deepkey DNA](https://crates.io/crates/holochain_deepkey_dna) Build package without publishing ```bash -make preview-deepkey-types-crate +make preview-deepkey-dna-crate ``` Publish package ```bash -make publish-deepkey-types-crate +make publish-deepkey-dna-crate ``` -#### [Deepkey SDK crate](https://crates.io/crates/hc_deepkey_sdk) - -Build package without publishing -```bash -make preview-deepkey-sdk-crate -``` - -Publish package -```bash -make publish-deepkey-sdk-crate -``` - - ### Testing To run all tests with logging diff --git a/Cargo.lock b/Cargo.lock index 41267c1..62c88dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1152,7 +1152,7 @@ dependencies = [ [[package]] name = "holochain_deepkey_dna" -version = "0.0.8-dev.2" +version = "0.0.9-dev.1" [[package]] name = "holochain_integrity_types" diff --git a/Makefile b/Makefile index ad96b8b..e88ec15 100644 --- a/Makefile +++ b/Makefile @@ -154,27 +154,11 @@ docs-watch: # -# Publishing Types Packages +# Publishing crates # .cargo/credentials: mkdir -p .cargo cp ~/$@ $@ -preview-%-types-crate: .cargo/credentials - cd dnas/$*; make preview-types-crate -publish-%-types-crate: .cargo/credentials - cd dnas/$*; make publish-types-crate - -preview-deepkey-types-crate: -publish-deepkey-types-crate: - - -preview-%-sdk-crate: .cargo/credentials - cd dnas/$*; make preview-sdk-crate -publish-%-sdk-crate: .cargo/credentials - cd dnas/$*; make publish-sdk-crate - -preview-deepkey-sdk-crate: -publish-deepkey-sdk-crate: preview-deepkey-dna-crate: .cargo/credentials $(DNA_CRATE_DNA_SRC) cargo publish -p holochain_deepkey_dna --dry-run --allow-dirty diff --git a/README.md b/README.md index 7156c1f..3674b77 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ derivation instructions. In order to regenerate your app keys, Deepkey must sto info that will instruct Lair to reproduce the same keys. -#### How are keys determinitic? +#### How are keys deterministic? Key uniquenss is determined by a combination of 2 incrementing numbers; an **app index** and a **key index**. When an app is installed, a new key registration is made using the next unused app index diff --git a/crates/holochain_deepkey_dna/Cargo.toml b/crates/holochain_deepkey_dna/Cargo.toml index 1bac064..79bc6a1 100644 --- a/crates/holochain_deepkey_dna/Cargo.toml +++ b/crates/holochain_deepkey_dna/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "holochain_deepkey_dna" -version = "0.0.8-dev.2" +version = "0.0.9-dev.1" edition = "2021" authors = ["Michael dougherty "] license = "CAL-1.0" diff --git a/dnas/deepkey/dna.yaml b/dnas/deepkey/dna.yaml index 2ba3db1..671b5d6 100644 --- a/dnas/deepkey/dna.yaml +++ b/dnas/deepkey/dna.yaml @@ -4,7 +4,6 @@ name: deepkey integrity: network_seed: ~ properties: ~ - origin_time: 1669408001130688 zomes: - name: deepkey hash: ~ From b6a3ac8dbaa1d9b96fe1d67c42fa7a216df77ba1 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Mon, 31 Mar 2025 20:50:03 +0100 Subject: [PATCH 2/5] chore: Fix CI and Nix --- .github/workflows/all-tests.yml | 6 ++-- flake.lock | 60 --------------------------------- flake.nix | 55 +++++++++++++----------------- pkgs.nix | 11 ------ 4 files changed, 27 insertions(+), 105 deletions(-) delete mode 100644 flake.lock delete mode 100644 pkgs.nix diff --git a/.github/workflows/all-tests.yml b/.github/workflows/all-tests.yml index 72dcb69..73b7e60 100644 --- a/.github/workflows/all-tests.yml +++ b/.github/workflows/all-tests.yml @@ -18,9 +18,11 @@ jobs: uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v27 + uses: cachix/install-nix-action@v31 + + - uses: cachix/cachix-action@v16 with: - nix_path: nixpkgs=channel:nixos-unstable + name: holochain-ci - name: Build Packages run: | diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 9a771ac..0000000 --- a/flake.lock +++ /dev/null @@ -1,60 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "id": "flake-utils", - "type": "indirect" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1722640603, - "narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix index 84ad262..66cafc0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,40 +1,31 @@ { - description = "Holochain Development Env"; + description = "Flake for Holochain app development"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - }; + holonix.url = "github:holochain/holonix?ref=main"; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import ./pkgs.nix { - pkgs = nixpkgs.legacyPackages.${system}; - inherit system; - }; - in - { - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - holochain_0-4 - lair-keystore_0-5 - hc_0-4 + nixpkgs.follows = "holonix/nixpkgs"; + flake-parts.follows = "holonix/flake-parts"; + }; - rustup - cargo - rustc + outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { + systems = builtins.attrNames inputs.holonix.devShells; + perSystem = { inputs', pkgs, ... }: { + formatter = pkgs.nixpkgs-fmt; - nodejs_22 - ]; + devShells.default = pkgs.mkShell { + packages = (with inputs'.holonix.packages; [ + holochain + lair-keystore + rust + ]) ++ (with pkgs; [ + nodejs_22 + ]); - shellHook = '' - export PS1="\[\e[1;32m\](flake-env)\[\e[0m\] \[\e[1;34m\]\u@\h:\w\[\e[0m\]$ " - export CARGO_HOME=$(pwd)/.cargo - export RUSTUP_HOME=$(pwd)/.rustup - rustup default stable - rustup target add wasm32-unknown-unknown - ''; - }; - } - ); + shellHook = '' + export PS1='\[\033[1;34m\][holonix:\w]\$\[\033[0m\] ' + ''; + }; + }; + }; } diff --git a/pkgs.nix b/pkgs.nix deleted file mode 100644 index 358773d..0000000 --- a/pkgs.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, system }: - -import (pkgs.fetchFromGitHub { - owner = "spartan-holochain-counsel"; - repo = "nix-overlay"; - rev = "4bf90e85448392512d8bf4dac91fdeb56bc7d610"; - sha256 = "lxGLA0KMecdt6xRy9SqApDfh9UiQd9OYnwj9xeMLJcQ="; -}) { - inherit pkgs; - inherit system; -} From 70092c7ecc2fce667df141e66ab4b2c190b4fb57 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Mon, 31 Mar 2025 21:52:57 +0100 Subject: [PATCH 3/5] chore: Use patched holonix --- flake.lock | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 5 +- 2 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..879b83e --- /dev/null +++ b/flake.lock @@ -0,0 +1,213 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1734541973, + "narHash": "sha256-1wIgLmhvtfxbJVnhFHUYhPqL3gpLn5JhiS4maaD9RRk=", + "owner": "ipetkov", + "repo": "crane", + "rev": "fdd502f921936105869eba53db6593fc2a424c16", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "hc-launch": { + "flake": false, + "locked": { + "lastModified": 1741172797, + "narHash": "sha256-ZbxhHwkFS/jg4aaKF4tnXuz8748C/QpXXgA7dAbLTdU=", + "owner": "holochain", + "repo": "hc-launch", + "rev": "3c255c29797e76126a3c9e7cbd32d0a25596bc77", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "holochain-weekly", + "repo": "hc-launch", + "type": "github" + } + }, + "hc-scaffold": { + "flake": false, + "locked": { + "lastModified": 1743001074, + "narHash": "sha256-FtFGAFY+d6eEP85PkkyhwD2G9fXx4jrQiNjik3Hyqmk=", + "owner": "holochain", + "repo": "scaffolding", + "rev": "2ad60188fe6a2bba7b68b414f0d6528967d48400", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "holochain-weekly", + "repo": "scaffolding", + "type": "github" + } + }, + "holochain": { + "flake": false, + "locked": { + "lastModified": 1743176587, + "narHash": "sha256-M1FQIpeWEr3dogusCy2Aik7APrxNPpBnl5HeOZPAxX0=", + "owner": "holochain", + "repo": "holochain", + "rev": "8168f2160510b2dd3b8d5cc446a2f518359acdd2", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "feat/integrate-k2", + "repo": "holochain", + "type": "github" + } + }, + "holonix": { + "inputs": { + "crane": "crane", + "flake-parts": "flake-parts", + "hc-launch": "hc-launch", + "hc-scaffold": "hc-scaffold", + "holochain": "holochain", + "kitsune2": "kitsune2", + "lair-keystore": "lair-keystore", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1743454254, + "narHash": "sha256-RDJacIHXs/LmK5RMfcA/7UYn4ew/VrSIptCwS0C7A/k=", + "owner": "holochain", + "repo": "holonix", + "rev": "d2acc5795d57dda37de62a08b0c892f8f7d626f6", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "support-integrate-k2", + "repo": "holonix", + "type": "github" + } + }, + "kitsune2": { + "flake": false, + "locked": { + "lastModified": 1743436463, + "narHash": "sha256-SxGDiKbVQZH8CTfbTBvv6U78tZnlC8Gt0rqY9naXje8=", + "owner": "holochain", + "repo": "kitsune2", + "rev": "fdc878d287d8d48b9d36ffdd71c2ce0ba15c5200", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "v0.0.1-alpha.17", + "repo": "kitsune2", + "type": "github" + } + }, + "lair-keystore": { + "flake": false, + "locked": { + "lastModified": 1732721902, + "narHash": "sha256-D8sXIpOptaXib5bc6zS7KsGzu4D08jaL8Fx1W/mlADE=", + "owner": "holochain", + "repo": "lair", + "rev": "e82937521ae9b7bdb30c8b0736c13cd4220a0223", + "type": "github" + }, + "original": { + "owner": "holochain", + "ref": "lair_keystore-v0.5.3", + "repo": "lair", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1734323986, + "narHash": "sha256-m/lh6hYMIWDYHCAsn81CDAiXoT3gmxXI9J987W5tZrE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "394571358ce82dff7411395829aa6a3aad45b907", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1733096140, + "narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + } + }, + "root": { + "inputs": { + "flake-parts": [ + "holonix", + "flake-parts" + ], + "holonix": "holonix", + "nixpkgs": [ + "holonix", + "nixpkgs" + ] + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "holonix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1734575524, + "narHash": "sha256-BxQ/4JuHEi0zRjF0P8B5xnbXOLulgsK2gfwVRXGZ4a4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "573c674a3ad06e8a525263185ebef336a411d1d5", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 66cafc0..f9db018 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,10 @@ description = "Flake for Holochain app development"; inputs = { - holonix.url = "github:holochain/holonix?ref=main"; + holonix = { + url = "github:holochain/holonix?ref=support-integrate-k2"; + inputs.holochain.url = "github:holochain/holochain?ref=feat/integrate-k2"; + }; nixpkgs.follows = "holonix/nixpkgs"; flake-parts.follows = "holonix/flake-parts"; From f330a0cfdb5fddeeaf7f59860ec6fbb4a0a2e4ec Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Mon, 31 Mar 2025 22:04:18 +0100 Subject: [PATCH 4/5] chore: Update Holonix --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 879b83e..5dfcb52 100644 --- a/flake.lock +++ b/flake.lock @@ -97,11 +97,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1743454254, - "narHash": "sha256-RDJacIHXs/LmK5RMfcA/7UYn4ew/VrSIptCwS0C7A/k=", + "lastModified": 1743454796, + "narHash": "sha256-WZyzsMZBJ2SxIkyrQ7xmeAOzj4N96lBvEZWwNyqRaps=", "owner": "holochain", "repo": "holonix", - "rev": "d2acc5795d57dda37de62a08b0c892f8f7d626f6", + "rev": "4f469753f6fa19f71a7f1c8129289626a4013f60", "type": "github" }, "original": { From a4cdaa9eca56716e659a5f5270eab667e65730d8 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Tue, 1 Apr 2025 12:40:06 +0100 Subject: [PATCH 5/5] chore: Use custom Holochain with DPKI enabled --- flake.nix | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index f9db018..ad6428e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,8 @@ inputs = { holonix = { - url = "github:holochain/holonix?ref=support-integrate-k2"; - inputs.holochain.url = "github:holochain/holochain?ref=feat/integrate-k2"; + url = "github:holochain/holonix?ref=support-integrate-k2"; + inputs.holochain.url = "github:holochain/holochain?ref=feat/integrate-k2"; }; nixpkgs.follows = "holonix/nixpkgs"; @@ -13,22 +13,34 @@ outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { systems = builtins.attrNames inputs.holonix.devShells; - perSystem = { inputs', pkgs, ... }: { - formatter = pkgs.nixpkgs-fmt; + perSystem = { inputs', pkgs, ... }: + let + # Disable default features and enable wasmer_wamr for a wasm interpreter, + # as well as re-enabling tx5 and sqlite-encrypted. + cargoExtraArgs = "--features unstable-dpki"; + # Override arguments passed in to Holochain build with above feature arguments. + customHolochain = inputs'.holonix.packages.holochain.override { inherit cargoExtraArgs; }; + in + { + formatter = pkgs.nixpkgs-fmt; - devShells.default = pkgs.mkShell { - packages = (with inputs'.holonix.packages; [ - holochain - lair-keystore - rust - ]) ++ (with pkgs; [ - nodejs_22 - ]); + devShells.default = pkgs.mkShell { + packages = [ + # Include custom build of Holochain in dev shell. + customHolochain + ] + ++ (with inputs'.holonix.packages; [ + holochain + lair-keystore + rust + ]) ++ (with pkgs; [ + nodejs_22 + ]); - shellHook = '' - export PS1='\[\033[1;34m\][holonix:\w]\$\[\033[0m\] ' - ''; + shellHook = '' + export PS1='\[\033[1;34m\][holonix:\w]\$\[\033[0m\] ' + ''; + }; }; - }; }; }