fix: fix documentation
fixed initialization snippet for `ipfs` module
This commit is contained in:
parent
5f7f20e621
commit
2c9dd9480d
10
README.md
10
README.md
@ -95,8 +95,11 @@ const OrbitDB = require('orbit-db')
|
||||
|
||||
// Create IPFS instance
|
||||
|
||||
var ipfs;
|
||||
|
||||
const initIPFSInstance = async () => {
|
||||
// For js-ipfs >= 0.38
|
||||
const ipfs = new IPFS()
|
||||
ipfs = await IPFS.create({ repo: "./path-for-js-ipfs-repo" });
|
||||
|
||||
// For js-ipfs < 0.38
|
||||
const ipfsOptions = {
|
||||
@ -104,7 +107,10 @@ const ipfsOptions = {
|
||||
pubsub: true
|
||||
}
|
||||
}
|
||||
const ipfs = new IPFS(ipfsOptions)
|
||||
ipfs = new IPFS(ipfsOptions)
|
||||
}
|
||||
|
||||
initIPFSInstance()
|
||||
|
||||
ipfs.on('error', (e) => console.error(e))
|
||||
ipfs.on('ready', async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user