js-ipfs
js-ipfs copied to clipboard
Error when publishing IPNS entry
Hello, I'm a rookie in IPFS world so please take that into account.
- Version:
- Version: 0.14.3
- Platform:
- Subsystem:
Severity:
Description:
I successfully ran a IPFS node on my nestjs API using js-ipfs (ipfs-core). When trying to publish a IPNS record, I get the following error:
Error: ipns record for f5uxa3ttf4acicabciqhcqrufyvadw2s7tyk2lp7tiaca737jtwpi6sjeiwzv4xqpsmwehi could not be stored in the routing - Error: Write failed
at Object.dbWriteFailedError (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/datastore-core/cjs/src/errors.js:20:16)
at TieredDatastore.put (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/datastore-core/cjs/src/tiered.js:34:20)
at IpnsPublisher._publishEntry (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/ipfs-core/cjs/src/ipns/publisher.js:85:19)
at IpnsPublisher._putRecordToRouting (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/ipfs-core/cjs/src/ipns/publisher.js:67:5)
Code sample:
async test() {
const ipfs = await create();
const file = await ipfs.add({
path: 'text.txt',
content: new TextEncoder().encode(
'Hello World ' + new Date().toISOString(),
),
});
const addr = `/ipfs/${file.cid.toString()}`;
const res = await this.node.name.publish(addr);
console.log(`https://gateway.ipfs.io/ipns/${res.name}`);
}
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:
- "Priority" labels will show how urgent this is for the team.
- "Status" labels will show if this is ready to be worked on, blocked, or in progress.
- "Need" labels will indicate if additional input or analysis is required.
Finally, remember to use https://discuss.ipfs.io if you just need general support.
Hey @tknoch-symphony any progress with your issue , I am having exactly the same error.
@mbutan no luck, as you see I got no answer, same thing in IPFS forum. Let me know if you manage something
I've solved this before by simply doing ipfs.stop() and ipfs.start() and retrying automatically which improves rate of it working 100s of times. as to why no idea.
I found the source of the bug and posted a solution. it's in the issue https://github.com/ipfs/js-ipfs/issues/4267
js-ipfs is being deprecated in favor of Helia. You can https://github.com/ipfs/js-ipfs/issues/4336 and read the migration guide.
Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see https://github.com/ipfs/js-ipfs/issues/4336).
This issue is most likely resolved in Helia, please try it out!