Socket
Book a DemoInstallSign in
Socket

blind-peering

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blind-peering

Request blind peers to keep hypercores and autobases available

latest
Source
npmnpm
Version
1.15.0
Version published
Weekly downloads
1K
46.22%
Maintainers
1
Weekly downloads
 
Created
Source

Blind Peering

Client for interacting with blind peers, sending RPC requests to keep hypercores and autobases available.

Installl

npm install blind-peering

API

const blindPeering = new BlindPeering(swarm, store, opts)

Create a new Blind Peering instance. swarm is a hyperswarm instance and store is a Corestore instance.

opts include:

  • mirrors: a list of blind peer keys (mirrors) to use. You should always set this, otherwise there are no mirrors to contact.
  • suspended: whether to start in suspended state (default false)
  • wakeup: a Wakeup object

await blindPeering.addCore(core, target = core.key, opts)

Add a Hypercore to a blind peer.

target is an optional key. It looks for blind peers 'close' (using XOR distance) to that key. It defaults to the key of the hypercore, thereby load balancing among the available blind peers. To use a specific blind peer, set target to its key.

opts include:

  • announce: whether the hypercore should be announced to the swarm (default false)
  • mirrors: how many blind peers to contact. Defaults to 1.
  • referrer: key of a referrer hypercore to pass to the blind peer
  • priority: integer indicating the priority to request. See Blind Peer for the possibilities

blindPeering.addCoreBackground(core, target = core.key, opts)

Same as addCore, but is sync (it runs in the background).

await blindPeering.addAutobase(base, target)

Add an autobase to a blind peer.

base is an Autobase instance.

target is an optional key. It looks for blind peers 'close' (using XOR distance) to that key. It defaults to the autobase's wakeupCapability.key.

blindPeering.addAutobaseBackground(base, target)

Add an autobase to a blind peer (runs in the background).

base is an Autobase instance.

target is an optional key. It looks for blind peers 'close' (using XOR distance) to that key. It defaults to the autobase's wakeupCapability.key.

await blindPeering.suspend()

Suspend all activity.

await blindPeering.resume()

Resume activity after having been suspended.

await blindPeering.close()

Close the blind peering instance.

FAQs

Package last updated on 14 Nov 2025

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