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/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: ~ diff --git a/flake.lock b/flake.lock index 9a771ac..5dfcb52 100644 --- a/flake.lock +++ b/flake.lock @@ -1,56 +1,209 @@ { "nodes": { - "flake-utils": { + "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": { - "systems": "systems" + "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": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1743001074, + "narHash": "sha256-FtFGAFY+d6eEP85PkkyhwD2G9fXx4jrQiNjik3Hyqmk=", + "owner": "holochain", + "repo": "scaffolding", + "rev": "2ad60188fe6a2bba7b68b414f0d6528967d48400", "type": "github" }, "original": { - "id": "flake-utils", - "type": "indirect" + "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": 1743454796, + "narHash": "sha256-WZyzsMZBJ2SxIkyrQ7xmeAOzj4N96lBvEZWwNyqRaps=", + "owner": "holochain", + "repo": "holonix", + "rev": "4f469753f6fa19f71a7f1c8129289626a4013f60", + "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": 1722640603, - "narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", - "owner": "NixOS", + "lastModified": 1734323986, + "narHash": "sha256-m/lh6hYMIWDYHCAsn81CDAiXoT3gmxXI9J987W5tZrE=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", + "rev": "394571358ce82dff7411395829aa6a3aad45b907", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", + "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-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "flake-parts": [ + "holonix", + "flake-parts" + ], + "holonix": "holonix", + "nixpkgs": [ + "holonix", + "nixpkgs" + ] } }, - "systems": { + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "holonix", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1734575524, + "narHash": "sha256-BxQ/4JuHEi0zRjF0P8B5xnbXOLulgsK2gfwVRXGZ4a4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "573c674a3ad06e8a525263185ebef336a411d1d5", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "oxalica", + "repo": "rust-overlay", "type": "github" } } diff --git a/flake.nix b/flake.nix index 84ad262..ad6428e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,40 +1,46 @@ { - description = "Holochain Development Env"; + description = "Flake for Holochain app development"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + 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"; }; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: + outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { + systems = builtins.attrNames inputs.holonix.devShells; + perSystem = { inputs', pkgs, ... }: let - pkgs = import ./pkgs.nix { - pkgs = nixpkgs.legacyPackages.${system}; - inherit system; - }; + # 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 { - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - holochain_0-4 - lair-keystore_0-5 - hc_0-4 + formatter = pkgs.nixpkgs-fmt; - rustup - cargo - rustc + 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 + ]); - 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; -}