fix examples/eventlog.js

This commit is contained in:
anders 2020-12-09 17:26:00 -06:00 committed by Mark Robert Henderson
parent 57027a5c05
commit 35035badb0

View File

@ -7,20 +7,17 @@ const creatures = ['🐙', '🐷', '🐬', '🐞', '🐈', '🙉', '🐸', '🐓
console.log("Starting...")
const ipfs = new IPFS({
repo: './orbitdb/examples/ipfs',
start: true,
EXPERIMENTAL: {
pubsub: true,
},
})
ipfs.on('error', (err) => console.error(err))
ipfs.on('ready', async () => {
async function main () {
let db
try {
const ipfs = await IPFS.create({
repo: './orbitdb/examples/ipfs',
start: true,
EXPERIMENTAL: {
pubsub: true,
},
})
const orbitdb = await OrbitDB.createInstance(ipfs, {
directory: './orbitdb/examples/eventlog'
})
@ -52,4 +49,5 @@ ipfs.on('ready', async () => {
}
setInterval(query, 1000)
})
}
main()