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...") console.log("Starting...")
const ipfs = new IPFS({ async function main () {
repo: './orbitdb/examples/ipfs',
start: true,
EXPERIMENTAL: {
pubsub: true,
},
})
ipfs.on('error', (err) => console.error(err))
ipfs.on('ready', async () => {
let db let db
try { try {
const ipfs = await IPFS.create({
repo: './orbitdb/examples/ipfs',
start: true,
EXPERIMENTAL: {
pubsub: true,
},
})
const orbitdb = await OrbitDB.createInstance(ipfs, { const orbitdb = await OrbitDB.createInstance(ipfs, {
directory: './orbitdb/examples/eventlog' directory: './orbitdb/examples/eventlog'
}) })
@ -52,4 +49,5 @@ ipfs.on('ready', async () => {
} }
setInterval(query, 1000) setInterval(query, 1000)
}) }
main()