-
-
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
$IPFS_PATH/gateway for user choice of preferred gateway #8847
Comments
This proposal makes a lot of sense to me, thanks! A couple questions/clarifications about some edge cases:
|
That should still be possible. It's a matter of config though. If the user on the client side doesn't define a gateway (aka, removes it from the config) then the file should stay however the user created it.
Yup :) See my reply above for the manual part. As for leaving artifacts files after IPFS crashes.. I don't know how to properly resolve that. The real fix would be to not crash ;) but yeah, there will undoubtedly be cases where the file exists and the gateway isn't running. |
I think the answer is: try to contact that gateway and, if it fails, fall back on something else. Basically, the "which gateway" function should return a ranked list of gateways to try. |
I have now implemented this logic in my ffmpeg patch. The order of precedence:
The If a change in this order is preferred, now is the time to respond :) While, in strict terms, this doesn't have an effect on IPFS yet. If this is included in ffmpeg it does mean that IPFS now has at least an "unwritten standard" for those environment variables. |
@markg85 would you be interested in opening a complimentary PR against go-ipfs to create
|
Hi @lidel, Yes, definitely! It's bit more challenging to me though as i know 0 about the whole go stack and the language (which looks weird to me). But it feels like a nice small manageable feature to get myself a little more comfortabele in Go. I'll post an update here when i start on that. In the meantime, i'm definitely not offended if anyone else wants to take it so please do be my guest. |
I just started working on this! Or rather, i'm diving into Go to figure out how that language works and use this small project as my example :) |
@markg85 hey, any chance you found time to poke at it, or is it ok for someone else to give it a try? I think adding it in this function will be a good start, we can refine it later. |
Actually, i prefer if someone else could give it a shot. That being said, i would really really love to have this in the next version of IPFS. |
Cool, I'll see if I can find some way to move it forward.
|
I might be able to handle the curl side of things. I did talk to @autonome about that. Now with those ffmpeg patches i did learn one very hard lesson. It's C and i really don't like C. He's "knocking on some doors" to find someone suitable to add it in curl. If he can't find anyone this month then i'm the backup and will handle it next month. Question though. You changed the title to include "agency"... Could you elaborate on the meaning? I can't figure out what you mean by that. |
Meant user being in control of which gateway is used :) |
This is tangentially related to ipfs/public-gateway-checker#192 & ipfs/public-gateway-checker#61. My below thoughts don't follow the above quote's lines of thought, but I wanted to bring up something this discussion made me think about. I'm not sure it makes sense to keep a list of Do folks have thoughts on how we could centralize our gateway list in a sane way that allows importing across languages? Does it make sense to store a curated list of "official" gateways on IPFS and reference with it's CID? That screams of cyclical dependency issues to me. |
Perhaps |
Since #9156 has been merged, should this issue be closed? |
Closing this one. I am right now turning this into an IPIP spec which you can follow here: ipfs/specs#280 It's possible gonna lead to a new change in IPFS to get things "according to spec" ;) |
Rationale
Currently IPFS doesn't expose any way to know if a gateway is running and what it's URL is. One could opt to use the IPFS API to figure this out but that's quickly rather complicated to implement properly. Providing a file indicating that a gateway is running where the content of the file is the gateway URL would be a simple portable way for applications to detect a running IPFS gateway.
Potential usecases
Implementation
gateway
is created. This file is created in$IPFS_PATH
. The resulting file will be$IPFS_PATH/gateway
gateway
file will behttp://localhost:8080
. The port section of this URL will follow whatever is provided in the IPFS config file underAddresses.Gateway
gateway
file is removed.Addresses.Gateway
setting is empty or missing from the config file then nogateway
file is created because no gateway should be started. This and only creating the file when the gateway starts should - more or less - guarantee that the file only exists if there is a gateway running.How other applications can use this
Assumption, they do need to assume where the IPFS folder is.
SIPFS_PATH
and use that if it exists. Otherwise they should assume~/.ipfs
. They can expect the gateway file to be in that folder. If the gateway file is there it means a local gateway is running.Open and unresolved issues
Code and testcases
Right now there is no code nor testcases. I am planning to make both and will post a message in this issue when i'm actually working on this. You can assume i'm not working on this as long as i haven't explicitly said so in this issue.
Thank you and mentions
Thanx goes out to @Stebalien and @TheDiscordian for the fruitful discussion we had about this!
The text was updated successfully, but these errors were encountered: