Socket
Book a DemoInstallSign in
Socket

dnode-swarm

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dnode-swarm

Peer swarm for dnode using a dht.

latest
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

dnode swarm

This library implements a swarm of remote rpc peers.

It uses:

  • upnode (reliabilty layer on top of dnode)
  • bittorrent-dht (decentralized peer info)

Usage

var opts = {}
opts.rpc = {echo: (text, cb) => cb(null, text)}
opts.infoHash = new Buffer(20).fill('testing-').toString('hex')

var s1 = createSwarm(opts)
var s2 = createSwarm(opts)

// This will print twice, one is the connection to itself
// the other is the connection to s2
s1.remotes().forEach(remote => {
  remote.echo('test', (null, text) => console.log(text))
})

FAQs

Package last updated on 07 Aug 2016

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