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

Handle multiple network endpoints and choose a healthy one with offchain indexing enabled #1693

Merged
merged 16 commits into from
Jul 16, 2024

Conversation

clangenb
Copy link
Member

@clangenb clangenb commented Jul 16, 2024

As opposed to #1603, I did not introduce a connectivity store here. The current approach is quite simple in handling multiple endpoints and could easily be integrated in the current state of the app, otherwise we need more refactoring. Hence, I think that #1603 can still be closed until we realize that we need a more sophisticated solution. Closes #1603.

Changes:

  • Introduces generic EndpointManager that has a list of endpoints and is generic over a mixin that checks the healthiness of the endpoints. With this, we can easily re-use the EndpointManager to handle multiple endpoints for ipfs and feed too.
  • Upon app startup, we connect to a random endpoint of the hard-coded set if it is healthy - where healthy means that it is online and has offchain-indexing enabled (I had to realize that dwellir does not have offchain indexing enabled). Once our nodes are updated to polkadot-v1.14.0, we easily integrate this healthcheck too.
  • During app operation, we regularly poll if the endpoint is still reachable and will reconnect to another if the connection is lost.

Future work:

Tests

  • Tested locally that the integration tests work

@clangenb clangenb added A2-technical PR introduces technical changes B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes labels Jul 16, 2024
@clangenb clangenb merged commit 68ad019 into master Jul 16, 2024
6 of 10 checks passed
@clangenb clangenb deleted the cl/connectivity-store branch July 22, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-technical PR introduces technical changes B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use connectivity store to manage connections to endpoints
1 participant