Holochain-in-Action Session 6 - JSC or Json Schema Pattern in Holochain - Multiple agents in a DNA in tryoram test

00:00:00 Intro
00:02:19 Json Schema Pattern (JSC) in Holochain
00:10:42 Up & Run project for pair programming
00:14:21 implementing Json Schema parser in RUST with unit test
00:29:21 setup and running multi agent DNA and Cells in tryorama test
00:40:53 different level of validation rules in holochain
00:42:35 validating json schema in holo-layer with test
00:54:44 multiple agents read data from DNA


These sessions are mostly suitable for programmers and designers, so if you would like to participate you need to fill-out this application in advance.

Apply for “Holochain in Action” meetings!

Hi @hedayat, I just watched this episode and I have a few questions…

  • I understand that JSON-schema is being used in order to allow “dynamic” entries to be used without having to generate new DNA upon every data schema change.

  • But then, how much of the data present on the JSON would be validated by the “rules of the game”? That is, validated by other agents in the network.

  • Are you considering to incorporate a “scripting language” in the app, allowing validation rules also to be “dynamic”, though being called behind static “proxy”/“controller” functions?

  • Apart from an agent that would like to change the data schema but isn’t the developer, who else would be considered a “bad” agent on the network?

  • AFAIK, Holochain entries are serde through MessagePack, which is a compact binary format. Depending on the type of data that the developer would like to store in the app, with JSON some compactness is lost, mainly if binary data (e.g. audio, video, image) has to be represented (usually as Base64). Was this considered? Maybe protobuf, that has an IDL and binary representation would be a better fit?

Please don’t take my questions as any kind of criticism.
They are more for me to understand the design rationale and idioms of hApps.
I look forward to your reply.

Thanks.

That is true.

Up to you as a developer in design time, and an admin user in run time. there are 2 rule-sets of game.

1- Normal validation of hApps gives you opportunity to run DNA and generic level of validation rules.
2- Json-Schema validator itself has some rules of data validator.

Json-Schema validator should be called in hApp Validation Rules. that means all other agents validate JSON-Schema as well.

Yes, I though about it to have the validation rules section as a pluggable part.
It can be something like Smart-Contract. Json-Schema is going to be the dynamic data and Smart-Contract is going to be dynamic validation rules.(intended for later)

Right now we have some limitations in Validation rules since all hApp validation should be generic. Which mean we can not implement complex validation rules.
By having this feature we can also upload one smart-contract per each data-type and go a little bit to more complex validation rules.

A player that tries to publish invalid Json-Schema data to DHT is also a bad player.

Actually No. I didn’t think a lot about having blob in Json-Schema. as you told for now Base64 is the only option.
By the way having any other 3rd party(tools or protocols) like Protobuf needs more extra validation. it is also possible.

Not at all.
Thank you so much for watching the video and sharing all your thoughts here.
Warm welcome if you would like to add/update the code and sending PR in github repo.
I really appreciate it.