Skip to content

Commit 1a72e46

Browse files
committed
chore: add read more cta
1 parent 78d3484 commit 1a72e46

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ We've come a long way, but this project is still in Alpha, lots of development i
4949
- [Usage](#usage)
5050
- [Configuration](#configuration)
5151
- [API](#api)
52+
- [Getting Started](#getting-started)
5253
- [Tutorials and Examples](#tutorials-and-examples)
5354
- [Development](#development)
5455
- [Tests](#tests)
@@ -89,6 +90,10 @@ For all the information on how you can configure libp2p see [CONFIGURATION.md](.
8990

9091
The specification is available on [API.md](./doc/API.md).
9192

93+
### Getting started
94+
95+
If you are starting your journey with `js-libp2p`, you should start by going through [GETTING_STARTED.md](./doc/GETTING_STARTED.md).
96+
9297
### Tutorials and Examples
9398

9499
You can find multiple examples on the [examples folder](./examples) that will guide you through using libp2p for several scenarios.

doc/GETTING_STARTED.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ const node = await Libp2p.create({
6060

6161
As new Transports are created, you may wish to reevaluate your needs and select the latest Transports that best suit your requirements. You may wish to remove the Transports you had before, or simply append the new Transports to `modules.transport` in order to establish connections with peers that support either.
6262

63+
<details><summary>Read More</summary>
64+
If you want to know more about libp2p transports, you should read the following content:
65+
66+
- https://docs.libp2p.io/concepts/transport
67+
- https://github.com/libp2p/specs/tree/master/connections
68+
</details>
69+
6370
#### Connection Encryption
6471

6572
Encryption is an important part of communicating on the libp2p network. Every connection must be encrypted to help ensure security for everyone. As such, Connection Encryption (Crypto) is a required component of libp2p.
@@ -85,6 +92,13 @@ const node = await Libp2p.create({
8592
})
8693
```
8794

95+
<details><summary>Read More</summary>
96+
If you want to know more about libp2p connection encryption, you should read the following content:
97+
98+
- https://docs.libp2p.io/concepts/secure-comms
99+
- https://github.com/libp2p/specs/tree/master/connections
100+
</details>
101+
88102
#### Multiplexing
89103

90104
More than connecting with other peers, you want to have them communicating in a meaningful way to your application. With libp2p you are able to create your own protocols so that you can integrate your business logic into the network. As an example, you can create a chat protocol on top of libp2p and use it to exchange chat messages.
@@ -168,6 +182,14 @@ Protocols design is similar to an http api, where each protocol has an handler,
168182

169183
Note that there are a lot of useful modules for working with async iterables, you can find them on [alanshaw/it-awesome](https://github.com/alanshaw/it-awesome). For example, we could use [alanshaw/paramap-it](https://github.com/alanshaw/paramap-it) to simplify the transform function above.
170184

185+
<details><summary>Read More</summary>
186+
If you want to know more about libp2p stream multiplexing, you should read the following content:
187+
188+
- https://docs.libp2p.io/concepts/stream-multiplexing
189+
- https://github.com/libp2p/specs/tree/master/connections
190+
- https://github.com/libp2p/specs/tree/master/mplex
191+
</details>
192+
171193
#### Running Libp2p
172194

173195
Now that you have configured a [`Transport`][transport], [`Crypto`][crypto] and [**Stream Multiplexer**](streamMuxer) module, you can start your libp2p node. We can start and stop libp2p using the [`libp2p.start()`](./API.md#start) and [`libp2p.stop()`](./API.md#stop) methods.
@@ -267,6 +289,12 @@ node.on('peer:discovery', (peer) => {
267289
await node.start()
268290
```
269291

292+
<details><summary>Read More</summary>
293+
If you want to know more about libp2p peer discovery, you should read the following content:
294+
295+
- https://github.com/libp2p/specs/blob/master/discovery/mdns.md
296+
</details>
297+
270298
#### Peer Routing
271299

272300
Peer Routing offers a way to find other peers in the network by issuing queries using a Peer Routing algorithm, through their peer ids.
@@ -318,6 +346,12 @@ const peerInfo = await libp2p.peerRouting.findPeer(peerId)
318346

319347
You can find out more about peer routing on the example provided on [./CONFIGURATION.md#setup-with-content-and-peer-routing](./CONFIGURATION.md#setup-with-content-and-peer-routing).
320348

349+
<details><summary>Read More</summary>
350+
If you want to know more about libp2p peer routing, you should read the following content:
351+
352+
- https://docs.libp2p.io/concepts/peer-routing
353+
</details>
354+
321355
#### Content Routing
322356

323357
Content routing provides a way to find where content lives in the network. It works in two steps: 1) Peers provide (announce) to the network that they are holders of specific content and 2) Peers issue queries to find where that content lives. A Content Routing mechanism could be as complex as a DHT or as simple as a registry somewhere in the network.
@@ -374,6 +408,12 @@ for await (const provider of libp2p.contentRouting.findProviders(cid2)) {
374408

375409
If you are not familiar with `CIDs`, you should have a look at [multiformats/js-cid](https://github.com/multiformats/js-cid). Moreover, you can find out more about peer routing on the example provided on [./CONFIGURATION.md#setup-with-content-and-peer-routing](./CONFIGURATION.md#setup-with-content-and-peer-routing).
376410

411+
<details><summary>Read More</summary>
412+
If you want to know more about libp2p content routing, you should read the following content:
413+
414+
- https://docs.libp2p.io/concepts/content-routing
415+
</details>
416+
377417
### Pubsub
378418

379419
If you are looking for real time message exchange between peers, pubsub may be what you are looking for. Publish/Subscribe is a system where peers congregate around topics they are interested in. Peers interested in a topic are said to be subscribed to that topic and should receive the data published on it from other peers.
@@ -421,9 +461,15 @@ node.pubsub.subscribe(topic, (msg) => {
421461
setInterval(async () => {
422462
await node.pubsub.publish(topic, Buffer.from('heartbeat data'))
423463
}, 1000)
424-
425464
```
426465

466+
<details><summary>Read More</summary>
467+
If you want to know more about libp2p pubsub, you should read the following content:
468+
469+
- https://docs.libp2p.io/concepts/publish-subscribe
470+
- https://github.com/libp2p/specs/tree/master/pubsub
471+
</details>
472+
427473
## What is next
428474

429475
There are a lot of other concepts within `libp2p`, mostly regarding performance improvement through connection management configuration, metrics, create your own modules, among other.

0 commit comments

Comments
 (0)