SAFE app shared mutable state

I have familiarized myself with all of SAFE’s repos on GitHub including their associated milestones and projects. Also, I have read several RFCs, everything at https://safenetwork.tech, and everything at https://hub.safedev.org except for https://hub.safedev.org/docs.

To where, in documentation or other, should I refer to learn how multiple SAFE users of a SAFE app can contribute to the shared mutable state of the app through writes to SAFE?

I’m especially interested in learning how writes to shared mutable state is mediated for enforcement of data formats expected by the app.

For example, a trade journal’s SAFE app with multiple independent authors (generic SAFE users) contributing articles (data objects written to SAFE) that SAFE users visiting the app would immediately see upon being published to the app’s shared mutable state.

At the moment we’ve no useful shareable data apis in the current version (those exposed from safe-api). This should all be coming back as labels etc are implemented.

In general terms:

If you’re sharing data you can have no guarantees about what is written as things stand (we’ve no way of tying permissions to specific code running as yet). So you should always ensure that your data conforms to your formats when working on it.

2 Likes

With the ‘when it’s done’ caveat in mind, is shared mutable state functionality expected to land in 2020?

Taking the trade journal example from above, what is the nearest workflow currently possible? For example, could an author message the trade journal, via SAFE, with a link to the article’s xor address?

If I understand your Q correctly, you can share content by giving out XOR-URLs, the user/s you are sharing it with can see it but cannot mutate them yet as no APIs are available for that as Josh was mentioning. This can be simply seen with the CLI, I just uploaded a file to the shared vault:

$ safe files put ./testdata/test.md 
FilesContainer created at: "safe://hnyynystd7nq4mijxysonnjsxktw1dg9gj5tcf54pakyg1yzqz8x1xz4ugbnc"
+  ./testdata/test.md  safe://hbhyrydpan7d94mwp1bun3mxfnrfrui131an7ihu11wsn8dkr8odab9qwn 

You should be able to see its content with: $ safe cat safe://hnyynystd7nq4mijxysonnjsxktw1dg9gj5tcf54pakyg1yzqz8x1xz4ugbnc/test.md

Messaging within SAFE you also miss APIs to be able to append content to an inbox, i.e. mutate an inbox. Just to be clear, the network has all what’s needed to support this through permissions, it’s just the new APIs are not exposing such features yet, we are working on some normalisations of the new data types bottom up now, so soon we’ll be able to start exposing the data types APIs.

1 Like