ssbc / ssb-keys

keyfile operations for ssb
36 stars 26 forks source link

bring createFeed here from secure-scuttlebutt #12

Closed dominictarr closed 8 years ago

dominictarr commented 9 years ago

as discussed

pfrazee commented 9 years ago

can opts default to ssb-keys/index ?

dominictarr commented 9 years ago

I exposed it as ssbKeys.createFeed so putting a reference back would make a circular dep.

If you do ssbKeys.createFeed(ssb, keys) then you do not need to set the opts.

I think anywhere you'll need this you'll use ssbKeys too you might as well load it all and use it from there?

pfrazee commented 9 years ago

yeah that looks good, I misread and didnt see createFeed

packaging this code makes sense to me, you want this code in the client but not all of ssb necessarily. The package name seems a little off at this point, but I havent thought of something better yet

dominictarr commented 9 years ago

ssb-crypto would be an acceptable name, since it's pretty much the clearing house for all that.

pfrazee commented 9 years ago

hm..

var ssbclient = require('ssb-client')
var ssbcrypto = require('ssb-crypto')

var keys = ssbcrypto.loadOrCreateSync('./app-private.key')
var client = ssbclient({ host: 'localhost' })
  .connect(abortIf)
  .auth(ssbcrypto.createAuth(keys), abortIf)
var feed = ssbcrypto.createFeed(keys)

ah, all the key functions are named assuming the ssb-keys packg, like generate and loadOrCreateSync. We might need to rename those

ssb-crypto and ssb-keys seem kind of unintuitive for a downstream dev, I think, who's probably thinking "I want to use ssb and create a feed, so why am I doing that through the crypto lib" so what about a ssb-feed package that imports ssb-keys instead of putting createFeed in here?

dominictarr commented 9 years ago

that would be okay, sure.

dominictarr commented 9 years ago

shall we merge this then?

dominictarr commented 9 years ago

oh, hang on, we are gonna make ssb-feed repo?