1

I'm trying to retrieve a DAG persisted with the following options via webui. As I understand it, to do so I have to convert to a V0 address as per — https://github.com/ipld/js-cid/blob/38e5dd0f5e89a750d9f20efefdaa00d38b287739/test/index.spec.js#L81 : const dagOpts = { format: 'dag-cbor', hashAlg: 'sha3-512' };

I have the following code that results in an error — 'Cannot convert a non dag-pb CID to CIDv0' : let cid = new CID("zdpuAypJXbmGCLweJBL6R1iBpDGJyP8LU1BwZjzRjwNxohzvE"); console.log(cid.toV0());

Is it possible at all to access objects of format dag-cbor type from webui or IPFS cli?

1 Answer 1

3

Cannot convert a non dag-pb CID to CIDv0

CIDv0 address can only point to DAG ProtoBuf objects. This is the original object encoding format used by IPFS. If you want to use DAG CBOR (the new "standard" object encoding format), you need to use CIDv1.

Is it possible at all to access objects of format dag-cbor type from webui or IPFS cli?

Yes; use the CIDv1 address. In the CLI, the command would be ipfs dag get zdpuAypJXbmGCLweJBL6R1iBpDGJyP8LU1BwZjzRjwNxohzvE. Note: Make sure you're you're using the same hash function you used when adding the node.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.