-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add support for ipns name resolve /ipns/<fqdn> #2002
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid the default behavior of go-ipfs changed since we discussed this last time:
https://blog.ipfs.io/83-go-ipfs-0-4-20/#changed-ipfs-resolve-ipfs-dns-ipfs-name-resolve
I believe we should switch behavior in this PR to be recursive by default, to align with go-ipfs 0.4.20 while we are at it.
Below is a summary of edge cases (:anger: indicates discrepancy on our end) when we have more than one level of dnslink (eg. ipfs.io → website.ipfs.io → /ipfs/
)
raw hostnames
-
name resolve ipfs.io
(recursive by default)- go-ipfs 0.4.20:
/ipfs/QmeA4pdfRMq1ABThuTYTRgHzCu8xthuoUeK6DsRMMqj33b
- this PR:
/ipns/website.ipfs.io
💢
- go-ipfs 0.4.20:
-
name resolve ipfs.io --recursive=true
- go-ipfs 0.4.20:
/ipfs/QmeA4pdfRMq1ABThuTYTRgHzCu8xthuoUeK6DsRMMqj33b
- this PR:
/ipns/website.ipfs.io
💢
- go-ipfs 0.4.20:
-
name resolve ipfs.io --recursive=false
- go-ipfs 0.4.20:
/ipns/website.ipfs.io
- this PR:
/ipns/website.ipfs.io
- go-ipfs 0.4.20:
IPNS paths
-
name resolve /ipns/ipfs.io/images/ipfs-logo.svg
(recursive by default)- go-ipfs 0.4.20:
/ipfs/QmeA4pdfRMq1ABThuTYTRgHzCu8xthuoUeK6DsRMMqj33b/images/ipfs-logo.svg
- this PR:
/ipns/website.ipfs.io
💢
- go-ipfs 0.4.20:
-
name resolve /ipns/ipfs.io/images/ipfs-logo.svg --recursive=true
- go-ipfs 0.4.20:
/ipfs/QmeA4pdfRMq1ABThuTYTRgHzCu8xthuoUeK6DsRMMqj33b/images/ipfs-logo.svg
- this PR:
/ipns/website.ipfs.io
💢
- go-ipfs 0.4.20:
-
name resolve /ipns/ipfs.io/images/ipfs-logo.svg --recursive=false
- go-ipfs 0.4.20:
/ipns/website.ipfs.io/images/ipfs-logo.svg
- this PR:
/ipns/website.ipfs.io
💢
- go-ipfs 0.4.20:
We can't right now I already opened an issue about it (#2001), it breaks name pubsub. I want to merge this and then fix that. |
@hugomrdias ack on not making it recursive by default in this PR, but unless I am missing some context, |
314c70a
to
4b70dc6
Compare
@lidel i can only reproduce this one name resolve /ipns/ipfs.io/images/ipfs-logo.svg --recursive=false go-ipfs 0.4.20: /ipns/website.ipfs.io/images/ipfs-logo.svg all the others work as go does. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hugomrdias I retested after rebase and you are right, that is the only discrepancy left (apart from switching the default, which is tracked in #2001)
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 <[email protected]>
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 <[email protected]>
@hugomrdias does this supercede #1970? |
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
yes for ipfs name resolve, i will handle ipfs resolve in another PR |
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 <[email protected]>
`ipns name resolve` dns tests moved to interface-core resolve call now return a string as per documention
enables ipns tests in the browser normalizes interface tests over core with interface tests over http-client using http api
ef824d3
to
c88fced
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many tests have been removed?
expect(res).to.satisfy(checkAll([cidAdded])) // value propagated to node B | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for this test being removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core has tests that do mostly the same thing, i discussed this with vasco and we decided to remove this.
has we already discussed this PR tries to keep all tests in interface-core or core and cli tests only test cli behaviour. |
I think that’s the right way, but we need to make sure we have the same coverage as we did before (and preferably more) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the coverage drop is false and because of this issue #2202
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 <[email protected]>
> 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 <[email protected]>
fixes: #1918
needs: