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

feat: load files/dirs from hamt shards #19

Merged
merged 1 commit into from
Jun 6, 2019

Conversation

achingbrain
Copy link
Member

Use the HAMT support and IPFS overlay build in to the mfs related files commands to enable loading files from HAMT shards.

Fixes ipfs/js-ipfs#1963
Depends on ipfs-inactive/js-ipfs-mfs#48 and a more recent version of ipfs/ipfsd-ctl

@achingbrain achingbrain requested review from lidel and vasco-santos and removed request for lidel April 2, 2019 14:46
@ghost ghost assigned achingbrain Apr 2, 2019
@ghost ghost added the status/in-progress In progress label Apr 2, 2019
@achingbrain
Copy link
Member Author

achingbrain commented Apr 2, 2019

I think this also resolves #14, though I took a slightly different approach.

@achingbrain achingbrain requested a review from lidel April 2, 2019 14:57
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason /ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/ does not load for me (just hangs)

I was able to load Wikipedia from /ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/ tho :)

Unrelated note about index.html

Below is not related to this PR, just something I noticed

Instead of returning index.html as payload for wiki/, it returns a redirect to wiki/index.html, which makes ugly URLs and breaks interop with go-ipfs.

this PR

$ curl -I -X GET http://127.0.0.1:9090/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/
HTTP/1.1 302 Found
location: /ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/index.html

go-ipfs 0.4.19

$ curl -I -X GET http://127.0.0.1:8080/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/
HTTP/1.1 200 OK 

[ HTML PAYLOAD from index.html ]

I believe we should not redirect, and keep wiki/, just like go-ipfs does.

@vasco-santos
Copy link
Member

@achingbrain Can you rebase this PR with master branch?

The travis CI was not configured yet in this repo and I just added it

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, issues I described before were not related to this PR.

I re-tested it with in Brave (ipfs/ipfs-companion#716) with QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco and works as expected now, wikipedia loads fine :)

@lidel
Copy link
Member

lidel commented May 6, 2019

@achingbrain let's push this over the finish line: mind rebasing on master to add green CI and get it merged? If you don't have bandwidth, want me to help with it?

@vasco-santos I opened #22 to track Sharding in IPNS without blocking this PR (which adds sharding support in /ipfs/ paths)

@vasco-santos
Copy link
Member

@achingbrain I rebased the PR and some tests are failing. Are you able to have a look?

@lidel thanks for opening the issue for tracking sharding in IPNS :)

lidel added a commit to ipfs/js-ipfs that referenced this pull request May 7, 2019
It requires below to PRs to land first:

#2002
ipfs/js-ipfs-http-response#19
ipfs-inactive/js-ipfs-mfs#48

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
lidel added a commit to lidel/js-ipfs that referenced this pull request May 7, 2019
It requires below to PRs to land first:

ipfs#2002
ipfs/js-ipfs-http-response#19
ipfs-inactive/js-ipfs-mfs#48

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
lidel added a commit to ipfs/js-ipfs that referenced this pull request May 13, 2019
It requires below to PRs to land first:

#2002
ipfs/js-ipfs-http-response#19
ipfs-inactive/js-ipfs-mfs#48

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel
Copy link
Member

lidel commented May 14, 2019

I've re-run Travis and the PR one passed, but the Branch one did not 🤔 🙃

@lidel
Copy link
Member

lidel commented May 14, 2019

@vasco-santos I re-tested locally and tests fail with Uncaught Error: Invalid version, must be a number equal to 1 or 0 because this PR depends on ipfs-inactive/js-ipfs-mfs#48 which is a dependency of ipfs-unixfs.

AFAIK @achingbrain is working on new release of ipfs-unixfs, so when that lands this PR needs to switch to new release and tests will pass.

@vasco-santos
Copy link
Member

Thanks for your testing @lidel ! Let's wait for it then

@vasco-santos
Copy link
Member

Can you rebase this PR? I think that rebasing this PR and using temporarily js-ipfs@0.36.0-rc.0 should get CI green

Use the HAMT support and IPFS overlay build in to the mfs related
files commands to enable loading files from HAMT shards.
@achingbrain achingbrain force-pushed the load-files-from-hamt-shards branch from f284f76 to d749e05 Compare June 6, 2019 15:42
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vasco-santos vasco-santos merged commit 25edfbc into master Jun 6, 2019
@vasco-santos vasco-santos deleted the load-files-from-hamt-shards branch June 6, 2019 17:38
lidel added a commit to ipfs/js-ipfs that referenced this pull request Jun 27, 2019
It requires below to PRs to land first:

#2002
ipfs/js-ipfs-http-response#19
ipfs-inactive/js-ipfs-mfs#48

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP Gateway fails to load sharded website
3 participants