-
Notifications
You must be signed in to change notification settings - Fork 747
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
feat: add fallback nodes to provider #980
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Maybe we can keep nodeUrl, and pass param, if it is singular it would be non-fallback and, if it is an array it would have fallbacks. The logical order would be 0 then 1 ... if there are fallbacks. In that case, it would be the same as before.
- I would rather add setNode and getNode on the channel than pre-pending fetch.
This way you intentionally change channel source rather than hacking into one method.
My initial idea for this was to dedicate to one and switch to the next when it fails, this solution proposes to use all nodes per request without dedication. This seems like an interesting idea and it could also work.
I thought of the same approach as you said here, I think Ethers works like this, but I have to double check. |
response = await this.fetch(nodes[i], method, params); | ||
|
||
if (response.ok) { | ||
this.setPrimaryNode(nodes[i], i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand why we need this primaryNode here
Another option is to create n channels for each provider |
TODO: I would like to refactor this approach and will do on the same PR |
Motivation and Resolution
Resolves #872
RPC version (if applicable)
Usage related changes
Development related changes
Checklist: