docs: update examples for 0.29 (#742)

* docs: update examples for 0.29

* fix: update examples/libp2p-in-the-browser/package.json

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
This commit is contained in:
Jacob Heun 2020-08-27 18:13:38 +02:00 committed by GitHub
parent bbf8ef7065
commit 3c2a45a9d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 32 deletions

View File

@ -29,7 +29,7 @@ function streamToConsole(stream) {
// For each chunk of data // For each chunk of data
for await (const msg of source) { for await (const msg of source) {
// Output the data as a utf8 string // Output the data as a utf8 string
console.log('> ' + uint8ArrayToString(msg).replace('\n', '')) console.log('> ' + msg.toString().replace('\n', ''))
} }
} }
) )

View File

@ -16,12 +16,12 @@
"dependencies": { "dependencies": {
"@babel/preset-env": "^7.8.3", "@babel/preset-env": "^7.8.3",
"libp2p": "../../", "libp2p": "../../",
"libp2p-bootstrap": "^0.11", "libp2p-bootstrap": "^0.12.1",
"libp2p-mplex": "^0.9.3", "libp2p-mplex": "^0.10.0",
"libp2p-noise": "^1.1.0", "libp2p-noise": "^2.0.0",
"libp2p-secio": "^0.12.2", "libp2p-secio": "^0.13.1",
"libp2p-webrtc-star": "^0.18.0", "libp2p-webrtc-star": "^0.20.0",
"libp2p-websockets": "^0.13.2" "libp2p-websockets": "^0.14.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.8.3", "@babel/cli": "^7.8.3",

View File

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

View File

@ -1,20 +0,0 @@
{
"name": "pnet-ipfs-example",
"version": "1.0.0",
"description": "An example of private networking with IPFS",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"libp2p": "../..",
"libp2p-mplex": "^0.9.3",
"libp2p-noise": "^1.1.0",
"libp2p-secio": "^0.12.1",
"libp2p-tcp": "^0.14.2"
}
}