diff --git a/GUIDE.md b/GUIDE.md index 44ff7cf..3be03e4 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -46,8 +46,21 @@ Require OrbitDB and IPFS in your program and create the instances: const IPFS = require('ipfs') const OrbitDB = require('orbit-db') -const ipfs = new IPFS() +// 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 in this document even if not specfied so. +const ipfsOptions = { + EXPERIMENTAL: { + pubsub: true + }, +} + +// Create IPFS instance +const ipfs = new IPFS(ipfsOptions) + ipfs.on('ready', () => { + // Create OrbitDB instance const orbitdb = new OrbitDB(ipfs) }) ``` diff --git a/README.md b/README.md index d5d6f30..d6c96f1 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,18 @@ Use it as a module: const IPFS = require('ipfs') const OrbitDB = require('orbit-db') -const ipfs = new IPFS() +// 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 specfied so. +const ipfsOptions = { + EXPERIMENTAL: { + pubsub: true + }, +} + +// Create IPFS instance +const ipfs = new IPFS(ipfsOptions) ipfs.on('error', (e) => console.error(e)) ipfs.on('ready', async () => {