-
-
Save shamb0t/5ca98a24dae3568a5ba8802feabf9147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const IPFS = require('ipfs') | |
const OrbitDB = require('orbit-db') | |
const ipfsOptions = { | |
repo: 'PATH/TO/YOUR/IPFS/REPO/HERE', | |
EXPERIMENTAL: { | |
pubsub: true | |
} | |
} | |
// Create IPFS instance | |
const ipfs = new IPFS(ipfsOptions) | |
ipfs.on('ready', () => { | |
// Create OrbitDB instance | |
const orbitdb = new OrbitDB(ipfs) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks again for your help, It worked like a charm, but ended up by doing like this (could you tell me if there's a good reason as why NOT to do this?) I found out, it gives me more flexibility in my architecture, and more stability:
const IPFSAPI = require('ipfs-api')
const OrbitDB = require('orbit-db')
const ipfs = IPFSAPI('localhost', 5001)
const orbitdb = new OrbitDB(ipfs)