1.1.6 • Published 3 months ago

@hyperswarm/seeders v1.1.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

@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

1.1.6

3 months ago

1.1.5

1 year ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago