ssbc / ssb-db2

A new database for secure-scuttlebutt
47 stars 8 forks source link

documentation request -- gossipping #282

Closed nichoth closed 2 years ago

nichoth commented 2 years ago

It's not clear to me from the readme how gossip would work here. And more broadly, is this compatible with existing ssb-* secret-stack plugins? The older ssb-server readme shows an example like this:

var Server = require('ssb-server')
var config = require('ssb-config')

// add plugins
Server
  .use(require('ssb-master'))
  .use(require('ssb-gossip'))
  .use(require('ssb-replicate'))
  .use(require('ssb-backlinks'))

var server = Server(config)

Using ssb-db2, could you add the same plugins?

const sbot = SecretStack({ caps })
  .use(require('ssb-db2'))
  .use(require('ssb-gossip'))
  .call(null, { path: './' })
staltz commented 2 years ago

Those are independent concerns. ssb-db2 is about storing and querying data, ssb-gossip deprecated ssb-conn is about connecting to peers (merely connecting!) and then ssb-replicate deprecated ssb-ebt is about replicating peers. It's not concern of this module to describe connections and replication, it's the concern of some dev guide like dev.scuttlebutt.nz to describe all the plugins you need and how to get replication to interact with the db.

nichoth commented 2 years ago

thanks @staltz for the tips about other modules

Yes I realize they are separate concerns — DB vs connections/replication.

Then there is the other issue… where to put documentation when you have many modules that are independent, but work well together, and are kind of expected to be used simultaneously. I actually didn't check dev.scuttlebutt.nz, b/c i thought it wouldn't be up to date, but I see now it does have a section about this repo — https://dev.scuttlebutt.nz/#/javascript/?id=ssb-db2