# How To



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](/p2p/how-to/connect-to-peers/connect-two-peers-by-key-with-hyperdht), [replicating with Hypercore](/p2p/how-to/store-and-replicate/replicate-and-persist-with-hypercore), or [managing a portable identity](/p2p/how-to/manage-identity/create-a-portable-identity-with-keet-identity-key).

If you want to look up an API or a module, that's **[Reference](/p2p/reference)**. For the conceptual "why," see **[How the stack fits together](/p2p/explanation/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](/pear/how-to). If you're embedding the Bare runtime itself in a native or mobile app, that's on the [Bare tab](/bare/how-to).

<Callout type="info">
  **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](/bare). [How the stack fits together](/p2p/explanation/how-the-stack-fits-together) maps the layers.
</Callout>

<Callout type="info">
  **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](/p2p/explanation/how-the-stack-fits-together).
</Callout>

## In this section [#in-this-section]

* [Troubleshoot common issues](/p2p/how-to/troubleshooting)—fixes for common peer-to-peer building-block issues.

### Connecting peers [#connecting-peers]

* [Connect two peers by key with HyperDHT](/p2p/how-to/connect-to-peers/connect-two-peers-by-key-with-hyperdht)
* [Connect to many peers by topic with Hyperswarm](/p2p/how-to/connect-to-peers/connect-to-many-peers-by-topic-with-hyperswarm)
* [Host multiple rooms in one chat app](/p2p/how-to/connect-to-peers/host-multiple-rooms-in-one-chat-app)

### Storage and replication [#storage-and-replication]

* [Replicate and persist with Hypercore](/p2p/how-to/store-and-replicate/replicate-and-persist-with-hypercore)
* [Work with many Hypercores using Corestore](/p2p/how-to/store-and-replicate/work-with-many-hypercores-using-corestore)
* [Share append-only databases with Hyperbee](/p2p/how-to/store-and-replicate/share-append-only-databases-with-hyperbee)
* [Create a full peer-to-peer filesystem with Hyperdrive](/p2p/how-to/stream-and-share-media/create-a-full-peer-to-peer-filesystem-with-hyperdrive)
* [Store and serve large media with Hyperblobs](/p2p/how-to/stream-and-share-media/store-and-serve-large-media-with-hyperblobs)
* [Keep data available with blind peering](/p2p/how-to/blind-peering/keep-data-available-with-blind-peering)
* [Add blind peering to a chat app](/p2p/how-to/blind-peering/add-blind-peering-to-a-chat-app)

### Managing identity [#managing-identity]

* [Create a portable identity with Keet identity keys](/p2p/how-to/manage-identity/create-a-portable-identity-with-keet-identity-key)
* [Add Keet identity to a chat app](/p2p/how-to/manage-identity/add-keet-identity-to-a-chat-app)

### Communication [#communication]

* [Add typed RPC to a Pear app](/p2p/how-to/add-typed-rpc-to-a-pear-app)—replace hand-checked message types on the worker IPC stream with generated, typed methods.

### Stream and share media [#stream-and-share-media]

* [Share files in a peer-to-peer app](/p2p/how-to/stream-and-share-media/share-files-in-a-peer-to-peer-app)
* [Back up photos in a peer-to-peer app](/p2p/how-to/stream-and-share-media/back-up-photos-in-a-peer-to-peer-app)
* [Stream stored video in a peer-to-peer app](/p2p/how-to/stream-and-share-media/stream-stored-video-in-a-peer-to-peer-app)
* [Stream a live camera in a peer-to-peer app](/p2p/how-to/stream-and-share-media/stream-a-live-camera-in-a-peer-to-peer-app)
