-
Notifications
You must be signed in to change notification settings - Fork 29
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
IPLD support on Gateways #182
Comments
Enthusiasm for CARv2 over DAR seems thin. cc @mikeal @rvagg |
No, just enthusiasm over messing with CAR at this stage is a little thin, but none of that discussion should be considered a blocker, there's no gatekeepers on this. Maybe the experimental work on Lotus integration for either CARBS or DAR will help resolve this a little? If it turns out DAR unlocks value over there then maybe we double-down, make it a CARv2, write a spec and create an upgrade path where it matters. Either way though, there will have to be an upgrade path so integration in to our suite of libraries will be important and gateway export could use either (or CAR now and CARv2 later). Re response types and the discussion in ipfs/kubo#8037, it would be really unfortunate to reinforce the JSON format that go-ipfs has relied on today over the more formal DAG-JSON form. Now that it's easier to interact with go-ipld-prime in go-ipfs, that will hopefully be unlocked? Being able to pass a |
|
@lidel from the description I do not really understand what the default content type is expected to be when navigating to e.g. https://ipfs.io/ipfs/bafyreiahmfp4l6ii7h4ceumxdpaxwss5dldbevuvftjokcm6tx26gtgriy Right now it's 404 with response body: I would argue that default should be along the lines of what is displayed by As it would provide a much better experience in navigating non unixfs dags. Explorer view could be further improved to show file listing when links are dag-pb. I think this still aligns with making gateway usable, as we I think having such a view would also help us make a future case for encoding NFT as IPLD Dags that have IPLD links to all the assets as opposed to json file that happens to have ipfs:// style links to assets. |
@Gozala Yes, it was unclear because we are trying to figure it out. I think you have a valid point: we already provide a basic GUI for directory listings, we should replace/improve it with something that works with non-dag-pb nodes. Anyway, we should not wait with CBOR support until we have UI like that. Let's return informative error to retry the request with explicit content type, as suggested in ipfs/kubo#8037 (comment) This enables us to add GUI in the future, without breaking anything that people build on top of CBOR-as-JSON responses. |
I would like that and I would have said yes, but I was already told too put all the proposals related work on the side, so I'm afraid I can't responsibly take this unless some resource relocation takes place. |
shouldn't the logic happen in the http request header:
where cid is : inspects the multicodec, which is should return:
Then the browser, if it understands Following on this, therefore the if the request header was different:
even though the cid is dag-cbor, the request want application/json explicitly. Also doing this in the parameter
|
This is very misleading. IPFS supports unixfs (files) over the gateway, speaking of this in terms of IPLD codecs makes no sense (I can't, e.g., get a raw dag-pb node, etc.).
What about the read-only API?
We do? Why? I'd love a feature like this. I just want to make sure we're all on the same page about what "this" is, why we care about "this", etc.
|
Created ipfs/kubo#8234 with initial design proposal for |
|
Would it make sense to have a |
Good question! Whatever happens on gateways, the aim is to have it work with "native" schemes too. To reduce implementation overhead across ecosystem, we have the same abstraction on The In case of writable gateways, what we could implement is |
Oh, now that would be interesting! |
Let's make 'ipld:' a thing! |
I am open to making it happen, but the main question we will hit with bigger vendors and developers will be: what is the difference between Right now, the story is clear:
What do we gain by introducing a second immutable namespace? |
I was thinking E.g., doing a Also potential for using the new IPLD patch spec for Some stuff that might be IPLD specific is stuff like Schemas, the different DAG traversal syntaxes and stuff like that. At the moment it's a lot harder to do this fancy stuff with IPLD, and putting it into Might be cool to brainstorm something more concrete if three's interest. 😁 |
Started putting together a PR here: ipfs/specs#293 Comments on current direction would be very much appreciated. Note that a lot of this is based on stuff from this initial exploration report: https://github.com/ipld/ipld/blob/e6cfab631d2bd24bf158d3a85e126514c98de5ce/notebook/exploration-reports/2022.03-ipld-url-scheme.md#future-work |
Current state
Gateway provided by go-ipfs 0.8.0 supports only
dag-pb
(unixfsv1) andraw
(raw block used for leaves) codecs.Requesting any other IPLD type over a gateway fails.
Where we want to be
It should be possible to download everything over Gateway:
ipfs dag import <dag-archive>
it to own node.dag-cbor
)Low-hanging fruit: traversable JSON/CBOR documents
Some ideas how to maximize the utility of gateways (those are just prompt for discussion, details TBD):
dag-cbor
anddag-json
are returned as a valid JSON response withContent-type: application/json
orapplication/cbor
Ongoing work
Open questions
dag-cbor
? User will be able to choose, but what happens when there is no user preference? (Original binary or should Gateway return JSON as its more user friendly and makes onboarding easier?)dag-cbor
by default make it work out-of-the-box in browser after copying and pasting the CID, which makes our stack "feel" approachable and easy to understand. This is huge for onboarding new users (devs)./ipfs/{dag-cbor-cid}?keys=image,name
)? (This is separate from traversing CID tags in CBOR)Any reason to not do this? Does this clash conceptually with planned support for selectors?
--enc=json
on CLI,?enc=json
is short and easy to add by hand to URL - trivial important for dx/uxname
from multicodec/table.csv?codec=
or?format=
may be better than?enc=
(are they?)cc @warpfork @alanshaw @Stebalien @aschmahmann
The text was updated successfully, but these errors were encountered: