![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
hyperdiscovery
Advanced tools
See hyperswarm replicator for similar functionality.
More info on active projects and modules at dat-ecosystem.org
This library is compatible with hypercore<=v7, which is now out of date.
Join the p2p swarm for hypercore and hyperdrive. Uses discovery-swarm under the hood. Also works in web browsers using discovery-swarm-web.
This module only works
npm install hyperdiscovery
Run the following code in two different places and they will replicate the contents of the given ARCHIVE_KEY
.
var hyperdrive = require('hyperdrive')
var hypercore = require('hypercore')
var Discovery = require('hyperdiscovery')
var archive = hyperdrive('./database', 'ARCHIVE_KEY')
var discovery = Discovery(archive)
discovery.on('connection', function (peer, type) {
console.log('got', peer, type)
console.log('connected to', discovery.connections, 'peers')
peer.on('close', function () {
console.log('peer disconnected')
})
})
// add another archive/feed later
var feed = hypercore('./feed')
discovery.add(feed) // adds this hypercore feed to the same discovery swarm
Will use discovery-swarm
to attempt to connect peers. Uses dat-swarm-defaults
for peer introduction defaults on the server side, which can be overwritten (see below).
The module can also create and join a swarm for a hypercore feed:
var hypercore = require('hypercore')
var Discovery = require('hyperdiscovery')
var feed = hypercore('/feed')
var discovery = Discovery(feed)
var discovery = Discovery(archive, opts)
Join the p2p swarm for the given feed. The return object, discovery
, is an event emitter that will emit a peer
event with the peer information when a peer is found.
discovery.add(archive, [opts])
Add an archive/feed to the discovery swarm. Options will be passed to discovery-swarm
. If you pass opts.announce
as a falsy value you don't announce your port (discover-only mode).
discovery.totalConnections
Get length of the list of total active connections, across all archives and feeds.
discovery.leave(discoveryKey)
Leave discovery for a specific discovery key.
discovery.rejoin(discoveryKey)
Rejoin discovery for a discovery key (*must be added first using discovery.add
).
discovery.close()
Exit the swarm, close all replication streams.
stream
: function, replication stream for connection. Default is archive.replicate({live, upload, download})
.upload
: bool, upload data to the other peer?download
: bool, download data from the other peer?port
: port for discovery swarmutp
: use utp in discovery swarmtcp
: use tcp in discovery swarmbootstrap
: [string], WebRTC bootstrap signal servers for webdiscovery
: string, discovery-swarm-stream server for webDefaults from datland-swarm-defaults can also be overwritten:
dns.server
: DNS serverdns.domain
: DNS domaindht.bootstrap
: distributed hash table bootstrapping nodesSet DEBUG='*'
in the environment to enable debugging output inside discovery-swarm.
ISC
FAQs
Join the p2p swarm for hypercore and hyperdrive feeds.
The npm package hyperdiscovery receives a total of 6 weekly downloads. As such, hyperdiscovery popularity was classified as not popular.
We found that hyperdiscovery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.