cli
cli copied to clipboard
config.yml: enable gRPC code generation
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.
@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?
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.
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.
Issue is now out of scope and addressed, closing. Please reopen if otherwise.