-
Notifications
You must be signed in to change notification settings - Fork 1.2k
The ipfs.dag.import
API
#3910
Comments
Unfortunately you're correct that it will only return roots when pinning; there's additionally a new option that's making its way through the stack, starting with go-ipfs, to add a It's possible that An alternative in JS is to just use the @ipld/car library directly to get this information. There's a few methods you can provide an AsyncIterable to which will give you the roots without forcing you to process the entire CAR. There also may be scope to add a special |
Thanks for the quick response @rvagg :) I'll open a PR for the We were actually migrating away from Only now I figured out that we could use |
Oh, that's interesting. There's new work on the ipfs.dag.put API in go-ipfs (0.10) that may be of interest when it bubbles up through these JS interfaces that makes working with raw data a bit nicer. The block API is good, and efficient, but there's a lot ore flexibility in the DAG API now. Also, did you know that every codec in JS now has its
|
Yeah, that's true. In my use case the issue is that the only thing I have at hand is a |
A couple of things I noticed from using the API:
AsyncIterable<{ cid: CID, pinErrorMsg?: string }>
, but it seems to actually be `AsyncIterable<{ root: { cid: CID, pinErrorMsg?: string } }>pinRoots: true
is set in the options. I find this unexpected. Can't it return the roots even if it doesn't pin them?I'm happy to provide a PR for that :)
The text was updated successfully, but these errors were encountered: