How To
Goal-oriented recipes for the peer-to-peer building blocks—connecting peers, replicating data, managing identity, and streaming media.
How-tos are goal-oriented recipes. Each one assumes you already know roughly what you're doing and just need the steps for a particular task—connecting two peers with HyperDHT, replicating with Hypercore, or managing a portable identity.
If you want to look up an API or a module, that's Reference. For the conceptual "why," see How the stack fits together.
Everything here runs on the building blocks directly—no Pear app required, and no dependency on the Bare runtime beyond what the building blocks themselves need. If you're shipping a Pear app—staging, seeding, provisioning, updating—those guides are on the Pear tab. If you're embedding the Bare runtime itself in a native or mobile app, that's on the Bare tab.
Bare is the runtime underneath. A small, zero-core JavaScript runtime with its own docs: the module system, native addons, embedding in native and mobile apps, and compiling to a standalone binary all live on the Bare tab. How the stack fits together maps the layers.
Pear is the platform on top. Install the pear CLI when you want peer-to-peer app distribution, over-the-air updates, and one command to stage and release—the core you write here moves across unchanged. Start on the Pear tab, or read How the stack fits together.
In this section
- Troubleshoot common issues—fixes for common P2P, Pear, and Bare development issues.
Connecting peers
- Connect two peers by key with HyperDHT
- Connect to many peers by topic with Hyperswarm
- Host multiple rooms in one chat app
Storage and replication
- Replicate and persist with Hypercore
- Work with many Hypercores using Corestore
- Share append-only databases with Hyperbee
- Create a full peer-to-peer filesystem with Hyperdrive
- Store and serve large media with Hyperblobs
- Keep data available with blind peering
- Add blind peering to a chat app