mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 06:24:24 +01:00
videos
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
# Getting Started with Pear
|
||||
|
||||
Pear Runtime can be installed from the [pears.com](pears.com) or via [npm](https://www.npmjs.com/).
|
||||
|
||||
Since `npm` (or equivalent package manager) is needed to install application dependencies this guide will walk through installing `pear` with `npm`.
|
||||
|
||||
> [Build with Pear - Episode 01: Developing with Pear](https://youtu.be/y2G97xz78gU?si=gJ9gNDXrDztXtc4V)
|
||||
|
||||
## Requirements
|
||||
|
||||
Pear runs on Windows, Mac and Linux.
|
||||
@@ -35,7 +41,7 @@ If not, the first run of `pear` will fetch the platform from peers, after which
|
||||
To check that Pear is fully working, try the following command:
|
||||
|
||||
```
|
||||
pear run keet
|
||||
pear run pear://keet
|
||||
```
|
||||
|
||||
Pear loads applications from peers, so this command should open [Keet](https://keet.io) whether or not it was downloaded and installed beforehand.
|
||||
|
||||
@@ -4,8 +4,9 @@ This guide demonstrates how to build a peer-to-peer chat application.
|
||||
|
||||
It continues where [Starting a Pear Desktop Project](./starting-a-pear-desktop-project.md) left off.
|
||||
|
||||
## Step 1. HTML Structure and CSS Styles
|
||||
> [Build with Pear - Episode 01: Developing with Pear](https://www.youtube.com/watch?v=y2G97xz78gU)
|
||||
|
||||
## Step 1. HTML Structure and CSS Styles
|
||||
|
||||
The project folder should contain:
|
||||
|
||||
@@ -263,7 +264,7 @@ function onMessageAdded (from, message) {
|
||||
> Note that the `pear` dependency is used, even though it was not installed. This is the [Pear API](../reference/api.md), available to any Pear project.
|
||||
|
||||
|
||||
## Step 5. Chat
|
||||
## Step 4. Chat
|
||||
|
||||
Open two app instances by running `pear dev` in two terminals.
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Making a Pear Terminal Application
|
||||
|
||||
> [Build with Pear - Episode 04: Pear Terminal Applications]https://www.youtube.com/watch?v=73KVE0wocTE
|
||||
|
||||
## Step 1. Install modules
|
||||
|
||||
This app uses these modules: `hyperswarm`, `hypercore-crypto`, and `b4a`.
|
||||
|
||||
@@ -4,6 +4,8 @@ Pear applications are stored in an append-only log ([hypercore](../building-bloc
|
||||
|
||||
Each version is identified by `<fork>.<length>.<key>`. The length corresponds to the length of the application's append-only log at the time.
|
||||
|
||||
> [Build with Pear - Episode 03: Releasing Pear Applications](https://www.youtube.com/watch?v=UuzTlzEET4o)
|
||||
|
||||
`pear run <key>` opens the application.
|
||||
|
||||
Before a release has been marked, the latest version is used. This is useful during development, to test the app locally and to share a preview with other peers.
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
Applications can be shared with peers by seeding them to the network from an efficient local data structure (a [hypercore](../bulding-blocks.md#hyeprcore])). We call the mirroring of a local file system into the Pear platform Application Storage "staging". Seeding is sharing an app from a machine over the Distributed Hash Table (DHT) (via [hyperswarm](../building-blocks.md#hyperswarm)) so that other peers can replicate, consume and reseed the application.
|
||||
|
||||
> [Build with Pear - Episode 02: Sharing Pear Applications](https://www.youtube.com/watch?v=slYj9_ifpZQ)
|
||||
|
||||
This guide can either follow on from, [Making a Pear Desktop Application](./making-a-pear-desktop-app.md), [Making a Pear Terminal Application](./making-a-pear-terminal-app.md), or get setup quickly with the following:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
This section shows how to generate, configure, and develop a Pear desktop project, in preparation for [Making a Pear Desktop Application](./making-a-pear-desktop-app.md).
|
||||
|
||||
> [Build with Pear - Episode 01: Developing with Pear](https://youtu.be/y2G97xz78gU?si=gJ9gNDXrDztXtc4V)
|
||||
|
||||
## Step 1. Initialization
|
||||
|
||||
Use `pear init` to create a new Pear project.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Starting a Pear Terminal Project
|
||||
|
||||
> [Build with Pear - Episode 04: Pear Terminal Applications]https://www.youtube.com/watch?v=73KVE0wocTE
|
||||
|
||||
## Step 1. Init
|
||||
|
||||
First create a new project using `pear init`.
|
||||
|
||||
@@ -4,6 +4,8 @@ In the former example, two peers connected directly using the first peer's publi
|
||||
|
||||
The [Hyperswarm](../building-blocks/hyperswarm.md) module provides a higher-level interface over the underlying DHT, abstracting away the mechanics of establishing and maintaining connections. Instead, 'join' topics, and the swarm discovers peers automatically. It also handles reconnections in the event of failures.
|
||||
|
||||
> [Build with Pear - Episode 01: Developing with Pear](https://www.youtube.com/watch?v=y2G97xz78gU)
|
||||
|
||||
In the [How to connect two Peers by key with Hyperdht](./connect-two-peers-by-key-with-hyperdht.md), we needed to explicitly indicate which peer was the server and which was the client. By using Hyperswarm, we create two peers, have them join a common topic, and let the swarm deal with connections.
|
||||
|
||||
This How-to consists of a single application, `peer-app`.
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
[`Hyperdrive`](../building-blocks/hyperdrive.md) is a secure, real-time distributed file system designed for easy peer-to-peer file sharing. In the same way that a Hyperbee is just a wrapper around a Hypercore, a Hyperdrive is a wrapper around two Hypercores: one is a Hyperbee index for storing file metadata, and the other is used to store file contents.
|
||||
|
||||
> [Build with Pear - Episode 08: Peer-to-Peer File Systems](https://www.youtube.com/watch?v=ie7Nx3SF8sA)
|
||||
|
||||
This How-to consists of three applications: `drive-writer-app`, `drive-reader-app` and `bee-reader-app`.
|
||||
|
||||
Now let's mirror a local directory into a Hyperdrive, replicate it with a reader peer, who then mirrors it into their own local copy. When the writer modifies its drive, by adding, removing, or changing files, the reader's local copy will be updated to reflect that. To do this, we'll use two additional tools: [`MirrorDrive`](../helpers/mirrordrive.md) and [`LocalDrive`](../helpers/localdrive.md), which handle all interactions between Hyperdrives and the local filesystem.
|
||||
|
||||
@@ -4,7 +4,9 @@ In the HyperDHT How-to ([Connect Two Peers](./connect-two-peers-by-key-with-hype
|
||||
|
||||
[`Hypercore`](../building-blocks/hypercore.md) is a secure, distributed append-only log. It is built for sharing enormous datasets and streams of real-time data. It has a secure transport protocol, making it easy to build fast and scalable peer-to-peer applications.
|
||||
|
||||
Now extend the ephemeral chat example above but using Hypercore to add many significant new features:
|
||||
> [Build with Pear - Episode 06: Replication and Persistence](https://www.youtube.com/watch?v=MxykB79LhR4&t)
|
||||
|
||||
In this guide we'll extend the ephemeral chat example in [Connect Many Peers](./connect-to-many-peers-by-topic-with-hyperswarm.md) but using Hypercore to add many significant new features:
|
||||
|
||||
* **Persistence**: The owner of the Hypercore can add messages at any time, and they'll be persisted to disk. Whenever they come online, readers can replicate these messages over Hyperswarm.
|
||||
* **Many Readers:** New messages added to the Hypercore will be broadcast to interested readers. The owner gives each reader a reading capability (`core.key`) and a corresponding discovery key (`core.discoveryKey`). The former is used to authorize the reader, ensuring that they have permission to read messages, and the latter is used to discover the owner (and other readers) on the swarm.
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
[Hyperbee](../building-blocks/hyperbee.md) is an append-only B-tree based on Hypercore. It provides a key/value-store API with methods to insert and get key/value pairs, perform atomic batch insertions, and create sorted iterators.
|
||||
|
||||
|
||||
> [Build with Pear - Episode 07: Peer-to-Peer Databases](https://www.youtube.com/watch?v=E7ysAVa_V-s)
|
||||
|
||||
This How-to consists of three applications: `bee-writer-app` , `bee-reader-app` and `core-reader-app`.
|
||||
|
||||
The `bee-writer-app` stores 100k entries from a given dictionary file into a Hyperbee instance. The Corestore instance used to create the Hyperbee instance is replicated using Hyperswarm. This enables other peers to replicate their Corestore instance and sparsely (on-demand) download the dictionary data into their local Hyperbee instances.
|
||||
|
||||
@@ -5,7 +5,7 @@ An append-only log is powerful on its own, but it's most useful as a building bl
|
||||
|
||||
[`Corestore`](../helpers/corestore.md) is a Hypercore factory that makes it easier to manage large collections of named Hypercores. This how-to demonstrates a pattern often in use: co-replicating many cores using Corestore, where several 'internal cores' are linked to from a primary core. Only the primary core is announced on the swarm -- the keys for the others are recorded inside of that core.
|
||||
|
||||
In [How to replicate and persist with Hypercore](./replicate-and-persist-with-hypercore.md), only single Hypercore instance was replicated. But in this how-to, we will replicate a single Corestore instance, which will internally manage the replication of a collection of Hypercores. We will achieve this with two Pear Terminal Applications: `multicore-writer-app` and `multicore-reader-app`.
|
||||
In [How to replicate and persist with Hypercore](./replicate-and-persist-with-hypercore.md), only single Hypercore instance was replicated. But in this how-to, we will replicate a single Corestore instance, which will internally manage the replication of a collection of Hypercores. We will achieve this with two Pear Terminal Applications: `multicore-writer-app` and `multicore-reader-app`.
|
||||
|
||||
Create the `multicore-writer-app` project with these commands:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user