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

Implemented multinet support #119

Merged
merged 3 commits into from Oct 31, 2019
Merged

Implemented multinet support #119

merged 3 commits into from Oct 31, 2019

Conversation

@frol
Copy link
Member

frol commented Oct 31, 2019

Resolves #110

I had to refactor the API helpers and introduce more configuration options via environment variables on both the frontend and the backend sides. The routing is done by having different domain names (explorer.nearprotocol.com, explorer.staging.nearprotocol.com, ...) matched to the relevant near networks (specifically, RPC endpoints). Ultimately, a single frontend server instance and a single WAMP router instance handle all networks, but I have chosen to run backend servers independently for each network (yet, they are deployed into a single Docker container on Render.com, since there are enough resources to handle all those, and it is easier to maintain).

@deacix This PR introduces breaking changes in frontend/src/libraries/explorer-wamp. You should be good to go with a simple change like this:

import * as BlocksApi from ...;

const blocks = await BlocksApi.searchBlocks(...);

into

import BlocksApi from ...;

const blocks = await new BlocksApi().searchBlocks(...);

I wrapped the standalone methods into classes to handle multinet on the server side.

Let me know if you need any assistance.

/cc @kcole16

@nearprotocol nearprotocol deleted a comment from render bot Oct 31, 2019
@render

This comment has been minimized.

Copy link

render bot commented Oct 31, 2019

@render

This comment has been minimized.

Copy link

render bot commented Oct 31, 2019

@frol

This comment has been minimized.

Copy link
Member Author

frol commented Oct 31, 2019

Unit tests and e2e tests pass locally. Unit tests pass on CI, but e2e fail due to the fact that the multinet support on the backend is not deployed (included in this PR). We should come up with a strategy to run e2e tests against the local backend.

@frol frol merged commit f6e22c0 into master Oct 31, 2019
1 check passed
1 check passed
Frontend e2e testing (ubuntu-18.04, 10)
Details
@frol frol deleted the feature/multinet branch Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.