mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
fix examples/keyvalue.js
This commit is contained in:
parent
487eb441f8
commit
57027a5c05
@ -23,19 +23,17 @@ const output = (user) => {
|
||||
|
||||
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/keyvalue'
|
||||
})
|
||||
@ -65,4 +63,5 @@ ipfs.on('ready', async () => {
|
||||
|
||||
console.log("Starting update loop...")
|
||||
setInterval(query, 1000)
|
||||
})
|
||||
}
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user