cli icon indicating copy to clipboard operation
cli copied to clipboard

config.yml: enable gRPC code generation

Open ilgooz opened this issue 5 years ago • 3 comments

Since Stargate, we have sdk and apps using sdk exposing gRPC APIs. Proto files for these kept under the proto directories which resides at the root dir of projects.

In Starport's config.yml we can have a configuration section like below to enable client side code generation from these proto dirs.

grpc:
    client:
      - target: "go"
        dest: "client"
      - target: "js"
        dest: "vue/client"
        grpc_web: true

The configuration above will cause app command (during scaffolding) and serve command (on every change) to generate client code to the given dest directories.

ilgooz avatar Nov 13 '20 07:11 ilgooz

@Tosch110 I remember your cosmos-proto from the other day. :smiley: How do you feel about integrating this feature directly into Starport, any ideas to make it better?

ilgooz avatar Nov 13 '20 07:11 ilgooz

Ideally, the blockchain itself should have "reflective" properties. Instead of us generating client side JS statically during build, we should be able to query the blockchain node for proto files, perhaps, in JSON and dynamically generate UIs.

fadeev avatar Nov 13 '20 07:11 fadeev

There is also an issue of imported modules that we don't have proto files in our repo for. gaiad doesn't have any, but the generated UI should include gov, bank, etc.

fadeev avatar Nov 13 '20 07:11 fadeev

Issue is now out of scope and addressed, closing. Please reopen if otherwise.

salmad3 avatar Jan 17 '24 13:01 salmad3