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

Compile protobuf messages to multiple languages #705

Closed
egaxhaj opened this issue Dec 17, 2021 · 3 comments
Closed

Compile protobuf messages to multiple languages #705

egaxhaj opened this issue Dec 17, 2021 · 3 comments

Comments

@egaxhaj
Copy link

egaxhaj commented Dec 17, 2021

Summary

Add a build script to generate .proto files into multiple language libraries. Build script can be executed through GitHub actions on each release tag and integrated to publish packages on repositories like maven, npm, etc.

Problem Definition

Currently client developers are required to compile proto files into generated code into the language of their preference. This can be a cumbersome process for developers unfamiliar with the Protobuf code generation tools into different languages.

An easy way to reduce overhead on clients is to add a build script to take care of the code generation and publishing for common languages.

Proposal

Use Github actions to generate and publish different language packages on release tags. Github packages can be used to allow for publishing of packages.

The script should compile generated code into supported common languages:

  • Java
  • Kotlin
  • JS
  • python
  • etc.

The generated libraries should be published in public repositories so client developers can easily reference them as dependencies in their projects. There are PRs in place for Provenance.io and Cosmos to do this. It would be nice to add the same feature for wasmd.

@ethanfrey
Copy link
Member

I hesitate on this a lot.

As we have seen often with the rust, go, and js builds (which do exist) auto-generated code usually needs some flags/tuning for the particular client it will be embedded in, not just the language.

We have the go bindings here, and js bindings integrated with cosmjs are in cosmjs-types.

Is there a particular client lib you want embedded? The acceptance criteria for "works in all languages" is too vague. I would rather a concrete ask we can consider.

@ethanfrey
Copy link
Member

I highly doubt the auto-generated code in Cosmos sdk will be useful for either the existing js client or the existing rust client

@alpe
Copy link
Contributor

alpe commented Dec 20, 2021

I do understand the motivation to have client code in one place and tight to the server version but this goes against loose coupling in system design and can easily become an unmaintainable epic. Instead the protobuf files define the api and abstraction layer that any client developer can use to build their own implementation.
Go client files though are an exception to this practice as we ship a demo server and CLI within this project. This became a "standard" for cosmos modules and makes the integration easier.

For JS for example cosmjs provides tools and additional helper packages to support client development in a much wider variate.
If your favourite language is not supported by a client project, yet then then our discord server may be a good place to start an initiative and find some peers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants