ssbc/scuttle-testbot

Name: scuttle-testbot

Owner: Secure Scuttlebutt Consortium

Description: null

Created: 2018-01-29 03:38:56.0

Updated: 2018-03-13 20:51:22.0

Pushed: 2018-03-31 01:03:18.0

Homepage: null

Size: 127

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

scuttle-testbot

Spins up an empty, temporary scuttlebot server that stores data in your temp folder

Usage
CreateTestSbot = require('scuttle-testbot')
ssbKeys = require('ssb-keys')

pietKeys = ssbKeys.generate()
katieKeys = ssbKeys.generate()

myTempSbot = CreateTestSbot({name: 'testBotName', keys: pietKeys})

katie = myTempSbot.createFeed(katieKeys)
piet = myTempSbot.createFeed(pietKeys)

.add({type: 'test', content: "a test message"},function(err, data) {
TempSbot.close() //don't forget to close your sbot otherwise your script will never exit. ;)
nsole.log(data)

Outputs:


y: '%FQ2auS8kVY9qPgpTWNY3le/JG5+IlO6JHDjBIQcSPSc=.sha256',
lue: { 
previous: null,
sequence: 1,
author: '@UreG2i/rf4mz7QAVOtg0OML5SRRB42Cwwl3D1ct0mbU=.ed25519',
timestamp: 1517190039755,
hash: 'sha256',
content: { type: 'test', content: 'a test message' },
signature: '0AxMJ7cKjHQ6vJDPkVNWcGND4gUwv2Z8barND5eha7ZXH/s5T0trFqcratIqzmhE3YJU2FY61Rf1S/Za2foLCA==.sig.ed25519' 

mestamp: 1517190039758 

API
CreateTestSbot = require('scuttle-testbot')
CreateTestSbot(opts={})

Returns a scuttlebot instance.

By default, CreateTestSbot deletes an existing database of the same name before starting.

Valid opts keys include:

name (default: ssb-test + Number(new Date)) - myTestName: Sets the database in /tmp/myTestName

startUnclean (default: false) - true: Don't delete an existing database before starting up.

keys (default: scuttle-testbot generates a new set of random keys) - keys: generated by ssb-keys.

CreateTestSbot.use(require('ssb-about'))

CreateTestSbot.use lets you add scuttlebot plugins. use can be chained the same as the scuttlebot api.

Install

With npm installed, run

m install scuttle-testbot
Acknowledgments
See Also
License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.