From 3c2a45a9d2062a38dee543b11ad72675c1dc79fd Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Thu, 27 Aug 2020 18:13:38 +0200 Subject: [PATCH] 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 Co-authored-by: Vasco Santos --- examples/chat/src/stream.js | 2 +- examples/libp2p-in-the-browser/package.json | 12 ++++++------ examples/pnet/README.md | 6 +----- examples/pnet/package.json | 20 -------------------- 4 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 examples/pnet/package.json diff --git a/examples/chat/src/stream.js b/examples/chat/src/stream.js index de888dc7..6c44abcb 100644 --- a/examples/chat/src/stream.js +++ b/examples/chat/src/stream.js @@ -29,7 +29,7 @@ function streamToConsole(stream) { // For each chunk of data for await (const msg of source) { // Output the data as a utf8 string - console.log('> ' + uint8ArrayToString(msg).replace('\n', '')) + console.log('> ' + msg.toString().replace('\n', '')) } } ) diff --git a/examples/libp2p-in-the-browser/package.json b/examples/libp2p-in-the-browser/package.json index 91f58823..6c8b2123 100644 --- a/examples/libp2p-in-the-browser/package.json +++ b/examples/libp2p-in-the-browser/package.json @@ -16,12 +16,12 @@ "dependencies": { "@babel/preset-env": "^7.8.3", "libp2p": "../../", - "libp2p-bootstrap": "^0.11", - "libp2p-mplex": "^0.9.3", - "libp2p-noise": "^1.1.0", - "libp2p-secio": "^0.12.2", - "libp2p-webrtc-star": "^0.18.0", - "libp2p-websockets": "^0.13.2" + "libp2p-bootstrap": "^0.12.1", + "libp2p-mplex": "^0.10.0", + "libp2p-noise": "^2.0.0", + "libp2p-secio": "^0.13.1", + "libp2p-webrtc-star": "^0.20.0", + "libp2p-websockets": "^0.14.0" }, "devDependencies": { "@babel/cli": "^7.8.3", diff --git a/examples/pnet/README.md b/examples/pnet/README.md index b7515e96..b14f8f4a 100644 --- a/examples/pnet/README.md +++ b/examples/pnet/README.md @@ -2,11 +2,7 @@ This example shows how to set up a private network of libp2p nodes. ## Setup -Install dependencies: - -``` -npm install -``` +1. Install the modules in the libp2p root directory, `npm install`. ## Run Running the example will cause two nodes with the same swarm key to be started and exchange basic information. diff --git a/examples/pnet/package.json b/examples/pnet/package.json deleted file mode 100644 index 4736ac77..00000000 --- a/examples/pnet/package.json +++ /dev/null @@ -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" - } -}