-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get some info about UnixFS objects on public IPFS HTTP API #8528
Comments
I understand you want to build something future-proof, and robust. The long term direction is that we will be removing Detecting a directory today (go-ipfs 0.10)If you want to implement something against how go-ipfs gateways are today, your best option to detect a directory is sending HTTP FutureIn the future, in addition to the Etag way, we most likely will have We are already tracking Feature scopeMVP is to make it possible to send request to
|
Related proposal: add Ipfs-DagSize and Ipfs-DataSize to gateway responses. |
Checklist
Description
I am implementing a backend to access IPFS via the Python library fsspec at ipfsspec. To do so (and to save me from implementing the IPFS protocol in Python), the plan is to access UnixFS files and directories on IPFS via a HTTP gateway. An
fsspec
backend needs to implement a functioninfo(path)
which must returnTo me, this seems to be a reasonable requirement for other generic filesystem abstractions as well, thus I assume that this feature request could be of broader interest.
While the
/v0/files/stat
provides this kind of information, this endpoint is often not reachable on public gateways.Another option to obtain this information is to perform a
HEAD
request towardshttp://gateway/ipfs/CID
, which in case of a file provides the size in thecontent-length
header and which (seemingly) lets me discriminate between file and directory using theetag
header. This method works on some public gateways, but scares me as well, as this doesn't seem to be the right use of observable API features.I see three possible ways to obtain the desired functionality:
files/stat
API to public gateway port (could this beGET
as well?)/ipfs/CID
is requestedTagging @whyrusleeping as I've been talking to him about this already on slack.
The text was updated successfully, but these errors were encountered: