Name: ssb-about
Owner: Secure Scuttlebutt Consortium
Description: scuttlebot plugin for getting reduced 'about' state
Created: 2017-06-12 11:56:29.0
Updated: 2018-05-07 11:44:28.0
Pushed: 2018-04-25 19:03:54.0
Homepage: null
Size: 6
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
scuttlebot plugin for indexing reduced “about” state.
For a detailed example, see example.js
in this repo.
t Server = require('scuttlebot')
t config = { ... } // needs options
nstall the plugin
er
se(require('scuttlebot/plugins/master')) // required
se(require('ssb-about'))
se(require('ssb-backlinks')) // not required, just an example
tart the server
t server = Server(config)
sbot.about.get(cb)
Get the current state of the about view. This will wait until the view is up to date, if necessary.
cb(err, data)
is a standard callback function where data
is of the form:
arget]: { // target we're saying things about
[trait]: { // trait we're asserting about that target
[user]: [ // a user with an opinion about target's trait
value, // value of that opinion
timestamp // when that opinion was stated
]
}
e.g. Here, concerning @3r4+IyB5NV...
(a user) there are two opinions about the user's name
(by the user themself, and by another user), and one opinion about their image
:
3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519": {
"name": {
"@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519": [
"Richard D. Bartlett",
1502124087565
],
"@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519": [
"rich",
1513603872659
],
},
"image": {
"@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519": [
"&asrg0Mb/w3lLC+yZIJr/4aY0nkWT9Wn+32zrqhaIvy4=.sha256",
1516829827534
],
}
sbot.about.stream
=> pull-stream sourceBe careful, this is a stream which provides:
{ sync: true }
values when the view is up to date with the db (if you use the {live: true}
option)For details see : https://github.com/flumedb/flumeview-reduce
MIT