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

Replace http-json gateway with grpc-web #151

Open
avive opened this issue Jun 21, 2021 · 1 comment
Open

Replace http-json gateway with grpc-web #151

avive opened this issue Jun 21, 2021 · 1 comment
Labels

Comments

@avive
Copy link
Contributor

avive commented Jun 21, 2021

Motivation

While grpc is great and modern clients such as https://github.com/grpc/grpc-web support server-side streaming, if we plan to support the json-http gateway then it should be complete and support steaming and not just queries. Currently, the json-http code only support queries.

Changes

  • Update the json-http code to support server-side streaming methods
  • Add integration tests to all json-http server-side streaming methods in go-spacemesh
@avive avive added the enhancement New feature or request label Jun 21, 2021
@avive
Copy link
Contributor Author

avive commented Jul 27, 2021

I think we should phase out the json-http api gateway altogether for the next major release of the API (version 2.0 for Spacemesh node 0.3).

Light clients (which don't have a good GRPC client lib) can just use grpc-web and public spacemesh API endpoints can choose to add grpc-web support at runtime via an Envoy Proxy or at compile time by compiling the grpc server in the node to support grpc-web (some grpc server libs provide this functionality today. See: https://github.com/improbable-eng/grpc-web)

So, once grpc-web is supported by the server, http/1.1 clients that can't open a socket (such as browser clients) can easily consume the api. I think that the grpc ecosystem is moving to this direction and away from http-json gateways and we should adopt this strategy.

@avive avive added feature and removed enhancement New feature or request labels Jul 28, 2021
@avive avive changed the title Support server-side streaming in json-http api Replace http-json gateway with grpc-web Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant