-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add gRPC querier client generator #14
Comments
Regarding this @jhernandezb. I have some code, that I haven't pushed yet which basically does this for queries. It uses gRPC directly instead of grpc-web. I am curious why you are using http and if pure gRPC would be ok? Do you only need this for queries or also txs? Asking because queries are much easier to implement than txs because txs need to have wallet/key management. |
We use it mostly for querying added to our graphql so not really an issue if there is no tx support, the reason for using grpc-web or lcd/rest as some folks call it is that public endpoints for grpc are less common. Although we do have our own endpoints there is some cases where we query other chains public rpcs. |
Will address this in the |
Amazing thank you! looking forward to try this |
@jhernandezb, you can try it out now using this commit https://github.com/srdtrk/go-codegen/tree/e35b998da54333320fac5aa94ec4526217ec0de3 and give feedback before it's merged to main and released. Some commands have been reorganized, so you might want to get help using |
Have an issue trying to generate the client not sure if I'm doing it correctly # success
go-codegen generate messages cosmwasm/schemas/ics721/ics721.json -p ics721 -o cosmwasm/ics721/types.go
# fails
go-codegen generate query-client cosmwasm/schemas/ics721/ics721.json -p ics721 -o cosmwasm/ics721/client.go
panic: cannot determine the type of cw721_admin
goroutine 1 [running]:
github.com/srdtrk/go-codegen/pkg/codegen.getResponseName({0x14000011ee0?, 0x14000011a50?}, 0x1400064a5a0)
/Users/jhernandez/go/pkg/mod/github.com/srdtrk/go-codegen@v0.1.4-0.20240511173950-44677b08acf8/pkg/codegen/querier.go:203 +0x188
github.com/srdtrk/go-codegen/pkg/codegen.generateQueryInterfaceFunc({0x14000011a50, 0x8}, {0x14000011ee0, 0xb}, 0x1400064a5a0)
/Users/jhernandez/go/pkg/mod/github.com/srdtrk/go-codegen@v0.1.4-0.20240511173950-44677b08acf8/pkg/codegen/querier.go:135 +0x8c
github.com/srdtrk/go-codegen/pkg/codegen.GenerateQueryClient(0x1400014c370, 0x14000629260, 0x6?)
/Users/jhernandez/go/pkg/mod/github.com/srdtrk/go-codegen@v0.1.4-0.20240511173950-44677b08acf8/pkg/codegen/querier.go:63 +0xfc
github.com/srdtrk/go-codegen/pkg/codegen.GenerateQueryClientFromIDLSchema({0x16b5eb341?, 0x104d02a64?}, {0x16b5eb372, 0x19}, {0x16b5eb368, 0x6})
/Users/jhernandez/go/pkg/mod/github.com/srdtrk/go-codegen@v0.1.4-0.20240511173950-44677b08acf8/pkg/codegen/querier.go:46 +0x240
github.com/srdtrk/go-codegen/cmd.genQueryCliCmd.func1(0x14000023208, {0x140000aa410, 0x4?, 0x104d00d4a?})
/Users/jhernandez/go/pkg/mod/github.com/srdtrk/go-codegen@v0.1.4-0.20240511173950-44677b08acf8/cmd/root_cmd.go:120 +0x90
github.com/spf13/cobra.(*Command).execute(0x14000023208, {0x140000aa3c0, 0x5, 0x5})
/Users/jhernandez/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x14000022608)
/Users/jhernandez/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(0x14000074738?)
/Users/jhernandez/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039 +0x1c
main.main()
/Users/jhernandez/go/pkg/mod/github.com/srdtrk/go-codegen@v0.1.4-0.20240511173950-44677b08acf8/main.go:12 +0x20 |
I made a fix. Thanks for pointing this out @jhernandezb, please try again with this commit https://github.com/srdtrk/go-codegen/tree/9b2a1a9452ffdf44b315f4d7bd517cc18727bd48 |
I'm closing this now as the PR has been merged to main. I will soon tag a release, please create a new issue if there is still a problem |
No description provided.
The text was updated successfully, but these errors were encountered: