a single p2p private group, containing storage and application layer data
Kieran Gibb 0f47aaa554
pin to gitlab
1 year ago
lib use cobox-keys to load and save encKey, default derive from parent_key 1 year ago
test use cobox-keys to load and save encKey, default derive from parent_key 1 year ago
.gitignore add tmp to .gitignore 2 years ago
LICENSE stuff 2 years ago
README.md pin to gitlab 1 year ago
index.js temporary comment encoder while fixing indexes 1 year ago
package.json pin to gitlab 1 year ago
util.js add a test for appending to the local log feed 2 years ago

README.md

cobox-group

Group class for cobox. Wraps KappaDrive in a custom encryption scheme for content encryption, enabling blind replication.

yarn add cobox-group

API

const Group = require('cobox-group')

var group = Group(storage, key, opts)

Returns a group object

  • storage - path for storing feed data. Defaults to random-access-file
  • key - the group key (which may be a compound key containing a symmetric encryption key)
  • opts an options object, which may contain:
    • opts.config a config object from cobox-config

Blind Replicator logic is exported as a separate function, to prevent empty indexes being created and run.

const { Blind } = require('cobox-group') var group = Blind(storage, key, opts)

group.ready(callback)

callback is called when the group is ready to use.

group.masterKey

A master key for key derivation, to generate context specific keypairs for signing hypercores.

group.keys

An object with properties address and encryptionKey as detailed below.

group.address

The address or public key for the group

group.encryptionKey

Random 32 byte key used to derive encryption key.

group.drive

Your KappaDrive instance

group.state

An interface to query your group drive changes, built with kappa-view-query.

group.log

An additional hypercore for storing group-specific messages.

group.logs

An interface to query your group log, built with kappa-view-query.

group.swarm(opts)

Swarm across either Hyperswarm, or Discovery Swarm, based on opts.

group.bytesUsed()

Returns the cumulative size of all of the groups feeds. Cannot be run before group is ready. Note that this is only the size of the data in the feeds, in reality a little more disk space is used to store keys, etc.

CLI

We’ve retired the command-line interface to a separate package, as cobox-server now exports a CLI and handles managing multiple groups.

It is still available here.