Merge pull request #722 from hazae41/master

Update README.md
This commit is contained in:
Richard Littauer 2019-11-12 09:28:07 -05:00 committed by GitHub
commit 7ef7ee2e79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,17 +90,18 @@ npm install orbit-db ipfs
```javascript
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
// OrbitDB uses Pubsub which is an experimental feature
// and need to be turned on manually.
// Note that these options need to be passed to IPFS in
// all examples even if not specified so.
// Create IPFS instance
// For js-ipfs >= 0.38
const ipfs = new IPFS()
// For js-ipfs < 0.38
const ipfsOptions = {
EXPERIMENTAL: {
pubsub: true
}
}
// Create IPFS instance
const ipfs = new IPFS(ipfsOptions)
ipfs.on('error', (e) => console.error(e))