This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: enable preload on MFS commands that accept IPFS paths #2355
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
fix: enable preload on MFS commands that accept IPFS paths
fixes #2335 License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
- Loading branch information
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
IIRC
/ipns
/ paths are not supported byfiles.stat
.That is why HTTP gateway resolves
/ipns/
→/ipfs/
before passing it tostat
:js-ipfs/src/http/gateway/resources/gateway.js
Lines 40 to 46 in 3cade67
That being said, is it possible
/ipns/
paths will be supported in the future, as suggested in ipfs/js-ipfs-http-response#22? If so, a future-proof check would be: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 think we'd also have to add the resolve step to this PR if we wanted to "future-proof" the check...right now it would end up sending Peer IDs to the preload nodes...
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.
No, preload call for
/ipns/
path will work fine. Check with:$ curl "https://node0.preload.ipfs.io/api/v0/refs?arg=/ipns/docs.ipfs.io&r=true"
Above is DNSLink, however I think preload of real IPNS (with peerid) will be actually beneficial by making the key available in more places.
IPNSsupport does not need to land/block this PR. Let's merge is asap.