1.0.0-alpha1 • Published 4 years ago

cobox-admin-group v1.0.0-alpha1

Weekly downloads
1
License
AGPL-3.0-only
Repository
-
Last release
4 years ago

cobox-admin-group

This package is not yet stable!

An admin group is like a special kind of cobox-group. Rather than managing an archive of files together, it represents the group who manage a cobox hardware device, the admin group, allowing them to control which groups it replicates.

This is done by sending encrypted messages to cobox-hub.

An admin group simply contains a cobox-log which uses a kappa-core and multifeed instance, inherited from cobox-replicator, kappa-view-query for querying the log, and wraps it all with a cryptographic value encoder so the log is fully encrypted.

Install

npm install cobox-admin-group

Usage

const crypto = require('cobox-crypto')
const Admin = require('./')

const storage = tmp()
const address = crypto.address()
const encryptionKey = crypto.encryptionKey()
const admin = Admin(storage, address, { encryptionKey })

let query = { $filter: { value: { type: 'peer/about' } } }
let stream = admin.log.read({ query })
stream.on('data', console.log)

admin.log.publish({ type: 'peer/about', content: { name: 'Magpie' } })
admin.swarm()

Contributions