我正在尝试运行下面的代码。当我使用node命令运行时,它运行得很好。
const IPFS = require('ipfs')
const series = require('async/series')
const node = new IPFS()
let fileMultihash
series([
(cb) => node.on('ready', cb),
(cb) => node.version((err, version) => {
if (err) { return cb(err) }
console.log('Version:', version.version)
cb()
}),
(cb) => node.files.add({
path: 'hello.txt',
content: Buffer.from('Hello this is test asi394298')
}, (err, filesAdded) => {
if (err) { return cb(err) }
console.log('\nAdded file:', filesAdded[0].path, filesAdded[0].hash)
fileMultihash = filesAdded[0].hash
cb()
}),
(cb) => node.files.cat(fileMultihash, (err, data) => {
if (err) { return cb(err) }
console.log('\nFile content:')
process.stdout.write(data)
})
])
但是,当我通过browserify运行并将其添加到我的网站时,我从脚本中收到此错误。
err {type: "WriteError", name: "WriteError", cause: undefined, message: "QuotaExceededError", stack: "WriteError: QuotaExceededError↵ at http://local…rt (http://localhost/papyrcoin/bundle.js:87990:5)"}
我不确定这意味着什么或如何解决它。有人可以帮忙吗?
答案 0 :(得分:0)
这是一条狩猎信息,表示你写的东西已经用完了空间
通常出现在iOS上
它出现的一个奇怪的情况是当localstorage根本不可用时(例如,在私人浏览器会话中)
我怀疑这反映了缺乏ipfs尝试写入的内容,但没有更多的上下文,这是一个猜测