From a533bee98590620022a6378f9fbe0e0b2fcaa53a Mon Sep 17 00:00:00 2001 From: David Dias Date: Wed, 1 Feb 2017 12:01:19 +0000 Subject: [PATCH] docs: update examples and README --- README.md | 7 ++++++- examples/basics/index.js | 7 ++++++- examples/bundle-browserify/src/index.js | 7 ++++++- examples/bundle-webpack/src/components/app.js | 7 ++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ee50b9894..df3167cb16 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,12 @@ The HTTP-API exposed by the js-ipfs daemon follows the [`http-api-spec`](https:/ const repo = // Create the IPFS node instance -const node = new IPFS(repo) +const node = new IPFS({ + repo: repo, + EXPERIMENTAL: { + pubsub: false + } +}) // We need to init our repo, in this case the repo was empty // We are picking 2048 bits for the RSA key that will be our PeerId diff --git a/examples/basics/index.js b/examples/basics/index.js index a3c9c1c2ee..0c1528ea62 100644 --- a/examples/basics/index.js +++ b/examples/basics/index.js @@ -12,7 +12,12 @@ const IPFS = require('../../src/core') /* * Create a new IPFS instance, using default repo (fs) on default path (~/.ipfs) */ -const node = new IPFS(path.join(os.tmpDir() + '/' + new Date().toString())) +const node = new IPFS({ + repo: path.join(os.tmpDir() + '/' + new Date().toString()), + EXPERIMENTAL: { + pubsub: false + } +}) const fileToAdd = { path: 'hello.txt', diff --git a/examples/bundle-browserify/src/index.js b/examples/bundle-browserify/src/index.js index f4fa15d2ee..bb95e3f48a 100644 --- a/examples/bundle-browserify/src/index.js +++ b/examples/bundle-browserify/src/index.js @@ -7,7 +7,12 @@ var IPFS = require('../../../src/core') // replace this by line below // for simplicity, we create a new repo everytime the node // is created, because you can't init already existing repos const repoPath = String(Math.random()) -const node = new IPFS(repoPath) +const node = new IPFS({ + repo: repoPath, + EXPERIMENTAL: { + pubsub: false + } +}) const concat = require('concat-stream') node.init({ emptyRepo: true, bits: 2048 }, function (err) { diff --git a/examples/bundle-webpack/src/components/app.js b/examples/bundle-webpack/src/components/app.js index 33c145b912..0b84e6404d 100644 --- a/examples/bundle-webpack/src/components/app.js +++ b/examples/bundle-webpack/src/components/app.js @@ -29,7 +29,12 @@ class App extends React.Component { // for simplicity, we create a new repo everytime the node // is created, because you can't init already existing repos const repoPath = String(Math.random()) - node = new IPFS(repoPath) + node = new IPFS({ + repo: repoPath, + EXPERIMENTAL: { + pubsub: false + } + }) node.init({ emptyRepo: true, bits: 2048 }, function (err) { if (err) {