【发布时间】:2020-10-13 18:51:28
【问题描述】:
我正在尝试将 orbit-db 与 IPFS 一起使用,并且正在阅读 OrbitDB 的官方文档。 ATM,我只是想创建一个数据库(特别是键值存储),我现在有以下代码
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
createDb = async() => {
try {
const ipfsOptions = {
config: {
my-config-options
},
EXPERIMENTAL: {
pubsub: true
}
}
const ipfs = await IPFS.create(ipfsOptions)
const orbitdb = await OrbitDB.createInstance(ipfs)
const db = await orbitdb.create('test', 'keyvalue', {
overwrite: false,
replicate: true,
accessController: {
admin: ['*'],
write: ['*']
}
})
console.log(db)
await db.put('hello', { name: 'world' })
console.log(db.all)
} catch (error) {
console.trace(error)
}
}
但无论我尝试什么,我都会遇到同样的错误
Trace: Error: Could not append entry, key "..." is not allowed to write to the log
因此,我们将不胜感激任何帮助。如果缺少任何信息,也请发表评论,我会根据要求添加它
【问题讨论】: