[Gym] Help needed! Offer/Request

I didn’t notice any problems with nix.

I did upgrade the dependencies, with give better errors. Which is very good, but the error I get with my current code (just committed to repo) gives me this error.
So now I’m wondering if I do anything wrong or if I’m running into a holochain bug?

ERROR wasm_trace: holochain_wasmer_guest:/home/holodev/holochain-gym/developer-exercises/basic/1.hashes/.cargo/registry/src/github.com-1ecc6299db9ec823/holochain_wasmer_guest-0.0.67/src/guest.rs:89 output_type = “holo_hash::hash::HoloHash<holo_hash::hash_type::primitive::Header>”; bytes = [196, 39, 132, 41, 36, 64, 246, 134, 67, 123, 40, 119, 15, 110, 98, 105, 157, 129, 191, 226, 1, 63, 140, 233, 35, 106, 26, 231, 154, 58, 86, 201, 246, 234, 33, 227, 101, 37, 208, 62, 62]; Deserialize(“wrong msgpack marker Bin8”)

Uaks no idea… Yeah I don’t think you’re doing anything wrong, it’s just the holochain versioning I think… Which to be honest right now is a mess, just before publishing the hdk. My hunch is that it’s better to spend our energy elsewhere for now, until that happens (should be today).

1 Like

Hi All, Not sure if this is the right place to post this but I just wanted to let you know that this link is dead -> https://github.com/holochain/holochain/blob/develop/crates/hdk3/src/prelude.rs . It’s referenced on the Get Ready section (https://holochain-gym.github.io/developers/basic/entries/) .

2 Likes

Hi @SQLEinstein,

Thanks for the feedback. Holochain is still in rapid development, so the hologym exercises might break more often than we would like. I’m currently trying to figure out how to pin the existing exercises to all the right versions.
The core concepts have not changed, so everything you read on hologym still holds true.

I will fix the link as soon as I figure the dependencies out. For now this is the right link.

Hdk3 was renamed to hdk :slight_smile:

2 Likes

I’m going to play around with a game for collective governance of and within small groups

Is there anything I can do to help the gym?

Sure :slight_smile: ! I think the best thing as of now is to try it out, give feedback and suggestions to improve it. Later if you see you have energy to implement exercises from the list that we have, you could also contribute that.

Hi @guillemcordoba, thank you so much for your efforts so far in making the holochain gym happen. If you’re after some feedback, I can give you my impressions on exercises 1 and 2 (entries, hashes) as well as my background knowledge to provide better context for my suggestions as a newcomer. :slight_smile:

I’m a Python dev with a bioinformatics background. I’m familiar enough with Rust to google what I need to google EDIT: but would still consider myself a beginner. It’s a cool language! My flow of understanding of what holochain is and how to use it went something like this:

Discover holochain → Read through the (stunningly good) core concepts page → Install holochain via nix-shell on a Ubuntu Linux subsystem for windows → Ready to code → No hello World tutorial for RSM → Google for tutorials but they’re all for pre-RSM → Find ‘migration’ page but it’s not clear how this helps me / some hc commands don’t work yet or haven’t been implemented → Go to dev forum → Find gym and holochain-dna tutorial

So for me, the Gym is my first exposure to actually seeing the core concepts being implemented in code-space. Pre-gym, I’d never seen a folder layout for a typical project, or where the DNA lives in wasm form, or how zomes are laid out, or what the default.nix is.

My first recommendation would be to, prior to ‘0.entries’, walk through a typical DNA layout a bit like holochain-dna tutorial and show where this type of package resides in relation to the Cell and Orchestrater. Tryorama can come later, and the higher order stuff can be suspended for now while the basics are laid down, but I think it’s important to show learners where their current exercise sits in the hierarchy of future knowledge they will learn and where in the Core Concepts their lesson sits.

Second recommendation - introduce the pertinent elements of hdk::prelude at the top of each exercise + show useful rust hdk code (or link to it). I think this will help the user understand where these commands come from and encourage them to dive into the crate documentation (which I had to do for Hashes). You probably don’t have to type it all out, but even just a link to the docs and a suggestion to go from there wouldn’t be amiss.

Third recommendation - I was working through the newly updated Hashes exercise last night and got a little stumped with 2 things (spoilers for solutions):

  1. use holo_hash::EntryHashB64
    I’m not sure where this came from, and not sure what I could have done to find it. I’ve never seen any mention of the holo_hash package before this, and thought I was limited to using the hdk exclusively. I think this feeds back into my first recommendation - tutorials are currently so scarce, coding with holochain is partly an exercise in figuring out what I need to do to then learn how to do it.

  2. Anything WebAssembly related needs explanation to me, eg this line on the get result (ExternResult<Option>)

    .ok_or(WasmError::Guest(String::from(“Could not find book”)))?

This WasmError pattern is foreign to me (you should have seen the double matching code I originally had for handling the nested Option, it was gloriously terrible :sob:)

Where does the WasmError come from, why is it necessary, what code needs to be handled in WASM, etc.

That’s where I’m at so far. I think a general improvement I can recommend is this: within a chapter page, after the graph/interactive examples (which are so good), introduce a code pattern with a simple, complete example, and then end the chapter with a more complicated test. While I’m having a lot of fun learning on my own and figuring stuff out, it’s taking a while, and I think ultimately I’m scrambling for patterns and reading docs and only half understanding the core concepts because I have no baseline to check my knowledge against with simple examples. I’d really benefit from a pattern introduction → visual example–> complete example → test.

And with all of those suggestions aside, let me also say this: thank you :handshake:. This has been amazing fun so far, and your gym is hands down the best dev introduction currently out there. I would love to continue to learn more, and to that end, I offer myself as a beta tester and second pair of eyes for your upcoming chapters, if you’ll have me. Maybe it would be useful for someone like me to come in and ask seemingly dumb questions to help refine and target the message of the chapters so that the gym can be a stronger place for newcomer and holochain enthusiasts alike.

Let me know - send me a message or reply here. Otherwise, just happy to provide feedback as I go.

5 Likes

This is so cool! I’m amazed :smiley:

Thank you for your clear and sensible feedback. You make a lot of good points, and this kind of interaction is what I want for the gym - group co-creation, more than one person doing all the exercises.

I think for now this forum is a good enough place to do the feedback, this way other people also have visibility. It may also be good to create a tag for it to group the different posts.

As far as your individual suggestions, two things come to mind:

  • Creation of a FAQs page (to address the WasmError thing for example)
  • Having the first step of the gym be cloning the dna build tutorial repo and playing around with it
    • I also know there are people that prefer to start with the details and expand the vision bigger afterwards, but we can just offer the option to go to the dna build tutorial if they want
  • Removing EntryHashB64, as it doesn’t add any new thing here and it isn’t worth to explain in this exercise

In the recent hashes exercise, I loved how @tixel made the participants play with the hashes of the entries, as it forced you to see how they work by playing with them. How was your experience with that interaction?

We need more beta testers, so that’s awesome. Even if you want to learn more about a particular concept and would want to create an exercise by yourself, that would be even more awesome :smiley: . I can offer help with the concepts to guide you in that process.

1 Like

This is so cool! I’m amazed :smiley:

Thank you for your clear and sensible feedback. You make a lot of good points, and this kind of interaction is what I want for the gym - group co-creation, more than one person doing all the exercises.

I think for now this forum is a good enough place to do the feedback, this way other people also have visibility. It may also be good to create a tag for it to group the different posts.

My pleasure! When future updates are pushed I’ll also provide more feedback here; perhaps a google doc with comments so you can get a line-by-line approach in addition to overview-level suggestions.

As far as your individual suggestions, two things come to mind…

All that sounds good to me.

In the recent hashes exercise, I loved how @tixel made the participants play with the hashes of the entries, as it forced you to see how they work by playing with them. How was your experience with that interaction?

Yes that was cool, well done @tixel - the effort that goes into those visual examples pays off, I think. There’s nothing quite like seeing it in action. I was actually a little surprised by the quite detailed explanation of hashing, though, not in that it was unwelcome, but rather that I was struggling to understand other things but I already knew basically what hashing was and why we did it. If the same level of explanation went into the other elements of holochain as went into explaining simple hashing, that would be amazing.

Oh one thing I can mention about the “Getting Ready” section. Maybe a brief explanation of the different hashes in the signed_header would be good: header::content::entry_hash, author, prev_header and the header::hash. This would help the user in differentiating which hash they should be searching for in their own code (the header hash, not the content hash). In the subsequent Test section, it’d then be good to remind/show the user in tests\src\index.tswhat that entryHash is (the header::hash from before) and how the get_book() code plays with that type of hash, which can be traced back to what we just learned.

We need more beta testers , so that’s awesome. Even if you want to learn more about a particular concept and would want to create an exercise by yourself, that would be even more awesome :smiley: . I can offer help with the concepts to guide you in that process.

I’d love to help write something, or learn enough about it to then write it up for others. Although I tend to work better with ‘let’s make a simple X’ kind of approach, maybe exploring a solo concept wouldn’t be a bad start. Is there one you can recommend? Neighborhoods and verification come to mind, but I wonder if that’s too advanced for now.

1 Like

Yes to all of that, thanks again.

As far as your last point goes, I think neighborhoods are out of the scope for the gym as of now (there is little that a happ dev can do about them other than knowing what they are, which may require an architecture exercise). Maybe links or source-chain would be a good start? @tixel is already working on the elements one, and the others are quite basic and have the benefit to already have the interactive exercise up and running. What do you think?

1 Like

Links did cross my mind actually, and it’s yet to be completed. I can do some reading in the docs and make sure I’m up to speed with both entries and links before theory-crafting a test or getting some feedback? Don’t stop on my account, though, if you already had plans for that one - I don’t want to tread on anyone’s draft.

2 Likes

Actually my intention is to make those basic exercises be made by new contributors as much as possible, so what would be awesome. Links are a basic enough concept that it should be quite easy to start I think. I’m here for whatever help you need in understanding / building anything around that :slight_smile:

2 Likes

Hi @_pyramid,

Thanks for all the feedback and kind words. A big part of the credits go to @guillemcordoba for building the playground/simulation component. I just copy pasted them in the parts that I wrote. Without him you would get plain text with a mousedrawn MS paint diagram :smiley: Actually we wouldn’t even have the gym :kudos:

For the record: I too like the tight read-do loop the simulations enable.

I definitely like this idea.

I’m currently working on a chapter on hashes, which should explain a lot of this stuff: preview. But it might be a good idea to paint a quick, more complete picture in the beginning. So that terms as entry_hash, headerhash, source-chain have touched your eyes before you dive in.
The basics idea I was following within the basic exercises, was to keep the number of concepts to a minimum. And with each exercise to repeat those concepts and a just a few more concepts. So we don’t overload people.
That is why a seasoned holochain developer might read a lot of half truths in the exercises.

Thanks again and welcome to holochain-gym staff!

3 Likes

Hi Tixel! I didn’t realise @guillemcordoba made those playgrounds! I misread that part of the post, my apologies for that. But yes, I think that section on playing with the hashes was good. You mentioned you were working on the hashes chapter and provided a link to a preview, but I think that link in your post didn’t go through unfortunately. Was it this branch?

Without him you would get plain text with a mousedrawn MS paint diagram

I do love those drawings though! This one made me laugh. And the analogy with the islands was beautiful, so there’s something to be said about a good MS paint masterpiece.

The basics idea I was following within the basic exercises, was to keep the number of concepts to a minimum. And with each exercise to repeat those concepts and a just a few more concepts. So we don’t overload people.

Definitely worth building upon the concepts piece by piece, and I think it’ll take a few goes for me to get that balance right: knowing exactly how much to say now or save for later.

Thanks again and welcome to holochain-gym staff!

Oh thank you :blush: It’s really cool to be a small part of this and contribute, so thanks for being so welcoming (@guillemcordoba too). I’ve already taken a look at the links chapter currently online and made some notes, so when I’m ready to get some feedback on my ideas I’ll post it up - should I make a branch in the holochain gym repo or just DM it here on the forums?

One last thought: In my original post I mentioned that I had some familiarity with Rust, but I probably didn’t make it clear that I’d still consider myself a beginner in the language. In my plans and feedback for chapters, occasionally I’ll have a question for you and guillem that might be rust-specific, but I’ll try and keep these to a minimum and google instead :sweat_smile: Hope that’s ok.

Guillem,
Please leave the EntryHashB64 stuff in there. I was looking for an elegant way to get hashes in and out of zomes. And this works more explicit than WrappedEntryHash.
Plus we can remove hc_utils dependency, as you did. And make the general setup simpler.

Hi there @tixel, @guillemcordoba. Over the past few days I’ve produced a draft of some code examples for links including Orchestrator tests. In addition, I’ve been working on a write-up to complement what is already in the links.md page of the gym. I’ve made a fork of the developer-exercises and pushed my changes to a new branch. Once the code looks right, I’ll upload my changes to the gym :slight_smile:

Very keen to get any sort of feedback on Rust structures, how the functions behave, what the tests are like.

1 Like

Hi @_pyramid, thanks for this :smiley:

So the code looks good, but I would do something much more concrete, not so generic. I would make a Post struct, and two functions:

create_post(content: String) -> EntryHash: create entry and link entry from agent_info()?.agennt_latest_pubkey
get_posts_for_agent(agent_pub_key: AgentPubKey) -> Vec<Post>: get links from the given pubkey and do a get for every link target

This way, you can get a much more “usual” use case in which you wrap the hdk core functions with the actual endpoints that your app needs. This makes it much more understandable IMO.

What do you think?

1 Like

Thanks for the suggestions; I think you’re right. My current examples tend towards very basic inputs and outputs, where I can instead show a more usable example. I’ll work on this and let you know when another update is ready for review.

1 Like

Another update here, and testing here :slight_smile:

1 Like

That is awesome! Congrats for this. Do you wanna make a PR?

1 Like