git ssb

0+

Dominic / ssb-validate



Tree: e6fd59cef4a4f9cce89cdb7dd78acee26d465b48

Files: e6fd59cef4a4f9cce89cdb7dd78acee26d465b48 / example.js

667 bytesRaw
1var pull = require('pull-stream')
2
3var v = require('./')
4var state = {
5 queue: [],
6 feeds: {},
7 error: null
8}
9
10var c = 0, e = 0, start = Date.now(), l = 0
11require('ssb-client')(function (err, sbot) {
12 if(err) throw err
13 pull(
14 sbot.createLogStream(),
15 pull.drain(function (msg) {
16 state = v.append(state, msg.value)
17 if(state.error) {
18 e++
19 var err = state.error
20 state.error = null
21 console.log(err.message)
22 return false
23 }
24 state.queue.shift()
25 var s = ((Date.now() - start)/1000)
26 if(!(c++%1000)) {
27 console.log(s, e, c, c / s)
28 }
29 return true
30 }, sbot.close)
31 )
32})
33

Built with git-ssb-web