Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add exercise to source chain chapter #24

Closed
tixel opened this issue Apr 10, 2021 · 4 comments
Closed

add exercise to source chain chapter #24

tixel opened this issue Apr 10, 2021 · 4 comments
Assignees

Comments

@tixel
Copy link
Collaborator

tixel commented Apr 10, 2021

No description provided.

@tixel tixel self-assigned this Apr 10, 2021
@tixel tixel added this to Doing in Gym Exercises Apr 10, 2021
@guillemcordoba
Copy link
Contributor

guillemcordoba commented Apr 11, 2021

Do you think we need a separate elements chapter? I think it would be good to show different elements and their contents, as a semi-step building up to the source-chain, where doing a query will surely be the main thing. I can do the elements one :)

So it would be:

  • Headers: oh our entries always come with attached metadata
  • Elements: oh there are many different types of headers, and together with the entries (if they are present) they form an element, that can be queried from the DHT.
  • Source-chain: oh the elements are chained together and I can do a query to find them from the node's storage.

@tixel
Copy link
Collaborator Author

tixel commented Apr 12, 2021

Hi Guillem,
The query stuff is new to me.

I was doubting between
first explaining the fundamentals: entries, hashes, headers, source chain
in there most basic form, with little distraction
to ease people in to Rust & holochain
And then in the 2nd part of Basic exercises
to start focusing on everything you need to build happs:
elements+queries, links, anchors

But it is probably easier to decide the right structure once we have all the building blocks.
We can even A/B test it if we want :-D

I commited my work in progress (chapter & exercises) on the source-chain in my forks. So you can peek there to get an idea of where I am going and to give feedback.
Especially on my Rust code, because my code still gives me very clunky and unnatural impression.

So go ahead and added the elements chapter were you think best.

@guillemcordoba
Copy link
Contributor

guillemcordoba commented Apr 14, 2021

Hey @tixel , I do think it's important to introduce query as the main thing in the source chain exercise. Docs: https://docs.rs/hdk/0.0.100/hdk/chain/fn.query.html

Query is basically a mechanism by which you filter and get elements (headers + entries) from your source-chain, not the DHT. I think this is fundamental for people to get a first step towards the aha moment of "aaah, I can rely on mainly two sources of truth, with fundamentally different properties".

What do you think? I'll happily add that in the exercise if you agree.

@guillemcordoba
Copy link
Contributor

Oh wow I just saw that you manually implemented a query through gets with the happened_before. This is creative! So I think we are on the same page. I think also adding an interaction to the gym that allows you to select different agents and see that their chains evolve independently would be quite good, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants