Update README.md

This commit is contained in:
hazæ41
2019-11-11 16:45:50 +01:00
committed by GitHub
parent c2fcccc236
commit 6d4f7bb3bc

View File

@@ -92,8 +92,18 @@ const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
// Create IPFS instance
// For js-ipfs >= 0.38
const ipfs = new IPFS()
// For js-ipfs < 0.38
const ipfsOptions = {
EXPERIMENTAL: {
pubsub: true
}
}
const ipfs = new IPFS(ipfsOptions)
ipfs.on('error', (e) => console.error(e))
ipfs.on('ready', async () => {
const orbitdb = await OrbitDB.createInstance(ipfs)