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

Generate clients #620

Open
moul opened this issue Mar 20, 2023 · 2 comments
Open

Generate clients #620

moul opened this issue Mar 20, 2023 · 2 comments
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 🌱 feature New update to Gno

Comments

@moul
Copy link
Member

moul commented Mar 20, 2023

  1. We can generate RPC clients that will implement Tendermint2 verbs + AddPKG, and Call.
  2. We can generate either dynamically or statically per-contract clients. This tool can rely on the Internet to query the existing vm/qfuncs helper.

In conclusion, we can either use 1. and be done, or use 2. to call 1. without worrying about marshalling and enjoy a fully type-safe experience with code completion, etc.


When considering the "how" of our approach, it is best to aim for an amino-only solution in order to provide the best features and reduce dependencies. However, we can still offer protobuf files to our users, especially if they are generated from Amino. Alternatively, we can create custom generators to generate intermediary standards, allowing users to reuse existing tools and providing the option for deeper integration and custom solutions.

I'm investigating the possibility of creating a custom r/gnolang/blog client without using codegen with a custom gnokey client available at gnolang/blog#9.


cc @ilgooz, what's your opinion and expected future needs?

@moul
Copy link
Member Author

moul commented Jun 7, 2023

Here are the notes from our previous discussion, summarized:

  • Regarding SDKs understanding contracts, we can extend vm/qfuncs or create a new call to generate a rich type. This type can be used by tools to generate SDKs or enhance contract understanding for chain clients (incl. logos: [misc/logos] context & next steps #454) and wallets.
  • Possible explorations include:
    • Generating amino.TypeInfo.
    • Utilizing cuelang (cc @tbruyelle).
    • Creating a protobuf definition.
    • Generating go typedef/typedecl.
  • This work can be potentially merged with @thehowl's effort on rfc: gno doc command #522.

@ajnavarro ajnavarro added 🌱 feature New update to Gno 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Jun 8, 2023
@tbruyelle
Copy link
Contributor

About cuelang, unfortunately the code generation part hasn't evolved as expected since the last time I used it (a couple of years ago though). It's still a very good langage for data definition and validation, but it still lacks the ability to generate the code from it, it's still marked as TODO in their documentation.

Because of that, it also doesn't expose a service keyword like in protobuf, to define the RPC interface.

In conclusion, I no longer think it's a good fit for our need...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 🌱 feature New update to Gno
Projects
Status: 🔵 Not Needed for Launch
Development

No branches or pull requests

3 participants