mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Update README.md
This commit is contained in:
10
README.md
10
README.md
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user