Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HAMT directories #37

Closed
Gozala opened this issue Nov 10, 2022 · 4 comments
Closed

Add support for HAMT directories #37

Gozala opened this issue Nov 10, 2022 · 4 comments
Assignees

Comments

@Gozala
Copy link
Collaborator

Gozala commented Nov 10, 2022

JS-ipfs starts sharing directories once directory has more that 1000 entries, so that it fits in block limit.

We need to support sharded directories for the same reason.

@Gozala
Copy link
Collaborator Author

Gozala commented Mar 6, 2023

Blocked on getting coverage in Gozala/perma-map#1 to 100% so it can land and be released

@Gozala
Copy link
Collaborator Author

Gozala commented Mar 6, 2023

@alanshaw so have some code laying around but I don't think it's very useful. Most of basically does what I pulled out into separate repo Gozala/perma-map#1 idea was to rewrite the directory writer to use the hamt from the get go. Then on close asses whether it's small enough to be just encoded as flat directory (current behavior) or encode it as UnixFS HAMT. Also note that HAMT implementation is more generic and optimal that one used by UnixFS, however there is unixfs module in the repo that can map into UnixFS expected DAG layout and some tests verifying it produces same result as unixfs-importer.

@alanshaw
Copy link
Member

alanshaw commented Mar 7, 2023

I have a script to create a fixture from a CAR file with a HAMT sharded directory in it.

Idea is to generate a fixture do an ipfs add -r big-dir and then ipfs dag export bafy... > my.car and use the script to generate the fixture from the data.

I'm currently encountering a bug where some values are coming back incorrectly - they're the key not the value 😱:

Screenshot 2023-03-07 at 15 33 55

@alanshaw
Copy link
Member

Resolved by #41

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

No branches or pull requests

2 participants