Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

@hyperswarm/seeders

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperswarm/seeders

Only swarm with verified seeders

latest
Source
npmnpm
Version
1.1.6
Version published
Maintainers
3
Created
Source

@hyperswarm/seeders

A seeders only swarm, verified by a mutable record

npm install @hyperswarm/seeders

Note that the list of seeds are stored in a verifiable record in the DHT, meaning no one can spoof it, but other people can read it.

Usage

const Seeders = require('@hyperswarm/seeders')

const swarm = new Seeders(firstSeedPublicKey, {
  dht, // optional dht new to use
  keyPair, // optional key pair to use, defaults to dht.defaultKeyPair
  maxClientConnections // how many connections to make to the seed, defaults to 2
})

swarm.on('connection', function (connection) {
  console.log('got connection...')
})

// if you are the first seed, add more seeds by passing a record
if (swarm.owner) {
  await swarm.join({
    seeds: [
      publicKey1,
      publicKey2,
      ...
    ],
    // optionally add info about the hypercore being seeded
    core: {
      length: 42,
      fork: 0
    }
  })
} else {
  await swarm.join()
}

License

Apache-2.0

FAQs

Package last updated on 07 Feb 2024

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