Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
docs: update examples and README
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Feb 1, 2017
1 parent 6441898 commit a533bee
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ The HTTP-API exposed by the js-ipfs daemon follows the [`http-api-spec`](https:/
const repo = <IPFS Repo instance or repo path>

// 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
Expand Down
7 changes: 6 additions & 1 deletion examples/basics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 6 additions & 1 deletion examples/bundle-browserify/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 6 additions & 1 deletion examples/bundle-webpack/src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a533bee

Please sign in to comment.