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

Sharding support in /ipns/<fqdn> paths #22

Open
lidel opened this issue May 6, 2019 · 0 comments
Open

Sharding support in /ipns/<fqdn> paths #22

lidel opened this issue May 6, 2019 · 0 comments
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked

Comments

@lidel
Copy link
Member

lidel commented May 6, 2019

This issue is extracted from #19 where @achingbrain simplified code by delegating sharding support to ipfs.files.stat

Context

Problem

  • HAMT fix from feat: load files/dirs from hamt shards #19 is using ipfs.files.stat, which does not support /ipns/ paths atm.
    • ipfs files stat in go-ipfs also does not support them, so it is not a bug, just the way API works right now :)

Fix

If we reuse ipfs.files.stat for HAMT support in ipfs-http-response, and want to support IPNS as well, then js-ipfs-http-response resolver needs to convert /ipns/ paths to immutable /ipfs/ before passing them to ipfs.files.stat

Note: DNSLink-aware ipfs.name.resolve(path, {recursive: true}) is being added in ipfs/js-ipfs#2002, so this issue needs to wait for that to land first.

Rationale

Why do the IPNS resolve in ipfs-http-response and not in code using the lib?

  • "batteries included", support /ipfs/ and /ipns/
  • code deduplication between js-ipfs and other apps that use js-ipfs-http-response
  • js-ipfs-http-response is responsible for rendering directory listing, and we want to be aware of both mutable and immutable pointer when creating the listing to display both
@vasco-santos vasco-santos added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue status/ready Ready to be worked labels May 7, 2019
lidel added a commit to ipfs/ipfs-companion that referenced this issue May 8, 2019
tl;dr opening /ipns/tr.wikipedia-on-ipfs.org/wiki/Mars.html works

Switched to js-ipfs with cherry-picked changes from:
ipfs/js-ipfs#2020
ipfs/js-ipfs#1989
ipfs/js-ipfs#2002
ipfs/js-ipfs-http-response#22
ipfs-inactive/js-ipfs-mfs#48
alanshaw pushed a commit to ipfs/js-ipfs that referenced this issue Jul 4, 2019
> Part of an effort to run embedded js-ipfs in Brave 🦁 ipfs/ipfs-companion#716
> Fixes #1918 

This PR will add support for `/ipns/` paths at HTTP Gateway.
Smoke test: [/ipns/tr.wikipedia-on-ipfs.org](http://127.0.0.1:9090/ipns/tr.wikipedia-on-ipfs.org/wiki/Anasayfa.html) (IPNS+DNSLink+HAMT-sharded website)
 
This PR depends on the following merged PRs:

  - Gateway Improvements from #1989
    (after merging #1989 I will rebase this PR, which will remove first two commits)
  - PeerID 
    eg. `/ipns/<PeerId-as-multihash-b58>`
    - requires #2002 to land first
  - `/ipns/<libp2p-key-in-cidv1>` 
    - requires multiformats/js-multicodec#45
  - DNSLink 
    eg. `/ipns/<fqdn>/path/file` like `/ipns/docs.ipfs.io/assets/logo.svg`
    - requires #2002 to land first
  - HAMT shard support 
    eg. `/ipns/tr.wikipedia-on-ipfs.org/wiki/Anasayfa.html` (`wiki` is a sharded directory)
    - requires ipfs/js-ipfs-http-response#22 and ipfs-inactive/js-ipfs-mfs#48  to land first
  - Tests for `/ipns/` 

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
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

2 participants