Holochain Forum

About the RSM Technical Discussion! category

This is a space for technical discussion of Holochain RSM.

Resources to learn about RSM:
Holochain RSM Repo
Medium Post - Official org update
Video of Guillem, Hedayat, Lily, Sid and Nastasia going over the RSM repo
Building a DNA
dna_util command reference
The test suite, currently the best place for examples of how to use the API and HDK
Information and guidelines on serialising your data, including entries and function parameters/returns
Temporary Node-based replacement for hc run
‘Living document’ of gotchas you might encounter with the pre-release code, curated by community devs

7 Likes

We’re hosting an RSM specific discussion in the Modularity Hackalong tomorrow. Details here:

2 Likes

Access seems to be closed.

1 Like

Thanks! Can you try again @ldwm?

Thanks, it works now!

2 Likes

Hi Guys,

Just been following your instructions below, but I got a permission denied error message (below), any ideas?

[email protected]:~$ git clone [email protected]:holochain/holochain.git
Cloning into ‘holochain’…
The authenticity of host ‘github.com (140.82.121.4)’ can’t be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type ‘yes’, ‘no’ or the fingerprint: yes
Warning: Permanently added ‘github.com,140.82.121.4’ (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.”

Also, I installed Nix as per the instructions in the link below, but when I run “nix-shell” I get this error message:

[email protected]:~$ nix-shell
error: getting status of ‘/home/dellams/default.nix’: No such file or directory”

I am using WSL2 on Windows 10, which worked fine for the previous hc with holocain.love. I presume that still points to the redux version? When will it be updated to the new version do you think? :slight_smile:

Keep up the great work, really impressed with the new version and keen to upgrade HoloNET .NET/Unity client & .NET HDK to it along with my other hc code… thanks :slight_smile:

Cheers
D.

@dellams I’m not sure why you would get that git/ssh error, but I’d recommend just try cloning from the https version of the URL…
git clone https://github.com/holochain/holochain.git

Then, with nix, you have to run nix-shell INSIDE the holochain directory. So first
cd holochain

then

nix-shell

then

hc-install

1 Like

HI There -

Will RSM version still be an ERC-20 protocol or will it be a newer protocol?

Great thanks, I now get this error:

"[email protected]:~/holochain$ nix-shell
unpacking ‘https://github.com/holochain/holonix/tarball/v0.0.83’…
error: Package ‘ngrok-2.3.29’ in /nix/store/h8yv9z8l0fqfbas6wdwy7lzagnpwqg3v-source/pkgs/tools/networking/ngrok-2/default.nix:43 has an unfree license (‘unfree’), refusing to evaluate.

a) For nixos-rebuild you can set
{ nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For nix-env, nix-build, nix-shell or any other Nix command you can add
{ allowUnfree = true; }
to ~/.config/nixpkgs/config.nix."

But I cannot see any configuration.nix, where is this file? I am surprised it doesn’t just work? Thanks.

@dellams it’s the b) option that you want, not a).
config.nix.

Check out this: https://nixos.wiki/wiki/FAQ/How_can_I_install_a_proprietary_or_unfree_package%3F

1 Like

Why won’t the tests succeed?

hc-merge-test says:


failures:
conductor::compat::tests::test_build_conductor_from_legacy_regression
core::workflow::sys_validation_workflow::tests::sys_validation_workflow_test

test result: FAILED. 185 passed; 2 failed; 21 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass ‘-p holochain --lib’


Neither did the elemental-chat tests succeed! (Possibly due to the above)


Has all this got anything to do with the tryorama update going on???

Side question: Is the Holochain RSM’s develop branch to be trusted or the main branch? When might we have a (pre)release branch??? ‘develop’ rather sounds like it’s under development and possibly doesn’t compile!


EDIT: https://github.com/holochain/holochain/issues/469, just in case.

Ok thanks, its installing now… :slight_smile:

What version is RSM currently at? I got it all installed but when I checked the version it came back with hc 0.0.51-alpha1? That looks like Redux version? Bit confused because I downloaded the RSM one as instructed… I will try it again just in case… hmmmm… odd.

Also, when I run the hc-merge-test as the instructions state, I get this error:

[nix-shell:~/holochain]$ hc-merge-test
+ RUST_BACKTRACE=1
+ hn-rust-fmt-check
checking rust formatting
Diff in /home/dellams/holochain/crates/hdk/src/guest_callback/entry_defs.rs at line 65:
             type Error = $crate::prelude::HdkError;
             fn try_from(entry: &$crate::prelude::Entry) -> Result<Self, Self::Error> {
                 match entry {
-                    $crate::prelude::Entry::App(eb) => Ok(Self::try_from($crate::prelude::SerializedBytes::from(
-                        eb.to_owned(),
-                    ))?),
+                    $crate::prelude::Entry::App(eb) => Ok(Self::try_from(
+                        $crate::prelude::SerializedBytes::from(eb.to_owned()),
+                    )?),
                     _ => Err($crate::prelude::SerializedBytesError::FromBytes(format!(
                         "{:?} is not an Entry::App so has no serialized bytes",
                         entry

Any ideas? Thanks :slight_smile:

See https://github.com/holochain/holochain/issues/469#issuecomment-725986664.

Anyways, any idea how to init/create a fresh new RSM happ??? Is it hc-happ-create??? Or hc init??? And yeah, as @dellams pointed out, “hc --version” does return 0.0.51-alpha! Kinda strange… And “holochain” command doesn’t have an init!

Why I don’t feel safe continuing with RSM until it is ready to be used… clearly it is not… unless someone can convince me it is fine to use now? What version is RSM? None of this makes sense… need clarity please… thanks.

@dellams if you were following my last set of pointers, but forgot hc-install then you’d still see the old holochain version.

hc-install inside the holochain/holochain nix-shell will overwrite the old version of holochain that is still currently in holonix, but is likely to be removed really soon.

I have run hc-install already and version number is still wrong?

Any ideas?

What should the new zomes look like?


#[macro_use]

extern crate hdk;

extern crate serde;

#[macro_use]

extern crate serde_derive;

extern crate serde_json;

#[macro_use]

extern crate holochain_json_derive;

use hdk::{

    entry_definition::ValidatingEntryType,

    error::ZomeApiResult,

};

use hdk::holochain_core_types::{

    entry::Entry,

    dna::entry_types::Sharing,

};

use hdk::holochain_persistence_api::{

    cas::content::Address,

};

use hdk::holochain_json_api::{

    error::JsonError,

    json::JsonString,

};

// see https://developer.holochain.org/api/0.0.51-alpha1/hdk/ for info on using the hdk library

// This is a sample zome that defines an entry type "MyEntry" that can be committed to the

// agent's chain via the exposed function create_my_entry

#[derive(Serialize, Deserialize, Debug, DefaultJson,Clone)]

pub struct MyEntry {

    content: String,

}

pub fn handle_create_my_entry(entry: MyEntry) -> ZomeApiResult<Address> {

    let entry = Entry::App("my_entry".into(), entry.into());

    let address = hdk::commit_entry(&entry)?;

    Ok(address)

}

pub fn handle_get_my_entry(address: Address) -> ZomeApiResult<Option<Entry>> {

    hdk::get_entry(&address)

}

fn definition() -> ValidatingEntryType {

    entry!(

        name: "my_entry",

        description: "this is a same entry defintion",

        sharing: Sharing::Public,

        validation_package: || {

            hdk::ValidationPackageDefinition::Entry

        },

        validation: | _validation_data: hdk::EntryValidationData<MyEntry>| {

            Ok(())

        }

    )

}

define_zome! {

    entries: [

       definition()

    ]

    init: || { Ok(()) }

    validate_agent: |validation_data : EntryValidationData::<AgentId>| {

        Ok(())

    }

    functions: [

        create_my_entry: {

            inputs: |entry: MyEntry|,

            outputs: |result: ZomeApiResult<Address>|,

            handler: handle_create_my_entry

        }

        get_my_entry: {

            inputs: |address: Address|,

            outputs: |result: ZomeApiResult<Option<Entry>>|,

            handler: handle_get_my_entry

        }

    ]

    traits: {

        hc_public [create_my_entry,get_my_entry]

    }

}

Cheers
D.

If you have stable rust installed locally, you could also run two commands very similar to these ones, found in this little ‘install script’ that is in use for a CI setup.

cargo install --force holochain --git https://github.com/holochain/holochain.git
cargo install --force dna_util --git https://github.com/holochain/holochain.git

Here’s a sample of zome code

Upon running hc-merge-test,

...
running 1 test
test core::ribosome::slow_tests::warm_wasm_tests ... FAILED

In detail:

failures:

---- core::ribosome::slow_tests::warm_wasm_tests stdout ----
Fixturator seed: 1329776636451767664
thread 'core::ribosome::slow_tests::warm_wasm_tests' panicked at 'Wasm: "/home/theaman/holochain/.wasm_target/wasm32-unknown-unknown/release/test_wasm_imports.wasm" was not found. Maybe you need to build the test wasms

        Run `cargo build --features 'build_wasms' --manifest-path=crates/holochain/Cargo.toml`
        or pass the feature flag to `cargo test`