hyphacoop / restructuring-futures

Coordinating repository for announced DSF Restructuring Futures project
https://hyphacoop.github.io/restructuring-futures/
GNU General Public License v3.0
1 stars 4 forks source link

Provide API or specs for Oracle AI #46

Open writerly03 opened 1 year ago

writerly03 commented 1 year ago

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.

writerly03 commented 1 year ago

Oracle lore: https://docs.google.com/document/d/1ACHbkjBHBbcTcQ-x0FFrcSbgGAjamj7mmv3IsFeaeyc/edit

tripledoublev commented 1 year ago
tripledoublev commented 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();