JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q45552F
  • License AGPL-3.0-only

a p2p private group for files and application-layer data

Package Exports

  • cobox-group
  • cobox-group/lib/keys

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cobox-group) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cobox-group

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

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.