GithubHelp home page GithubHelp logo

Support gRPC APIs about hypersdk HOT 1 OPEN

joshua-kim avatar joshua-kim commented on August 13, 2024
Support gRPC APIs

from hypersdk.

Comments (1)

richardpringle avatar richardpringle commented on August 13, 2024

We should in theory be able to support both json-rpc and grpc simultaneously.

@joshua-kim, when you were talking about getting rid of the controller, I was reminded of a pattern I had used in the past. It was for a wallet, but still.

We had multiple apis, one was effectively REST, then we added a grpc-api. We didn't want to stop supporting the REST API because it was difficult for that client to change their code (for reasons). Any new clients would have to use grpc (no more swagger docs or anything that we had to manually keep in sync). The "controller" was used to implement all the business logic to respond to the API request. Then we just had some glue code to take in the HTTP-params (validation, etc), and call the controller. Grpc was the same (but easier). We re-used the same validation code.

All that's to say, it would be best if the RPC layer was as decoupled as possible, such that HyperVM implementers could modify the API surface and protocols as they see fit.

Maybe that's not opinionated enough. though?

It's also possible to say that if you want a different kind of API, just run a sidecar that does the translation.

from hypersdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.