mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 10:32:14 +00:00
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:
parent
bbf8ef7065
commit
3c2a45a9d2
@ -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', ''))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -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",
|
||||||
|
@ -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.
|
||||||
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user