Closed dominictarr closed 8 years ago
can opts
default to ssb-keys/index
?
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?
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
ssb-crypto
would be an acceptable name, since it's pretty much the clearing house for all that.
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?
that would be okay, sure.
shall we merge this then?
oh, hang on, we are gonna make ssb-feed repo?
as discussed