git ssb

2+

Dominic / ssb-client



Tree: c1a9f36fb8654b836e254880ed4de71e4c9bf187

Files: c1a9f36fb8654b836e254880ed4de71e4c9bf187 / test / index.js

643 bytesRaw
1var tape = require('tape')
2var ssbKeys = require('ssb-keys')
3var ssbServer = require('scuttlebot')
4var ssbClient = require('../')
5
6var keys = ssbKeys.generate()
7var server = ssbServer({
8 port: 45451, timeout: 2001,
9 temp: 'connect',
10 host: 'localhost',
11 master: keys.id,
12 keys: keys
13})
14
15tape('connect', function (t) {
16
17 ssbClient(keys, { port: 45451 }, function (err, client) {
18 if (err) throw err
19
20 client.whoami(function (err, info) {
21 if (err) throw err
22
23 console.log('whoami', info)
24 t.equal(info.id, keys.id)
25 t.end()
26 client.close(true)
27 server.close(true)
28 process.exit(0)
29 })
30 })
31
32})
33

Built with git-ssb-web