Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

CIDs with dag-cbor formats as V0 addresses #35

Closed
vmatekole opened this issue Jul 5, 2017 · 4 comments
Closed

CIDs with dag-cbor formats as V0 addresses #35

vmatekole opened this issue Jul 5, 2017 · 4 comments
Labels
kind/support A question or request for support

Comments

@vmatekole
Copy link

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?

@daviddias
Copy link
Member

CIDv0 is dag-pb, sha2-256 and base58 only. CIDv0 is "pre CID era", to use dag-cbor, any other hash func or any other base you need to use CIDv1 or above. See: https://github.com/ipld/cid

I bet that probably what you need is for the HTTP API to support the DAG API properly. Please see:

@daviddias
Copy link
Member

@vmatekole did the above answer your question?

@daviddias daviddias added kind/support A question or request for support status/deferred Conscious decision to pause or backlog labels Jul 9, 2017
@vmatekole
Copy link
Author

Hi @diasdavid, only just got your response. Will take a look and respond at my earliest.

@daviddias daviddias added ready and removed status/deferred Conscious decision to pause or backlog labels Sep 13, 2017
@daviddias
Copy link
Member

Closing for now, @vmatekole if you have any other questions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

2 participants