git ssb

2+

Dominic / ssb-client



Tree: 9d95a96980b0f866c90f8c49d5cd48bebdc355c0

Files: 9d95a96980b0f866c90f8c49d5cd48bebdc355c0 / example.js

360 bytesRaw
1
2var Client = require('./')
3
4var config = require('ssb-config')
5var ssbKeys = require('ssb-keys')
6var keys = ssbKeys.loadOrCreateSync(config)
7
8function abortIf (err) {
9 if(err) throw err
10}
11
12var client = Client(keys, config)
13 .connect(abortIf)
14 .auth(abortIf)
15
16client.whoami(function (err, whoami) {
17 abortIf(err)
18 console.log(whoami)
19 client.close()
20})
21

Built with git-ssb-web