- Released on June 27th 2018
- Expires on July 31st 2018
Hello peer-star app developer! 👋
In an effor to make PeerPad scale better for many users editing the same pad, over the last few weeks I've been focused on implementing the topology and protocol described here.
This is materializing in the form of a package named peer-star-app
.
Here is a quick demo of it:
https://youtu.be/gBtAt0qTIUU?t=564
This is still an on-going effort, but, for the sake of you trying it out, I've documented the API and published a first version of the package (v0.1.0).
As you an see from the API, this package already includes js-ipfs. This is to make life easier to app developers, and also because, currently, while this libp2p issue is not solved, we're using a fork of js-ipfs, which includes very slight changes. This is, of course, only temporary.
You can access the ipfs node using app.ipfs
.
In previous iterations we were using op-based CRDTs. Recently I grokked the concept of delta-crdts and I think they're a better fit to our use case (as do other specialists). Op-based CRDTs are more popular (all major CRDT libraries are op-based), but since delta-crdts make it easier to reason about log retention, snapshotting and garbage collection, and given that we're pressed for time, I decided to use them. This is not to say that peer-crdt should be deprecated. Again, it's entirely your choice to either use this library or go ahead and use peer-crdt (or any other CRDT library you find is useful).
The library that's being used underneath is delta-crdts, and these CRDTs do not (yet) provide the niceties of peer-crdt, like the change events. Having said that, and in the case of collaborative text editing, I think we can instead use diffing (see example) to make better sense of the changes. IMO, this does not have to be embedded in the CRDT, although it would be useful to have a library for this, perhaps in the future.
Currently, pushers don't verify authorization from pullers before sending them data. While this is crucial for a live app, I think we can live with this for a while we work on other parts of our apps. I suspect that with a couple of days' work we should be able to add this to peer-star-app (please do!).
Currently, data is not encrypted at rest. It should be pretty easy to add this at the collaboration store level.
One thing that we will need to embed here is the identity. Deltas should be signed and verified by peers. I'm not sure which API we should expose, but I'm thinking of something along the lines of having a session intermediating collaborations:
const session = await app.session(credentials)
const collaboration = await session.collaborate('collab name', 'type', options)
If you have an opinion on what you require from peer-star-app on this, please file an issue and / or start working on a PR. :)
Openeed issues for all of these: