Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

feat: support passing DAGNodes as content #47

Closed
wants to merge 1 commit into from

Conversation

achingbrain
Copy link
Collaborator

@achingbrain achingbrain commented Jan 11, 2020

Sometimes you just want to do some DAG manipulations, you don't necessarily want to chunk and create files.

This PR allows you to pass DAGNodes as .content for entries being imported, so you can combine the unixfs-exporter and unixfs-importer as a tree walker do fun things with metadata at a reasonable speed.

Also removes the multihashes dep in favour of the one exported by multihashing-async.

Sometimes you just want to do some DAG manipulations, you don't
necessarily want to chunk and create files.  This PR allows you
to pass `DAGNode`s as `.content` for entries being imported.

Also removes the `multihashes` dep in favour of the one exported
by `multihashing-async`.
@alanshaw
Copy link
Contributor

May I have some more information about your use case and why it's slower please?

@achingbrain
Copy link
Collaborator Author

Superseded by #48

@achingbrain achingbrain deleted the support-dagnodes-as-content branch January 13, 2020 16:12
@achingbrain
Copy link
Collaborator Author

In ipfs-inactive/js-ipfs-mfs#73 I'm piping the unixfs-exporter into the unixfs-importer to walk a UnixFS graph and update metadata. I don't want to reimport all of the files (the bit about it being slower), just update the metadata of the root nodes of each UnixFS entry.

The import pipeline is something like:

chunk -> create-file/dir-dag -> create-dir-tree

I don't need to chunk or create files (the expensive bit), just do the directory tree bit at the end, including having things be sharded if they are really big and that's what this (or #48) allows.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants