Skip to content
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

Support a fallback endpoint URL #735

Closed
artob opened this issue Nov 24, 2021 · 2 comments
Closed

Support a fallback endpoint URL #735

artob opened this issue Nov 24, 2021 · 2 comments
Labels
enhancement New feature or request low-hanging-fruit

Comments

@artob
Copy link

artob commented Nov 24, 2021

Is your feature request related to a problem? Please describe.
When partial outages occur as during the past few weeks, dapps built on NEAR stop functioning due to only attempting to connect to a single endpoint URL, which may be unreachable and/or unresponsive.

Describe the solution you'd like
In addition to config.nodeUrl (a string), add support for config.nodeUrls (an array of strings). This way multiple node URLs can be configured, with the primary (first) URL used by default and the others as fallbacks in case the primary is unreachable or unresponsive.

Describe alternatives you've considered
While it's certainly possible to do all this on the user level, by catching errors and then creating a new connection to another endpoint URL, that would be complex and buggy, and that would interact badly with the retry logic inside near-api-js. It's best to provide this facility in near-api-js, hence making all NEAR dapps more robust.

Additional context
As discussed in the post-mortem incident review today, this would have alleviated the troubles during the past several weeks.

@artob artob added enhancement New feature or request low-hanging-fruit labels Nov 24, 2021
@sept-en
Copy link

sept-en commented Nov 24, 2021

This could be especially useful for apps that use their own endpoints but can set a fallback one in case of some maintenance, etc. And this also would help with the decentralization of endpoints.

@volovyks
Copy link
Collaborator

Thank you for the suggestion @artob . Let's continue discussing here: #733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low-hanging-fruit
Projects
None yet
Development

No branches or pull requests

3 participants