neighbour-hoods / sensemaker-lite

11 stars 1 forks source link

Resource Def Source Field #60

Closed weswalla closed 1 year ago

weswalla commented 1 year ago

We assume applets are a bundled hApp, where resources exist in specific zomes, within specific DNAs of the happ (referenced by either DNA hash or role name). See https://github.com/neighbour-hoods/sensemaker-lite/issues/57

Currently, this information is encoded in the AppletConfig object: https://github.com/neighbour-hoods/sensemaker-lite/pull/58

However, I am considering including this information directly in the ResourceDef itself, as another field.

Since we currently assume all resources exist as entries in happs, the source field could be something like:

struct ResourceSource {
    installed_app_id: String,
    role_name: String,
    zome_name: String,
}

This would also open up the pattern for resources to exist elsewhere, turning ResourceSource into an enum:

enum ResourceSource {
    Happ(ResourceSourceStruct),
    ...
}
weswalla commented 1 year ago

And to continue building out the proposed changes in https://github.com/neighbour-hoods/nh-launcher/issues/105, we could simplify how we store resource definitions in the sensemaker store to:

_resourceDefs: Writable<{ [entryHash: string]: ResourceDef } = writable({})
weswalla commented 1 year ago

this would affect the correct sequence (which should be expressed through tests in the launcher repository) of installing an applet. First, the applet happ bundle would need to be installed to the conductor, and then all the associated primitives would be added.