Questions on shared state between agents (as well as validation of transactions)

Hi, everyone. First off, this project is really cool. I’m impressed so far. I have some questions on how to model certain things. I’ve been reading through the docs and surrounding literature for Holochain to try to get answers but I’m having trouble, so here goes.

Shared data

I’m working on a project called Basis (https://basisproject.gitlab.io/public/). One of the concepts in it is that there are companies on a network interacting with each other. Companies can have multiple members, and the members can have certain permissions within the company.

For instance, if I want to make an outgoing order to a new vendor, I have to have the OrderCreate permission. In Holochain that these permissions might have to be stored locally. My question is, how do they end up on my local chain in the first place? Do I have to co-sign the transaction that grants me these permissions? If so, is there a way to do this without my personal intervention?

Global data

Utimately, I’d like all publicly-listed products and services to be available for search by anyone in-network. Is there some ability to do this? I suppose one option would be to hook an external server up to the network that indexed the products (like in Elasticsearch or something) and created an API around them. However, how would it be notified of all products? Is there some sort of event bus here? Or would agents have to specifically send entries to this server each time a new product is added?

Secondly, let’s say there’s a credit system where people are paid for their labor. Would it be possible for store a global count of the total number of credits issued on-network without having to scan each created “creation” and “destruction” transactions?

Validation

Lastly, I’m really not clear on how validation works. Do transaction validation functions have access to the full local chain and the data contained in it? Can validators look at data that’s not stored locally…like pull entries from the DHT? I understand I’m kind of thinking like a blockchain right now, and really trying to shake this habit, but could use help figuring out the capabilities and limitations of the system so I can try to navigate the best way to adapt my current (blockchain-based) project.

Thanks so much!

Ok, I just found this: How will Holochain handle group agents? regarding group data, so I will read that first for thoughts and ideas.

2 Likes

Ok, I read that thread on groups, which seems to be exactly what I’m talking about with regards to shared agent state. It seems the working idea is to have groups defined by DNA themselves and have those apps hold their own specific state and grant “capabilities” to other agent-happ pairs. I do like this approach a lot more than the idea of a “bot” which could easily be commandeered, but it still leaves a lot to be desired over a system that has some idea of shared/global data state.

I would still like some clarification on global data and validation rules if anyone can shed some light there. I would like to mention I went through all the docs, however the page on validation is blank =].