Closed Demi-Marie closed 2 years ago
Currently, all client implementations are written by hand. This works, but is very tedious and won’t scale to large runtimes.
If I want send a pallet method transaction, How can I accomplish this.
I've been working on subxt-gen to do exactly this, but it's still very much a work-in-progress (constructed from parts of subsee and substrate-subxt/proc-macro). @ascjones would you be interested in integrating this upstream (alongside proc-macro
)? My goal is to provide a builder similar to how tonic uses prost for generating code from protobuf so that a client library only needs to download the encoded metadata.
Yes indeed @gregdhill, that has always been the long term goal, the main issue being the lack of rich type metadata. However I am making steady progress on that front, I have just been able to produce v13
metadata for the whole substrate node-runtime
(calls and events only for now). See https://github.com/paritytech/substrate/discussions/8370#discussioncomment-547988.
Some work I have done a long time ago on consuming that metadata and generating types can be found here https://github.com/ascjones/chameleon. It's purely proof of concept atm but could eventually be used as part of the API generation from the metadata.
Currently, all client implementations are written by hand. This works, but is very tedious and won’t scale to large runtimes.
A better option is to generate the client. This is already done by the TypeScript client implementation, so it should be quite doable for the Rust one.