p2panda / handbook

Website with tutorials, specification, info and learn sections of p2panda
https://p2panda.org
Creative Commons Attribution Share Alike 4.0 International
87 stars 8 forks source link

Extremely portable schema #269

Closed sandreae closed 7 months ago

sandreae commented 1 year ago

Possibly a terrible idea, but I'm logging it here incase there is some value 😜

I was considering a case where you are a client app developer and there are several schema associated with your app. You want to publish the code for your app, let people download it, and run it locally on their device, possibly against a fresh aquadoggo or similar node implementation. You don't know if this node is on the same network as you, or even if it is completely isolated. You really want the app to be running against exactly the schema you published though, so that when it joins up with networks, they will be refering to the same schema, and therefore the already published data will all sync up nice and neat.

How do you share the schema along with your app?

You could package the actual signed encoded entries which create the schema along with the app! Commit them to the repo in a config file or whatever... Then when the client app starts up, it attempts to publish them. If it succeeds, great, we now have the schema! If it fails, then something (possibly this schema) already existed for this public_key/log combination.

It conflicts with our current restrictions around publish (one node per key pair, incrementing log id), but it's pretty neat, I think!

adzialocha commented 1 year ago

Yeah! I think that idea also popped up in combination with fishy fishy. You get a schema.lock file which contains the signed data you need to redeploy the schema on every node.

sandreae commented 1 year ago

Yeh, wasn't sure if that was the same idea, or if it was more like a "recipe" to publish the schema yourself.

Glad it overlaps with other thoughts though 😜