Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@coboxcoop/networker

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coboxcoop/networker

the networking code for cobox

latest
Source
npmnpm
Version
1.0.0-alpha.1
Version published
Maintainers
2
Created
Source

Networker

Table of Contents

  • About
  • How does it work?
  • Install
  • Usage
  • API
  • Contributing
  • License

About

CoBox is an encrypted p2p file system and distributed back-up tool. README provides a map of the project.

networker contains a subclass of CorestoreNetworker to use with our fork of Multifeed. It contains any additional protocol extensions used (except multifeed's), and an overall description of the way the networking in the stack functions.

How does it work?

CoBox uses hyperswarm to discover peers on a distributed hash table and exchange information about each-other, as well as replicate data. Data is replicated between peers using the Dat (now Hypercore) protocol. A single hypercore protocol stream is opened for each open socket with a peer. Multiple channels can be created for a given protocol stream instance, each of which corresponds to a discovery key. In CoBox we leverage the concept of a shared address and encryption key to define a distributed multiwriter file-system using multifeed. A discovery key is a hash of an address. This is handled internally, so all you need to provide is the address. Multifeed opens a channel on the existing protocol stream with a peer (or creates a new stream along with a channel for the provided address) and uses hypercore protocol extensions to implement a multiplexer which exchanges lists of hypercore public keys which are stored and fetched from the provided corestore instance.

Install

npm i @coboxcoop/networker

Usage

const Corestore = require('corestore')
const CoBoxNetworker = require('@coboxcoop/networker')
const crypto = require('hypercore-crypto')

// generate some concept of a unique identity
// this will be used as the noise keypair
// names are subjective
const identity = Object.assign({ name: 'Grace' }, crypto.keyPair())

// define a corestore for storing hypercores
const corestore = Corestore(storage)

const network = CoBoxNetworker(corestore, identity)

// generate a multifeed address and join!
const address = crypto.randomBytes(32)
network.join(address)

Credit

Thanks to @kira a.k.a. @noffle, @frando, @karissa, the magma-collective crew, the hyperdivision team and the cabal crew.

License

AGPL-3.0-or-later

Keywords

hyperswarm

FAQs

Package last updated on 07 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts