Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Resolving DNSLink Paths: /ipns/<fqdn> #1918

Closed
lidel opened this issue Mar 11, 2019 · 2 comments · Fixed by #2002 or #2020
Closed

Resolving DNSLink Paths: /ipns/<fqdn> #1918

lidel opened this issue Mar 11, 2019 · 2 comments · Fixed by #2002 or #2020
Assignees
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P1 High: Likely tackled by core team if no one steps up status/in-progress In progress

Comments

@lidel
Copy link
Member

lidel commented Mar 11, 2019

Part of an effort to run embedded js-ipfs in Brave 🦁 ipfs/ipfs-companion#716

  • Version: js-ipfs v0.34
  • Platform: browser
  • Subsystem: ipfs.resolve and ipfs.name.resolve

Type: Bug

Severity: Medium

Description:

js-ipfs v0.34 supports /ipns/<peerid>, but trying to resolve /ipns/<fqdn> produces errors (the error is different for each method).

Calling ipfs.dns('docs.ipfs.io').then(console.log) resolves DNSLink correctly, so I assume all pieces are in place and this is just a bug/missing some wiring – is this correct?

Is this on someones TODO or is it up for grabs?

Steps to reproduce the error:

  • ipfs.resolve('/ipns/docs.ipfs.io/assets/logo.svg', {recursive: true})

    • go-ipfs returns /ipfs/QmY7Yh4UquoXHLPFo2XbhXkhBvFoPwmQUSa92pxnxjQuPU
    • js-ipfs throws Error: resolve non-IPFS names is not implemented (from this line)
  • ipfs.name.resolve('/ipns/docs.ipfs.io/assets/logo.svg', {recursive: true})

    • go-ipfs returns /ipfs/QmYz85ubdabSrraMnodhMMosiHv9WURJASEC5D6ojTgm4X/assets/logo.svg
    • js-ipfs throws Error: Non-base58 character (from this line)
@alanshaw
Copy link
Member

Not really a bug, just not implemented yet...although ipfs.name.resolve is not handling it well!

@alanshaw alanshaw added exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue status/ready Ready to be worked P1 High: Likely tackled by core team if no one steps up labels Mar 12, 2019
lidel added a commit to ipfs/ipfs-companion that referenced this issue Mar 12, 2019
js-ipfs v0.34 does not support DNSLinks in ipfs*resolve methods:
ipfs/js-ipfs#1918

This temporary workaround detects known errors and falls back to
using path from DNSLink cache. It won't be as fresh as original,
but at least resolv will work.
@niinpatel
Copy link
Contributor

@alanshaw I'll take a look after #1935 is merged.

@hugomrdias hugomrdias mentioned this issue Apr 18, 2019
15 tasks
hugomrdias added a commit that referenced this issue Apr 18, 2019
hugomrdias added a commit that referenced this issue May 6, 2019
lidel added a commit to lidel/js-ipfs that referenced this issue May 6, 2019
It requires below to land first:
ipfs#1918

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
lidel pushed a commit to lidel/js-ipfs that referenced this issue May 6, 2019
@ghost ghost assigned lidel May 7, 2019
@ghost ghost added status/in-progress In progress and removed status/ready Ready to be worked labels May 7, 2019
hugomrdias added a commit that referenced this issue Jun 18, 2019
alanshaw pushed a commit that referenced this issue Jun 26, 2019
fixes: #1918

`ipns name resolve` dns tests moved to interface-core
resolve call now returns a string as per documention.
hugomrdias added a commit that referenced this issue Jun 27, 2019
alanshaw pushed a commit 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
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P1 High: Likely tackled by core team if no one steps up status/in-progress In progress
Projects
None yet
3 participants