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