The new, performant, and simplified version of Holochain on Rust (sometimes called Holochain RSM for Refactored State Model)

Overview

Holochain

Project Forum Chat

Twitter Follow License: License: CAL 1.0

This repository contains the core Holochain libraries and binaries.

This is the most recent and well maintained version of Holochain with a refactored state model (you may see references to it as Holochain RSM).

Code Status

This code is in alpha. It is not for production use. The code is guaranteed NOT secure.

We will be frequently and heavily restructuring code APIs and data chains until Beta.

We are currently only supporting Linux at this time. You may or may not be able to successfully build and run Holochain on macOS. You definitely won't be able to on Windows (unless you are using WSL, but even that is untested). We will definitely be rolling out support for these OSes in the future, but in the meantime please use Linux for development!

Making the Holochain binaries available in your shell

There are a number of contexts and purposes you might be running in which yield different ways to access binaries.

Using nix-shell on a local clone

Assuming you have installed the nix shell:

nix-shell --argstr flavor happDev

This nix-shell flavor installs wrapper binaries for holochain and hc that will automatically compile and run the binaries. This is very useful if you are tracking changes in the holochain repo because when you check out a new rev, running holochain will compile automatically to the version at that rev.

Building with cargo if you already have rust installed:

cargo install --path crates/holochain
cargo install --path crates/hc

Usage

$ holochain --help
USAGE:
    holochain [FLAGS] [OPTIONS]

FLAGS:
    -h, --help           Prints help information
    -i, --interactive    Receive helpful prompts to create missing files and directories,
                             useful when running a conductor for the first time
    -V, --version        Prints version information

OPTIONS:
    -c, --config-path <config-path>
            Path to a YAML file containing conductor configuration

Running holochain requires a config file. You can generate one in the default configuration file locations using interactive mode:

$ holochain -i
There is no conductor config YAML file at the path specified (/home/eric/.config/holochain/conductor-config.yml)
Would you like to create a default config file at this location? [Y/n]
Y
Conductor config written.
There is no database environment set at the path specified (/home/eric/.local/share/holochain/databases)
Would you like to create one now? [Y/n]
Y
LMDB environment created.
Conductor ready.

As well as creating the config file this process also instantiates the initial LMDB database environment. If you provide a config file on first run with just the -c flag holochain will also initialize the environment even if not in interactive mode.

Development Environment

Assuming you have installed the nix shell:

git clone [email protected]:holochain/holochain.git
cd holochain
nix-shell
hc-merge-test

This will compile holochain and run all the tests.

If you get an error while running nix-shell about ngrok having an unfree license, you can fix that by running,

mkdir -p ~/.config/nixpkgs/
echo "{ allowUnfree = true; }" >> ~/.config/nixpkgs/config.nix

We have an all-in-one development environment including (among other things):

  • The correct version and sane environment variables of cargo/rust
  • Node for working with tryorama
  • Scaffolding, build and deployment scripts
  • Prebuilt binaries of core for various operating systems (soon)
  • Shared libs such as libsodium

It is called Holonix and you should use it.

It has plenty of documentation and functionality and can be used across Windows, Mac, and Linux. (Although Holochain itself currently only supports Linux.) It is based on the development tools provided by NixOS.

It is suitable for use in hackathons and 'serious' development for a long-term, production grade development team.

If you want to maintain your own development environment then we can only offer rough advice, because anything we say today could be out of date tomorrow:

  • Use a recent stable version of rust
  • Use node 12x+ for clientside work
  • Install any relevant shared libs like libsodium
  • Write your own scaffolding, build and development tools
  • Plan for dependency management as we ship new binaries

Application Developer

Read the wasm API docs

Build the hdk docs:

cargo doc --manifest-path=crates/hdk/Cargo.toml --open

Core Developer

Build the holochain docs:

cargo doc --manifest-path=crates/holochain/Cargo.toml --open

Contribute

Holochain is an open source project. We welcome all sorts of participation and are actively working on increasing surface area to accept it. Please see our contributing guidelines for our general practices and protocols on participating in the community, as well as specific expectations around things like code formatting, testing practices, continuous integration, etc.

  • Connect with us on our forum

License

License: CAL 1.0

Copyright (C) 2019 - 2021, Holochain Foundation

This program is free software: you can redistribute it and/or modify it under the terms of the license provided in the LICENSE file (CAL-1.0). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Comments
  • Holochain <-> .Net / C# interface

    Holochain <-> .Net / C# interface

    Update: initial sprinklings of a .net/C# conductor client are starting here: https://github.com/holochain-open-dev/holochain-client-csharp

    Hi Guys,

    Really happy Windows support has finally been added back in again, yay! :)

    But when I run cargo install holochain I get the follow error message:

    C:\Users\david\holochain>cargo install holochain
        Updating crates.io index
      Downloaded holochain v0.0.102
      Downloaded 1 crate (279.9 KB) in 2.09s
      Installing holochain v0.0.102
    error: failed to compile `holochain v0.0.102`, intermediate artifacts can be found at `C:\Users\david\AppData\Local\Temp\cargo-install7cpdpQ`
    
    Caused by:
      failed to download `bit-set v0.2.0`
    
    Caused by:
      unable to get packages from source
    
    Caused by:
      failed to parse manifest at `C:\Users\david\.cargo\registry\src\github.com-1ecc6299db9ec823\bit-set-0.2.0\Cargo.toml`
    
    Caused by:
      dependency (bit-vec) specified without providing a local path, Git repository, or version to use.
    

    Any ideas? :) Thanks

    Cheers D.

    opened by dellams 233
  • Unable to install large apps

    Unable to install large apps

    The hard 16MB limit on websocket payload sizes has become a blocking error for me. The output from Tryorama in my tests looks like this (stack frames truncated):

    20:16:58 [tryorama: player c0] debug: initialized
    20:16:58 [tryorama: player c0] debug: Player.installHapps
    20:16:58 [tryorama: player c0] debug: Player.adminWs()
    20:16:58 [tryorama: player c0] debug: Player.installHapp(["/home/pospi/projects/holo-rea/valueflows-project-metarepo/holo-rea/happs/observation/hrea_observation.dna","/home/pospi/projects/holo-rea/valueflows-project-metarepo/holo-rea/happs/planning/hrea_planning.dna"], noAgentPubKey)
    20:17:13 [tryorama] error: Test error: 'Error: Timed out in 15000ms: register_dna\n'
    

    I have recently added a wasm-opt pass to my build to see if it alleviates the issue, but unfortunately the byte savings are modest (~25% shaved off).

    Suggest this be elevated as a serious issue as more complex applications continue to be developed. While my dna configs may appear to list a large number of zomes, I expect this will be nothing compared to highly modular app architectures being envisioned by https://neighbourhoods.network/ and https://ad4m.dev/. It is worth noting that the tests failing currently only involve 2 DNAs containing 19 zomes- the full hREA suite will be in excess of 15 DNAs and will also require several supporting auxilliary zomes in almost any useful configuration. And this does not factor in UI apps spanning multiple collaboration spaces, which may require access to multiple module suites simultaneously- leading to multipliers of 15-20 odd interrelated DNAs all being part of the same hApp bundle.

    To those pondering whether I might be able to reduce the filesize of things in other ways, I don't see this as a solution or even a long-term deferral of the problem.

    I suspect the issue will have to be solved mostly on the hc-utils side with the support of another API method or two from core, basically to chunk larger input files and send in pieces before reassembling on the other side.

    opened by pospi 30
  • hdk compilation easily broken, due to libsqlite3-sys and features configuration

    hdk compilation easily broken, due to libsqlite3-sys and features configuration

    hdk -> hdk_derive -> holochain_zome_types (culprit!) -> holo_hash -> rusqlite -> sqlite_sys

    holochain_zome_types depends on holo_hash without default-features = false

    https://github.com/holochain/holochain/blob/a817c93c2aaef283d0df2acbe37c5065c1836f3b/crates/holochain_zome_types/Cargo.toml#L16

       Compiling getrandom v0.2.3
    The following warnings were emitted during compilation:
    
    warning: sqlite3/sqlite3.c:14230:10: fatal error: 'stdio.h' file not found
    warning: #include <stdio.h>
    warning:          ^~~~~~~~~
    warning: 1 error generated.
    
    error: failed to run custom build command for `libsqlite3-sys v0.22.2`
    

    like #913

    opened by Connoropolous 19
  • [BUG] [WASM metering?] Ribosome fails with `unreachable` in all sorts of fns when DNA gets exercised

    [BUG] [WASM metering?] Ribosome fails with `unreachable` in all sorts of fns when DNA gets exercised

    Describe the bug DNA works well at first, but at some point, after creating >100 entries, a zome call using hdk::chain::query returns this error:

    'Wasm runtime error while working with Ribosome: RuntimeError: WasmError { 
       file: "/private/tmp/nix-build-hc_holochain_kitsune-p2p-tx2-proxy.drv-0/cargo-vendor-dir/holochain_wasmer_host-0.0.80/src/guest.rs", 
       line: 200, 
       error: CallError("RuntimeError: unreachable at __allocate (<module>[9728]:0x1eeb33)") 
    }'
    

    which is preceded by the following callstack:

    Wasm runtime error while working with Ribosome: RuntimeError: 
    WasmError { 
        file: "/private/tmp/nix-build-hc_holochain_kitsune-p2p-tx2-proxy.drv-0/cargo-vendor-dir/holochain_wasmer_host-0.0.80/src/guest.rs", 
        line: 259, 
        error: CallError("RuntimeError: unreachable
            at serde::de::value::MapDeserializer<I,E>::next_pair::haaad3ba4a6de641a (<module>[7210]:0x18e2cb)
            at <serde::de::value::MapDeserializer<I,E> as serde::de::MapAccess>::next_key_seed::hca02805ec96203fb (<module>[7232]:0x18f6c9)
            at serde::__private::de::content::visit_content_map::hd85faf9815523252 (<module>[7599]:0x1a645c)
            <serde::__private::de::content::ContentDeserializer<E> as serde::de::Deserializer>::deserialize_struct::h6dc91e8372d3bc25 (<module>[7661]:0x1ab0e0)
            at holochain_integrity_types::action::_::<impl serde::de::Deserialize for holochain_integrity_types::action::Create<W>>::deserialize::h8b44b43a17bc41e3 (<module>[5604]:0x1693ea)
            at holochain_integrity_types::action::_::<impl serde::de::Deserialize for holochain_integrity_types::action::Action>::deserialize::h7eaad162f2cdce00 (<module>[5596]:0x168fcf)
            at <&mut rmp_serde::decode::Deserializer<R,C> as serde::de::Deserializer>::deserialize_any::hc3ee531299e07f0a (<module>[5396]:0x131182)
            <&mut rmp_serde::decode::Deserializer<R,C> as serde::de::Deserializer>::deserialize_any::h30f9e77796fa4885 (<module>[5393]:0x12fe60)
            at serde::de::MapAccess::next_value::h5b543f8858cda8be (<module>[5428]:0x13cf10)
            <&mut rmp_serde::decode::Deserializer<R,C> as serde::de::Deserializer>::deserialize_any::h7a804302fe6ac88c (<module>[5460]:0x1482a0)
            at holochain_integrity_types::record::_::<impl serde::de::Deserialize for holochain_integrity_types::record::Record>::deserialize::h64a27e9bd7904e7d (<module>[6095]:0x176fce)
            at <serde::de::impls::<impl serde::de::Deserialize for alloc::vec::Vec<T>>::deserialize::VecVisitor<T> as serde::de::Visitor>::visit_seq::hffdf9012150c764b (<module>[4386]:0xf537f)
            at <&mut rmp_serde::decode::Deserializer<R,C> as serde::de::Deserializer>::deserialize_any::h99fa3cab5f3b1a31 (<module>[3423]:0xcf0c3)
            at serde::de::impls::<impl serde::de::Deserialize for alloc::vec::Vec<T>>::deserialize::hfadd074248396a66 (<module>[3750]:0xdfef8)
            at <serde::de::impls::<impl serde::de::Deserialize for core::result::Result<T,E>>::deserialize::ResultVisitor<T,E> as serde::de::Visitor>::visit_enum::h9a9fc0b5482ab34f (<module>[2620]:0x9511f)
            at <&mut rmp_serde::decode::Deserializer<R,C> as serde::de::Deserializer>::deserialize_enum::hd1b78d9fefc89fd0 (<module>[2489]:0x8ebe7)
            at serde::de::impls::<impl serde::de::Deserialize for core::result::Result<T,E>>::deserialize::h4c4cd8860f349141 (<module>[2802]:0x9909f)
            at holochain_serialized_bytes::decode::ha189c04a1f82ee9d (<module>[2545]:0x91c6b)
            at <hdk::hdk::HostHdk as hdk::hdk::HdkT>::query::ha5630c352e63bc95 (<module>[3006]:0xa0811)
            at std::thread::local::LocalKey<T>::with::hdf30b39269ef9592 (<module>[2788]:0x98b42)
            at hdk::chain::query::h6c41770dc5cb69b9 (<module>[2990]:0x9fba1)
            at perspective_diff_sync::revisions::current_revision::h273ea7e62f7af6d7 (<module>[999]:0x37113)
            at perspective_diff_sync::pull::pull::hdbe25e8845e7938a (<module>[768]:0x20860)
            at perspective_diff_sync::pull::hbee50929ed5a525f (<module>[332]:0xed72)
            at pull (<module>[953]:0x33fd1)") 
    }
    

    The code calling chain::query (perspective_diff_sync::revisions::current_revision) is this:

    pub fn current_revision() -> SocialContextResult<Option<HoloHash<holo_hash::hash_type::Action>>> {
        let app_entry = AppEntryType::new(4.into(), 0.into(), EntryVisibility::Private);
        let filter = ChainQueryFilter::new().entry_type(EntryType::App(app_entry)).include_entries(true);
        let mut refs = query(filter)?
            .into_iter()
            .map(|val| {
                val.entry().to_app_option::<LocalHashReference>()?.ok_or(
                    SocialContextError::InternalError("Expected element to contain app entry data"),
                )
            })
            .collect::<SocialContextResult<Vec<LocalHashReference>>>()?;
        refs.sort_by(|a, b| a.timestamp.partial_cmp(&b.timestamp).unwrap());
    
        Ok(refs.pop().map(|val| val.hash))
    }
    

    The entry type we're filtering for consists of a hash and a timestamp:

    pub struct LocalHashReference {
        pub hash: HoloHash<holo_hash::hash_type::Action>,
        pub timestamp: DateTime<Utc>,
    }
    

    Expected behavior chain::query() doesn't stop working when source chain gets filled with data.

    System information:

    • OS: seen on macOS and Linux so far
    • Holochain and HDK Version: 0.0.151 (hdi = "0.0.15", hdk = "0.0.143")

    Additional context Whole DNA: https://github.com/perspect3vism/perspective-diff-sync/tree/main/hc-dna

    opened by lucksus 14
  • HDK v0.0.101 won't compile on MacOS. libsqlite3-sys can't compile for wasm32-unknown-unknown

    HDK v0.0.101 won't compile on MacOS. libsqlite3-sys can't compile for wasm32-unknown-unknown

    I've been working on an HDK wrapping rust crate, but I now realize it won't compile for the wasm target while building on MacOS, because of libsqlite3-sys sneaking in as a dependency, via hdk_derive -> holochain_zome_types -> holo_hash -> rusqlite -> libsqlite3-sys

    Can be seen in CI here: https://github.com/lightningrodlabs/hdk_crud/runs/3257245529#step:4:252

    From the main branch of hdk_crud (https://github.com/lightningrodlabs/hdk_crud) run the following to reproduce.

    cargo build --release --target wasm32-unknown-unknown

       Compiling proc-macro2 v1.0.28
       Compiling unicode-xid v0.2.2
       Compiling syn v1.0.74
       Compiling autocfg v1.0.1
       Compiling version_check v0.9.3
       Compiling libc v0.2.98
       Compiling serde v1.0.123
       Compiling serde_derive v1.0.123
       Compiling autocfg v0.1.7
       Compiling cfg-if v1.0.0
       Compiling ryu v1.0.5
       Compiling getrandom v0.1.16
       Compiling memchr v2.4.0
       Compiling serde_json v1.0.64
       Compiling bitflags v1.2.1
       Compiling rand_core v0.4.2
       Compiling pkg-config v0.3.19
       Compiling cc v1.0.69
       Compiling once_cell v1.8.0
       Compiling lazy_static v1.4.0
       Compiling smallvec v1.6.1
       Compiling unicode-segmentation v1.8.0
       Compiling cfg-if v0.1.10
       Compiling fnv v1.0.7
       Compiling byteorder v1.4.3
       Compiling strsim v0.9.3
       Compiling ident_case v1.0.1
       Compiling scopeguard v1.1.0
       Compiling itoa v0.4.7
       Compiling paste v1.0.5
       Compiling ppv-lite86 v0.2.10
       Compiling convert_case v0.4.0
       Compiling regex-syntax v0.6.25
       Compiling derive_builder v0.9.0
       Compiling either v1.6.1
       Compiling log v0.4.14
       Compiling constant_time_eq v0.1.5
       Compiling arrayvec v0.5.2
       Compiling strum v0.18.0
       Compiling fallible-iterator v0.2.0
       Compiling fallible-streaming-iterator v0.1.9
       Compiling arrayref v0.3.6
       Compiling pin-project-lite v0.1.12
       Compiling base64 v0.13.0
       Compiling predicates-core v1.0.2
       Compiling subtle v2.4.1
       Compiling normalize-line-endings v0.3.0
       Compiling difference v2.0.0
       Compiling treeline v0.1.0
       Compiling ansi_term v0.12.1
       Compiling downcast v0.10.0
       Compiling fragile v1.0.0
       Compiling instant v0.1.10
       Compiling tracing-core v0.1.18
       Compiling sharded-slab v0.1.1
       Compiling rand_chacha v0.1.1
       Compiling rand_pcg v0.1.2
       Compiling rand v0.6.5
       Compiling ahash v0.7.4
       Compiling value-bag v1.0.0-alpha.7
       Compiling num-traits v0.2.14
       Compiling indexmap v1.7.0
       Compiling num-integer v0.1.44
       Compiling rand_core v0.3.1
       Compiling rand_os v0.1.3
       Compiling rand_jitter v0.1.4
       Compiling lock_api v0.3.4
       Compiling lock_api v0.4.4
       Compiling parking_lot_core v0.7.2
       Compiling heck v0.3.3
       Compiling itertools v0.8.2
       Compiling blake2b_simd v0.5.11
       Compiling thread_local v1.1.3
       Compiling predicates-tree v1.0.2
       Compiling libsqlite3-sys v0.22.2
       Compiling parking_lot_core v0.8.3
       Compiling rand_isaac v0.1.1
       Compiling rand_hc v0.1.0
       Compiling rand_xorshift v0.1.1
       Compiling parking_lot v0.10.2
       Compiling time v0.1.43
       Compiling rand_core v0.5.1
       Compiling regex-automata v0.1.10
       Compiling parking_lot v0.11.1
       Compiling aho-corasick v0.7.18
       Compiling quote v1.0.9
       Compiling getrandom v0.2.3
       Compiling rand_chacha v0.2.2
       Compiling matchers v0.0.1
    The following warnings were emitted during compilation:
    
    warning: sqlite3/sqlite3.c:14230:10: fatal error: 'stdio.h' file not found
    warning: #include <stdio.h>
    warning:          ^~~~~~~~~
    warning: 1 error generated.
    
    error: failed to run custom build command for `libsqlite3-sys v0.22.2`
    
    Caused by:
      process didn't exit successfully: `/Users/x/x/libs/hdk_crud/target/release/build/libsqlite3-sys-577f092052a96113/build-script-build` (exit code: 1)
      --- stdout
      cargo:rerun-if-changed=sqlite3/sqlite3.c
      cargo:rerun-if-changed=sqlite3/wasm32-wasi-vfs.c
      cargo:rerun-if-env-changed=SQLITE_MAX_VARIABLE_NUMBER
      cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH
      cargo:rerun-if-env-changed=LIBSQLITE3_FLAGS
      TARGET = Some("wasm32-unknown-unknown")
      OPT_LEVEL = Some("3")
      HOST = Some("x86_64-apple-darwin")
      CC_wasm32-unknown-unknown = None
      CC_wasm32_unknown_unknown = None
      TARGET_CC = None
      CC = None
      CFLAGS_wasm32-unknown-unknown = None
      CFLAGS_wasm32_unknown_unknown = None
      TARGET_CFLAGS = None
      CFLAGS = None
      CRATE_CC_NO_DEFAULTS = None
      DEBUG = Some("false")
      running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/Users/x/x/libs/hdk_crud/target/wasm32-unknown-unknown/release/build/libsqlite3-sys-e21ba9ed8d63f021/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c"
      cargo:warning=sqlite3/sqlite3.c:14230:10: fatal error: 'stdio.h' file not found
      cargo:warning=#include <stdio.h>
      cargo:warning=         ^~~~~~~~~
      cargo:warning=1 error generated.
      exit code: 1
    
      --- stderr
    
    
      error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-DSQLITE_CORE" "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" "-DSQLITE_ENABLE_API_ARMOR" "-DSQLITE_ENABLE_COLUMN_METADATA" "-DSQLITE_ENABLE_DBSTAT_VTAB" "-DSQLITE_ENABLE_FTS3" "-DSQLITE_ENABLE_FTS3_PARENTHESIS" "-DSQLITE_ENABLE_FTS5" "-DSQLITE_ENABLE_JSON1" "-DSQLITE_ENABLE_LOAD_EXTENSION=1" "-DSQLITE_ENABLE_MEMORY_MANAGEMENT" "-DSQLITE_ENABLE_RTREE" "-DSQLITE_ENABLE_STAT2" "-DSQLITE_ENABLE_STAT4" "-DSQLITE_SOUNDEX" "-DSQLITE_THREADSAFE=1" "-DSQLITE_USE_URI" "-DHAVE_USLEEP=1" "-D_POSIX_THREAD_SAFE_FUNCTIONS" "-DHAVE_ISNAN" "-DHAVE_LOCALTIME_R" "-o" "/Users/x/x/libs/hdk_crud/target/wasm32-unknown-unknown/release/build/libsqlite3-sys-e21ba9ed8d63f021/out/sqlite3/sqlite3.o" "-c" "sqlite3/sqlite3.c" with args "clang" did not execute successfully (status code exit code: 1).
    
    
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    
    bug 
    opened by Connoropolous 14
  • `local_network_tests::conductors_remote_gossip` and `local_network_tests::conductors_remote_boot_gossip` fail

    `local_network_tests::conductors_remote_gossip` and `local_network_tests::conductors_remote_boot_gossip` fail

    Hi! I've been experiencing gossip issues when going through a proxy server. This has happened to me both with the proxy at proxy.holochain.org, and running my own with the current tip of develop.

    Investigating, I ran this and this tests, and they both fail.

    This is the result of running hc-merge-test in develop when unignoring those tests:

    failures:
    
    failures:
        local_network_tests::conductors_remote_boot_gossip::_10_10_1
        local_network_tests::conductors_remote_boot_gossip::_10_10_10
        local_network_tests::conductors_remote_boot_gossip::_1_10_1
        local_network_tests::conductors_remote_boot_gossip::_1_1_1
        local_network_tests::conductors_remote_boot_gossip::_1_5_5
        local_network_tests::conductors_remote_boot_gossip::_2_1_1
        local_network_tests::conductors_remote_boot_gossip::_5_1_1
        local_network_tests::conductors_remote_boot_gossip::_5_5_5
        local_network_tests::conductors_remote_boot_gossip::_8_8_8
        local_network_tests::conductors_remote_gossip::_10_10_1
        local_network_tests::conductors_remote_gossip::_10_10_10
        local_network_tests::conductors_remote_gossip::_1_10_1
        local_network_tests::conductors_remote_gossip::_1_1_1
        local_network_tests::conductors_remote_gossip::_1_5_5
        local_network_tests::conductors_remote_gossip::_2_1_1
        local_network_tests::conductors_remote_gossip::_5_1_1
        local_network_tests::conductors_remote_gossip::_5_5_5
        local_network_tests::conductors_remote_gossip::_8_8_8
    
    test result: FAILED. 187 passed; 18 failed; 39 ignored; 0 measured; 0 filtered out; finished in 298.70s
    

    This is an example result of those failures:

    ###HOLOCHAIN_SETUP###
    ###ADMIN_PORT:34375###
    ###HOLOCHAIN_SETUP_END###
    FATAL PANIC PanicInfo {
        payload: Any,
        message: Some(
            assertion failed: `None` does not match `Some(_)`,
        ),
        location: Location {
            file: "crates/holochain/src/local_network_tests.rs",
            line: 474,
            col: 9,
        },
    }
    thread 'main' panicked at 'assertion failed: `None` does not match `Some(_)`', crates/holochain/src/local_network_tests.rs:474:9
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:493:5
       1: std::panicking::begin_panic_fmt
                 at /rustc/88f19c6dab716c6281af7602e30f413e809c5974/library/std/src/panicking.rs:435:5
       2: holochain::local_network_tests::check_gossip::{{closure}}
                 at ./src/local_network_tests.rs:474:9
    
    opened by guillemcordoba 13
  • add list_public_keys to MetaLairClient

    add list_public_keys to MetaLairClient

    Summary

    The ultimate use case for this is to drive a user experience where a user gets to keep their old keys between hApp version migrations. At the moment, there's no good way to do this. The reason for that is that there's no way to just ask the keystore about the keys it has available within it, which means you can't tell whether it has any, or which ones might be usable for installation of a new hApp with. Necessary to add this function because the internals are all private at this level, which seems good.

    Once released, I will use this code over in lightningrodlabs/holochain-runner to provide that experience, but I do need this to be in place.

    @neonphog can you check this over?

    You can see here that I used to do this quite manually, and have the access that I needed: https://github.com/lightningrodlabs/holochain-runner/commit/e54e182f9600a2dc2a43c7b2e857954282e78431#diff-fb0ee6ff1655c8d46559bfc39611fbb6beb92fd22e66846aaabc532c56c727e2L18-L57 but it went away with the recent keystore update

    TODO:

    • [ ] CHANGELOG(s) updated with appropriate info
    • [ ] Just before pressing the merge button, ensure new entries to CHANGELOG(s) are still under the UNRELEASED heading
    opened by Connoropolous 12
  • unable to use

    unable to use "call" function of hc sandbox

    Terminal 1

    hc sandbox run 0 --ports 8888
    
    Mar 23 12:14:15.635 ERROR lair_keystore_client: error=IpcClientConnectError("/private/var/folders/5s/rldbq43s2yj4v5xb89bwygv80000gn/T/wGaAiZnsWdS4Vf98LQW5v/keystore/socket", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" }) file="/Users/connor/.cargo/registry/src/github.com-1ecc6299db9ec823/lair_keystore_client-0.0.1-alpha.11/src/lib.rs" line=42
    
    Conductor ready.
    hc-sandbox: Running conductor on admin port 50085
    hc-sandbox: Attaching app port 8888
    

    Terminal 2

    hc sandbox call -r=50085 list-active-apps
    thread 'main' panicked at 'Failed to create CmdRunner because admin port failed to connect: Io(Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })', /Users/connor/.cargo/git/checkouts/holochain-391184137afba57c/181baec/crates/hc_sandbox/src/lib.rs:159:14
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    opened by Connoropolous 12
  • Only rebuild test_utils for upstream changes

    Only rebuild test_utils for upstream changes

    Softens the "rebuild-every-time" strategy for test_utils/wasm by directly parsing the Cargo.toml to discover upstream local deps. Downstream local changes no longer trigger a rebuild, making rapid iteration on e.g. holochain crate more rapider.

    opened by maackle 12
  • Error installing AppInterface for v121

    Error installing AppInterface for v121

    Hello!

    I've encountered an error while running a conductor sandbox using the following command:

    hc s clean && npm run build:happ && RUST_LOG=warn hc s generate ./workdir/APP.happ --run -n 2 network mdns

    the terminal shows:

    hc-sandbox: Creating 2 conductor sandboxes with same settings
    hc-sandbox: Config ConductorConfig { environment_path: EnvironmentRootPath("/tmp/tmp.qTeWWKyVK0/LAwloneaJRjUN0vhvjj1u"), keystore: LairServerLegacyDeprecated { keystore_path: Some("/tmp/tmp.qTeWWKyVK0/LAwloneaJRjUN0vhvjj1u/keystore"), danger_passphrase_insecure_from_config: "default-insecure-passphrase" }, dpki: None, admin_interfaces: Some([AdminInterfaceConfig { driver: Websocket { port: 0 } }]), network: Some(KitsuneP2pConfig { transport_pool: [Quic { bind_to: None, override_host: None, override_port: None }], bootstrap_service: None, tuning_params: KitsuneP2pTuningParams { gossip_strategy: "sharded-gossip", gossip_loop_iteration_delay_ms: 1000, gossip_outbound_target_mbps: 0.5, gossip_inbound_target_mbps: 0.5, gossip_historic_outbound_target_mbps: 0.1, gossip_historic_inbound_target_mbps: 0.1, gossip_peer_on_success_next_gossip_delay_ms: 60000, gossip_peer_on_error_next_gossip_delay_ms: 300000, gossip_local_sync_delay_ms: 60000, gossip_dynamic_arcs: false, gossip_single_storage_arc_per_space: false, default_rpc_single_timeout_ms: 30000, default_rpc_multi_remote_agent_count: 3, default_rpc_multi_remote_request_grace_ms: 3000, agent_info_expires_after_ms: 1200000, tls_in_mem_session_storage: 512, proxy_keepalive_ms: 120000, proxy_to_expire_ms: 300000, concurrent_limit_per_thread: 4096, tx2_quic_max_idle_timeout_ms: 30000, tx2_pool_max_connection_count: 4096, tx2_channel_count_per_connection: 2, tx2_implicit_timeout_ms: 30000, tx2_initial_connect_retry_delay_ms: 200 }, network_type: QuicMdns }), db_sync_strategy: Fast }
    hc-sandbox: Created directory at: /tmp/tmp.qTeWWKyVK0/LAwloneaJRjUN0vhvjj1u Keep this path to rerun the same sandbox
    hc-sandbox: Created config at /tmp/tmp.qTeWWKyVK0/LAwloneaJRjUN0vhvjj1u/conductor-config.yaml
    Jan 19 10:29:45.673  WARN holochain::conductor::conductor::builder: Using DEPRECATED legacy lair api.
    Jan 19 10:29:45.673  WARN holochain::conductor::conductor::builder: USING INSECURE PASSPHRASE FROM CONFIG--This defeats the whole purpose of having a passphrase.
    Jan 19 10:29:45.673 ERROR lair_keystore_client: error=IpcClientConnectError("/tmp/tmp.qTeWWKyVK0/LAwloneaJRjUN0vhvjj1u/keystore/socket", Os { code: 2, kind: NotFound, message: "No such file or directory" }) file="/build/cargo-vendor-dir/lair_keystore_client-0.0.9/src/lib.rs" line=41
    
    Conductor ready.
    Error: Failed to install app: Expected AdminResponse::AppBundleInstalled but got Error(InternalError("Conductor returned an error while using a ConductorApi: EntryDefStoreError(DnaError(WasmError(Compile(\"Error while importing \\\"env\\\".\\\"__app_info\\\": unknown import. Expected Function(FunctionType { params: [I32, I32], results: [] })\"))))"))
    

    I suspect it's due to the removal of app info in version 121 however I couldnt find the source of this error. I've tried this with an empty happ and the error still popped up.

    my default.nix config running on Ubuntu 20.04:

    
    let
    
      holonixRev = "9c9a5a00dc05b0825841fae4ff8181182d9949ce";
    
      holonixPath = builtins.fetchTarball "https://github.com/holochain/holonix/archive/${holonixRev}.tar.gz";
      holonix = import (holonixPath) {
        holochainVersionId = "v0_0_121";
      };
      nixpkgs = holonix.pkgs;
    in nixpkgs.mkShell {
      inputsFrom = [ holonix.main ];
      buildInputs = with nixpkgs; [
        binaryen
        nodejs-16_x
      ];
    }  
    
    

    holochain cli version:

    hc -V
    holochain_cli 0.0.22
    

    Let me know if theres anything else needed!

    need reproduction 
    opened by axhue 10
  • Improve compatibility of holochain types with Zome WASM, unify Timestamp type

    Improve compatibility of holochain types with Zome WASM, unify Timestamp type

    There are two implementations of the Timestamp; this merges them into one, and makes the Timestamp type available in WASM code. The now() method was moved from being an impl for Timestamp, eg. Timestamp::now(), to be a free-floating function in the crate, eg. timestamp::now(), so code changes are minimal and easy to understand. This improves the log output considerably, as Timestamps are always Debug-formatted as times, not as a pair of big numbers. Also, updated the fixt plumbing to actually create more-or-less "correct" random Timestamps for testing, so that conversion to Duration and SystemTime won't fail during tests that assume sane Timestamps for comparison.

    In addition, various holochain error types lacked some derive implementation, making it difficult to write Zome test code in rust (as Err types couldn't be compared).

    Finally, the holo_hash types and related functions were moved around a bit, to allow Zome code to build "wrappers" around all DHT times, allowing them to be De/Serialized as Strings for use over Zome API calls. This code is not included here, but used heavily in hash-heavy Zomes, such as the new holofuel implementation I'm working on...

    o Move Timestamp from holochain/types to zome_types o Give more ...Error types Debug, PartialEq, ... for Rust testing o Move some holo_hash types/impls around so they work in Zome code o Convert Timestamp::now() impl method to timestamp::now() function In order for Timestamp to be WASM compatible and usable in Zome code, we've moved it to holochain_wasm_types, and made the holochain_types timestamp now() a function, instead of a Timestamp::now() method. Minimal code change, vastly improved Zome coding experience. o Update base64 crate to avoid multiple inclusions

    opened by pjkundert 10
  • rollup of rust related PRs

    rollup of rust related PRs

    Summary

    TODO:

    • [ ] CHANGELOG(s) updated with appropriate info
    • [ ] Just before pressing the merge button, ensure new entries to CHANGELOG(s) are still under the UNRELEASED heading
    opened by steveeJ 0
  • chore(default.nix): bump rust version to 1.66

    chore(default.nix): bump rust version to 1.66

    Summary

    How about this?

    TODO:

    • [ ] CHANGELOG(s) updated with appropriate info
    • [ ] Just before pressing the merge button, ensure new entries to CHANGELOG(s) are still under the UNRELEASED heading
    opened by jost-s 2
  • Fix up some problems for rust 1.68.0-nightly, so docs can be built

    Fix up some problems for rust 1.68.0-nightly, so docs can be built

    Summary

    Just ran cargo check using latest nightly and fixed any errors and warnings.

    TODO:

    • [ ] CHANGELOG(s) updated with appropriate info
    • [ ] Just before pressing the merge button, ensure new entries to CHANGELOG(s) are still under the UNRELEASED heading
    opened by maackle 0
  • Improve docs on recent changes

    Improve docs on recent changes

    Summary

    • Adds docs for Cell and StemCell struct AppInfo variants
    • Fixes references to "role id"

    TODO:

    • [ ] CHANGELOG(s) updated with appropriate info
    • [ ] Just before pressing the merge button, ensure new entries to CHANGELOG(s) are still under the UNRELEASED heading
    opened by zippy 0
  • Use serde_bytes for mr_bundle::ResourceBytes

    Use serde_bytes for mr_bundle::ResourceBytes

    Summary

    TODO:

    • [ ] CHANGELOG(s) updated with appropriate info
    • [ ] Just before pressing the merge button, ensure new entries to CHANGELOG(s) are still under the UNRELEASED heading
    opened by maackle 0
  • Bump lru from 0.6.6 to 0.8.1

    Bump lru from 0.6.6 to 0.8.1

    Bumps lru from 0.6.6 to 0.8.1.

    Changelog

    Sourced from lru's changelog.

    v0.8.1 - 2022-10-01

    • Add "caching" and "no-std" to list of categories.

    v0.8.0 - 2022-09-11

    • Use NonZeroUsize for LRU capacity instead of usize.
    • Add get_or_insert_mut method which is similiar to get_or_insert but returns a mutable reference instead of an immutable reference.
    • Add LruCache::promote and LruCache::demote API to manipulate LRU order of the entry directly.

    v0.7.8 - 2022-07-19

    • Update dependency on hashbrown to 0.12.

    v0.7.7 - 2022-06-14

    • Use FnOnce instead of Fn for trait bound of fn in get_or_insert.

    v0.7.6 - 2022-05-25

    • Add pop_entry method.

    v0.7.5 - 2022-04-04

    • Add push method.

    v0.7.4 - 2022-04-03

    • Implement IntoIterator trait and fix lifetime bug in get_or_insert.

    v0.7.3 - 2022-02-28

    • Add get_or_insert method.

    v0.7.2 - 2021-12-28

    • Explicitly implement Borrow for Box for non-nightly.

    v0.7.1 - 2021-12-18

    • Fix lifetime of iterators.

    v0.7.0 - 2021-09-14

    • Explicitly implement Borrow for String and Vec types for non-nightly.
    Commits
    • cf063f6 Merge pull request #156 from jeromefroe/jerome/prepare-0-8-1-release
    • 3d69719 Prepare 0.8.1 release
    • 6db1654 Merge pull request #155 from rtzoeller/add-categories
    • f6ada6a Add categories to Cargo.toml
    • e2e887e Merge pull request #154 from jeromefroe/jerome/prepare-0-8-0-release
    • b388382 Prepare 0.8.0 release
    • 29561cb Merge pull request #152 from matklad/promete-demote
    • ad3adcc Add API to directly manipulate LRU order
    • ff6c80e Merge pull request #151 from Yosi-Hezi/get_mut_or_insert
    • d5230df Merge pull request #153 from matklad/lifetime-bug
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    NO-MERGE (dependency) rust 
    opened by dependabot[bot] 0
Releases(holochain-0.1.0-beta-rc.2)
Owner
Holochain
Scalable framework for P2P distributed apps. For all those projects you wish you could take from centralized web servers but you know can't scale on blockchain.
Holochain
IBC modules and relayer - Formal specifications and Rust implementation

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project comprises primarily four crates: The ibc crate defines t

Informal Systems 296 Jan 4, 2023
Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.

Note to readers: On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. A

Diem 16.7k Dec 29, 2022
The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.

Nervos CKB - The Common Knowledge Base master develop About CKB CKB is the layer 1 of Nervos Network, a public/permissionless blockchain. CKB uses Pro

Nervos Network 1k Dec 31, 2022
The fast, light, and robust client for the Ethereum mainnet.

OpenEthereum Fast and feature-rich multi-network Ethereum client. » Download the latest release « Table of Contents Description Technical Overview Bui

OpenEthereum 1.6k Dec 28, 2022
The Phala Network Blockchain, pRuntime and the bridge.

Phala Blockchain Phala Network is a TEE-Blockchain hybrid architecture implementing Confidential Contract. This repo includes: node/: the main blockch

Phala Network 313 Dec 20, 2022
rage is a simple, modern, and secure file encryption tool, using the age format

A simple, secure and modern encryption tool (and Rust library) with small explicit keys, no config options, and UNIX-style composability.

null 1.7k Jan 2, 2023
A Rust library for working with Bitcoin SV

Rust-SV A library to build Bitcoin SV applications in Rust. Documentation Features P2P protocol messages (construction and serialization) Address enco

Brenton Gunning 51 Oct 13, 2022
Coinbase pro client for Rust

Coinbase pro client for Rust Supports SYNC/ASYNC/Websocket-feed data support Features private and public API sync and async support websocket-feed sup

null 126 Dec 30, 2022
Custom Ethereum vanity address generator made in Rust

ethaddrgen Custom Ethereum address generator Get a shiny ethereum address and stand out from the crowd! Disclaimer: Do not use the private key shown i

Jakub Hlusička 153 Dec 27, 2022
A Rust implementation of BIP-0039

bip39-rs A Rust implementation of BIP0039 Changes See the changelog file, or the Github releases for specific tags. Documentation Add bip39 to your Ca

Infincia LLC 49 Dec 9, 2022
Rust Ethereum 2.0 Client

Lighthouse: Ethereum 2.0 An open-source Ethereum 2.0 client, written in Rust and maintained by Sigma Prime. Documentation Overview Lighthouse is: Read

Sigma Prime 2.1k Jan 1, 2023
Official Rust implementation of the Nimiq protocol

Nimiq Core implementation in Rust (core-rs) Rust implementation of the Nimiq Blockchain Core Nimiq is a frictionless payment protocol for the web. Thi

Nimiq 72 Sep 23, 2022
Rust implementation of Zcash protocol

The Parity Zcash client. Gitter Blog: Parity teams up with Zcash Foundation for Parity Zcash client Installing from source Installing the snap Running

Parity Technologies 183 Sep 8, 2022
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022
Tendermint in Rust!

tendermint.rs Tendermint in Rust with TLA+ specifications. Tendermint is a high-performance blockchain consensus engine for Byzantine fault tolerant a

Informal Systems 439 Jan 1, 2023
A Rust library for generating cryptocurrency wallets

Table of Contents 1. Overview 2. Build Guide 2.1 Install Rust 2.2a Build from Homebrew 2.2b Build from Crates.io 2.2c Build from Source Code 3. Usage

Aleo 554 Dec 31, 2022
Rust port of the Terry Davis' (RIP) "god says" program

RIP Terry A. Davis 1969-2018 god says Rust port of the programmer Terry Davis' "god says" (AKA GodSpeaks) program. Terrence Andrew Davis (December 15,

Orhun Parmaksız 54 Dec 26, 2022
Implementation of the Kademlia DHT protocol in Rust

kademlia-dht Simple implementation of the Kademlia DHT protocol in Rust with state dumping features for educational purposes (not production-ready). T

Leonardo Folgoni 18 Sep 24, 2022
Collection of Key Derivation Functions written in pure Rust

RustCrypto: Key Derivation Functions Collection of Key Derivation Functions (KDF) written in pure Rust. Supported Algorithms Algorithm Crate Crates.io

Rust Crypto 44 Dec 25, 2022