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

feature: Support for multiple endpoints by chainID #73

Closed
lucasmenendez opened this issue Sep 6, 2023 · 0 comments · Fixed by #189
Closed

feature: Support for multiple endpoints by chainID #73

lucasmenendez opened this issue Sep 6, 2023 · 0 comments · Fixed by #189
Assignees
Labels
enhancement New feature or request

Comments

@lucasmenendez
Copy link
Collaborator

With the current logic of multiple web3 providers support, if there is a web3 providers on the same chain declared twice, the last one will be the only stored.

A potential new feature that we might add in the future is to have a pool of web3 providers that automatically connect to the next if the current fail. You might take some ideas or code from the old ethservice queue we had when the Oracle was connecting to Ethereum (https://github.com/vocdoni/vocdoni-node/blob/release-azeno/service/ethevents.go#L109) and (https://github.com/vocdoni/vocdoni-node/blob/release-azeno/ethereum/handler/ethereumHandler.go#L90).

In any case, this is probably out of scope on this PR. However, we might start thinking about it; thus providers might be a map [chainID] -> Web3ProviderHandler

Where Web3ProviderHandle has a list of methods, such as:

ChainID() int64
AddProvider(string)
NextProvider() ethClient
GetProvider() ethClient
String() string

The web3ProvidersHandler could make the Connect and check if the RPC endpoint actually works and is synced before returning it.

[TBD]

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

Successfully merging a pull request may close this issue.

1 participant