Open writerly03 opened 1 year ago
You can look at scripts here for inspiration. This is just an example of what a script to write to earthstar could look like
// Make a new in-memory replica
const replica = new Earthstar.Replica({
driver: new Earthstar.ReplicaDriverMemory(MY_SHARE),
secret: MY_SHARE_SECRET
});
// Quickly set a new status
await replica.set(myKeypair, {
path: '/is-it-raining',
text: isItRaining() ? "It's raining!": "Dry today"
})
// Sync it to your server
const peer = new Earthstar.Peer();
peer.addReplica(replica);
const syncer = peer.sync("https://my.server");
await syncer.isDone();
console.log('Synced rain status!')
await replica.close();
We need some technical specs - even if super rough - to understand how oracle will interact with Earthstar. The oracle is a key part of the how people interact with the prototype so we want to see some specifics earlier rather than later to ensure it’s not going to be a roadblock when it comes time for deployment.
Also - please confirm that this is in fact a piece of code and not a person doing the actions outlined.