mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-06 22:26:41 +00:00
fix examples/eventlog.js
This commit is contained in:
parent
57027a5c05
commit
35035badb0
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user