LogoPear Docs
About PearStoring & replicating data

Availability and blind peering

Keeping Pear application data and bundles reachable when authors go offline — seeding, its limits, and blind peering as a cache layer.

Peer-to-peer availability is not automatic. A new user can only download data that at least one online peer already holds. Pear applications therefore need an explicit strategy for data availability and application availability.

This page covers seeding, when it falls short, and blind peering — a service that replicates cores on your behalf without reading their contents. For the general distribution model, see Storage and distribution.

Two availability problems

Data availability

Data availability means the Hypercores, Autobases, or drives your application reads and writes remain reachable on the swarm. Chat history, shared documents, and room state all depend on someone seeding the relevant cores.

Application availability

Application availability means the Pear app itself — its metadata core and content Hyperdrive — can be discovered and installed. A pear:// link is stable, but the bytes behind it still have to exist on at least one peer.

Both problems share the same underlying constraint: replication requires a live source.

Seeding with pear seed

The simplest way to keep an application bundle online is seeding, analogous to seeding a torrent. Running pear seed pear://<app> keeps the underlying cores announced and available for download.

pear seed pear://<app>

The process must stay running while you want to act as a guaranteed source. Anyone can open the link, but a first-time user needs at least one seeder with a complete copy.

See Storage and distribution for how staging, seeding, and lazy replication fit together — this page does not repeat that model.

Seeding works well when you control an always-on machine and the cores you care about are ones you already possess. It has two practical limits:

  1. Operational overhead — You need a running pear (or equivalent replicator) per application you seed.
  2. Scope — You can only seed cores you have locally. A private room or direct-message thread you are not a member of cannot be seeded from your node.

When authors go offline and no participant keeps seeding, data can become temporarily unreachable even though the cryptographic keys still exist.

Blind peering

A blind peer is a dedicated replicator that stores and serves Hypercores without decrypting or interpreting their contents. Blind peering is one way of putting the server in serverless: always-on reachability like a hosted service, but the operator never holds the plaintext. It joins swarms on request and caches blocks so other peers can find a source. Blind peering separates "make this core findable" from "I personally hold the plaintext."

The stack has three parts:

  1. blind-peer — server library that accepts peering requests and replicates cores.
  2. blind-peering — client library used inside applications to register cores or Autobases with a blind peer.
  3. blind-peer-cli — CLI that runs a blind peer as a standalone server (provides the blind-peer command).

Running a blind peer server

Install the CLI and start the server:

npm i -g blind-peer-cli
blind-peer

On startup the process logs (as ndjson) a Listening at <key> line — that public key is the blind peer's identity, and clients use it as one of their configured keys. The default disk budget is 100 GB; cap it with -m <size> (megabytes).

For production, run blind-peer under a service manager. Example systemd unit:

[Unit]
Description=Blind Peer
After=network.target

[Service]
ExecStart=/usr/local/bin/blind-peer -m 10000 --trusted-peer <your-public-key>
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Pass --trusted-peer <public-key> to authorize a specific peer to announce on the blind peer (set announce: true on its requests). The public key here is the identity of the peer that will make those requests — the Listening at <key> value logged by that peer's own swarm node.

Registering cores from an application

Inside a Pear worker, wire the client to your existing Hyperswarm and Corestore:

import BlindPeering from 'blind-peering'
import Hyperswarm from 'hyperswarm'
import Corestore from 'corestore'

const store = new Corestore(Pear.config.storage)
const swarm = new Hyperswarm()
swarm.on('connection', (conn) => store.replicate(conn))

const BLIND_PEER_KEYS = ['<blind-peer-public-key-hex>']
const blinds = new BlindPeering(swarm.dht, store.namespace('blind-peering'), {
  keys: BLIND_PEER_KEYS
})

// Ask the blind peers to keep a single Hypercore available…
await blinds.addCore(core)

// …or a whole Autobase (all of its writer and view cores).
await blinds.addAutobase(base)

addCore / addAutobase connect to the closest configured blind peers and request that they replicate and seed the given cores — without the blind peer ever being able to read them.

Consider letting users configure which blind peers they trust — default infrastructure may not match privacy or jurisdiction requirements (for example location-sensitive data).

Finding the keys to keep available

pear info pear://<app> prints the keys behind an application bundle:

pear info pear://<app>

The project and content rows identify the metadata core and content drive. To keep them available, open the corresponding cores in a replicator process and register them with the client library shown above — blinds.addCore(core) for a single Hypercore, blinds.addAutobase(base) for an Autobase and all of its writer and view cores.

Trusted peers and discovery keys

When a blind peer runs with --trusted-peer, it recognizes seed requests signed by that key and joins the swarm for the requested core. That is more targeted than broadcasting blindly: peers looking for a specific core use its discovery key as a Hyperswarm topic, so participants in that topic are likely to hold or want the same data.

Blind peering does not replace end-to-end encryption or capability checks on the cores themselves; it only improves reachability by keeping an always-on replica on the network.

See also

On this page