willemolding / holochain-rust-todo

Basic example using holochain-rust
31 stars 8 forks source link

Extending this example - how to manage linking the AGENT_ADDRESS #1

Open jryanhaber opened 5 years ago

jryanhaber commented 5 years ago

I love this example!! Phenomenal work, thank you.

I was able to, starting with this, extend this example to create 5 or 6 functional zomes with the create_new function and get all the tests passing.

I am wondering about the next steps.
At what point would it make sense to associate a list of items with a user?
Allow me to share my guess and let me know what you think...

Lets say each user of your dApp has their own list and user info. I would imagine the following...

When a new user is created, pull the USER_AGENT constant from the hdk and link the user object with that USER_AGENT hash.

When that user creates a new list of items, link the USER_AGENT constant to that list with the string 'owner' to indicate they own the list.

When that user creates a new item and adds it to the list, link the USER_AGENT constant to each item as well ( not sure if necessary, but could be relevant in some use cases so to be safe... ), as "owner"

So, when you need to access the data, you can access the following:

And so on...

Does this sound about right?

jryanhaber commented 5 years ago

I am sensing into sorting this out in a branch and submitting as a pull request for an optional part-2 extension of the tutorial... my WIP is here:

https://github.com/jryanhaber/holochain-rust-todo

jryanhaber commented 5 years ago

I started by creating a users zome in a branch and attempting to configure it to pass all the tests... its currently caught up on the last test. As soon as I get that test passing I will import the USER_AGENT constant and attempt to associate ownership to the user agent who creates a given list or item to each item, while updating the documentation so that it becomes a bit of a tutorial ( to the extent I succeed a this )

fonzarely commented 5 years ago

Thanks to you I've found the issue that prevent this project to build (hc package). Your version does. Could you provide a PR with your cargo.tml ?

jryanhaber commented 5 years ago

Definitely!

Sent from my iPhone

On Nov 26, 2018, at 7:11 AM, F.C notifications@github.com wrote:

Thanks to you I've found the issue that prevent this project to build (hc package). Your version does. Could you provide a PR with your cargo.tml ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jryanhaber commented 5 years ago

Ok I did the pull request but Ill have to admit, as I reviewed the code I found it to be a bit unclear, it seems that my js prettier auto formatting has cluttered things up a bit and there was something in the package.json I did not recognize at all about 'optional': true..

I still hope with edit privileges it is helpful, if there is something else I can do let me know.

I don't actually recall how far down the work in progress path I got as its been a week or more since I was working on this.