docs: add build step to docs (#1275)

Now that we need to build ts to js a build step is necessary.

Add it to the instructions where we are telling people to clone the repo first.

Refs: #1273
This commit is contained in:
Alex Potsides 2022-06-24 16:28:56 +01:00 committed by GitHub
parent b270527c8f
commit ceb44f9e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 7 deletions

View File

@ -105,6 +105,7 @@ You can find multiple examples on the [examples folder](./examples) that will gu
> git clone https://github.com/libp2p/js-libp2p.git
> cd js-libp2p
> npm install
> npm run build
```
### Tests

View File

@ -5,7 +5,7 @@ While direct connections to nodes are preferable, it's not always possible to do
## 0. Setup the example
Before moving into the examples, you should run `npm install` on the top level `js-libp2p` folder, in order to install all the dependencies needed for this example. Once the install finishes, you should move into the example folder with `cd examples/auto-relay`.
Before moving into the examples, you should run `npm install` and `npm run build` on the top level `js-libp2p` folder, in order to install all the dependencies needed for this example. Once the install finishes, you should move into the example folder with `cd examples/auto-relay`.
This example comes with 3 main files. A `relay.js` file to be used in the first step, a `listener.js` file to be used in the second step and a `dialer.js` file to be used on the third step. All of these scripts will run their own libp2p node, which will interact with the previous ones. All nodes must be running in order for you to proceed.

View File

@ -3,7 +3,7 @@
This example creates a simple chat app in your terminal.
## Setup
1. Install the modules in the libp2p root directory, `npm install`.
1. Install the modules in the libp2p root directory, `npm install` and `npm run build`.
2. Open 2 terminal windows in the `./examples/chat/src` directory.
## Running

View File

@ -3,7 +3,7 @@
This example performs a simple echo from the listener to the dialer.
## Setup
1. Install the modules from libp2p root, `npm install`.
1. Install the modules from libp2p root, `npm install` and `npm run build`.
2. Open 2 terminal windows in the `./src` directory.
## Running

View File

@ -11,6 +11,7 @@ In order to run the example:
```
npm install
npm run build
cd ./examples/libp2p-in-the-browser
npm install
```

View File

@ -8,7 +8,7 @@ Content Routing is the category of modules that offer a way to find where conten
# 1. Using Peer Routing to find other peers
This example builds on top of the [Protocol and Stream Muxing](../protocol-and-stream-muxing). We need to install `libp2p-kad-dht`, go ahead and `npm install libp2p-kad-dht`. If you want to see the final version, open [1.js](./1.js).
This example builds on top of the [Protocol and Stream Muxing](../protocol-and-stream-muxing). We need to install `@libp2p/kad-dht`, go ahead and `npm install @libp2p/kad-dht`. If you want to see the final version, open [1.js](./1.js).
First, let's update our config to support Peer Routing and Content Routing.

View File

@ -2,7 +2,7 @@
This example shows how to set up a private network of libp2p nodes.
## Setup
1. Install the modules in the libp2p root directory, `npm install`.
1. Install the modules in the libp2p root directory, `npm install` and `npm run build`.
## Run
Running the example will cause two nodes with the same swarm key to be started and exchange basic information.

View File

@ -10,7 +10,7 @@ We've seen many interesting use cases appear with this, here are some highlights
## 0. Set up the example
Before moving into the examples, you should run `npm install` on the top level `js-libp2p` folder, in order to install all the dependencies needed for this example. In addition, you will need to install the example related dependencies by doing `cd examples && npm install`. Once the install finishes, you should move into the example folder with `cd pubsub`.
Before moving into the examples, you should run `npm install` and `npm run build` on the top level `js-libp2p` folder, in order to install all the dependencies needed for this example. In addition, you will need to install the example related dependencies by doing `cd examples && npm install`. Once the install finishes, you should move into the example folder with `cd pubsub`.
## 1. Setting up a simple PubSub network on top of libp2p