How To
Goal-oriented recipes for building peer-to-peer logic on Bare—connecting peers, replicating data, streaming media, and running on native and mobile.
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 porting an existing Node.js app.
If you want to look up an API or a module, that's Reference. For the conceptual "why," see About Bare.
This section covers peer-to-peer logic that runs on Bare alone—no Pear app required. If you're building or shipping a Pear app instead (staging, seeding, provisioning, updating), see the how-to guides on the Pear tab.
In this section
- Migrate a Node.js app to Bare—port an existing Node.js app to run on Bare.
- Troubleshoot common issues—fixes for common 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
Managing identity
Stream and share media
- Share files in a peer-to-peer app
- Back up photos in a peer-to-peer app
- Stream stored video in a peer-to-peer app
- Stream a live camera in a peer-to-peer app