-
Notifications
You must be signed in to change notification settings - Fork 324
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
Allow Web Pages to query companion for the best available node #1116
Comments
AFAIK this is incorrect: ipfs-companion uses https://www.npmjs.com/package/is-ipfs and will redirect every gateway URL that follows conventions described in https://docs.ipfs.tech/how-to/address-ipfs-on-web. If this is no longer happening, then we have a bug.
There is a lot prior art aorund this, happy to discuss in January when I am back, but for now quick brain-dump:
429 on a public gateway are something Companion can detect and recover from, but you need more than one Public Gateway to handle scenario when local gateway is absent and the default public gateway is down. Changing Public Gateway setting from being a single URL to a list of public gateways sounds like a sensible step. Long term, this problem will go away when we have native |
Thanks for the context, for some reason redirection was spotty when I posted the issue, I need to get to the root of this.
Absolutely, in fact the gateway checker list and tests could be leveraged for this purpose, we can use the top-N public gateways closest to the user for this. |
@whizzzkid bifrost has some open issues around 429 issues. I believe they've nailed most of them down now, but we should ensure that companion works properly if a gateway is throwing errors. Based on the convo so far, it sounds like this task has turned into the following action items:
Do any of these tasks remain valid in the long-term scenario where If not, do any of these tasks provide a decent QoL improvement with minimal dev-effort until then? |
We need to be very careful what we suggest to users as default or fallback. Public gateways are run by random people, and people who use public gateway for fetching already deserialized data delegate IPFS to a third-party that is other than Protocol Labs. (IPFS happens on remote server, and not your machine). Unless we are able to guarantee user is fetching data as raw block or CAR and verify it matches expected CID, we should not assist user in delegating trust to some random person on the internet.
I'd say no. Only verifiable response types are relevant for native If we want to invest time towards native |
@lidel we can defer this. This would require a portable version of the gateway checker. I'd say this is blocked till then. |
Is your feature request related to a problem? Please describe.
companion right now redirects requests based on regex for a select few domain. ipfs.io e.g. has been throwing 429 for me. So if a developer embeds cloudflare-ipfs.com companion does not redirect this request to local-node.
Describe the solution you'd like
There should be a mechanism where the page can request the best available local node and use that to make requests. Something like page <-> extension communication, metamask does something similar.
The text was updated successfully, but these errors were encountered: