-
Notifications
You must be signed in to change notification settings - Fork 382
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
feat: add gno.land/pkg/gnoclient (Gno.land Go client) #1047
Conversation
Signed-off-by: Manfred Touron <[email protected]>
c9dcdcd
to
0d235f0
Compare
The
On one extreme, the app developer must pass all this information to the |
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: Manfred Touron <[email protected]>
…fy if the password unlocks the account Signed-off-by: Jeff Thompson <[email protected]>
…Address, not string Signed-off-by: Jeff Thompson <[email protected]>
chore: gnoclient updates from gnomobile for PR gnolang#1047
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1047 +/- ##
===========================================
- Coverage 55.91% 28.91% -27.00%
===========================================
Files 431 352 -79
Lines 65680 56921 -8759
===========================================
- Hits 36722 16457 -20265
- Misses 26080 38928 +12848
+ Partials 2878 1536 -1342 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: gfanton <[email protected]>
Signed-off-by: gfanton <[email protected]>
Signed-off-by: Jeff Thompson <[email protected]>
fix: In gnoclient Render and QEval, need to check Response.Error
I believe we should merge this pull request and allow it to be iteratively improved over time. Reasons:
I believe @gfanton could assist me in maintaining this library over time. He has experience maintaining similar developer-oriented wrappers and creating well-designed, idiomatic APIs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great 💯
I find myself having to reimplement this logic in different tools, but it will be much easier going forward to switch to this.
I think this scope is fine for v1 of the client, considering we don't have a Go one currently. I would've loved more tests and functionality, but will leave that for a future PR :)
I've gone through some of the tools I've built over the last year, and found that there is a pattern for how the client is utilized:
- tx-archive client
- tx-indexer client (Notice the batch support)
- faucet client
The work I'm doing over at #1498 will enable users to pass in a WS client (as opposed to being limited to singular HTTP requests), so abstracting the RPC implementation was a good choice ✅
Signed-off-by: gfanton <[email protected]>
3302493
to
5f0290f
Compare
Signed-off-by: gfanton <[email protected]>
Signed-off-by: gfanton <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good for a first iteration 👍
## Description This PR adds the reference documentation to the newly added [gnoclient](#1047). The reference docs for gnoclient are mostly generated by using a godoc to markdown tool, with slight modifications. It also adds a how-to guide on how to connect to a Gno.land chain from Go. Along the way: - Adds index pages & minor doc improvements for `tm2-js` & `gno-js` - Updates godoc comments in client - Changes `gnoclient` function signatures to all be on the same type of receiver (all tests pass). I realize this could've been a different PR but its a small change with no functional/practical impact. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
This PR add a dedicated client library for interacting seamlessly with the Gno.land RPC API.
This library simplifies the process of querying or sending transactions to the Gno.land RPC API and interpreting the responses.
Closes #1324
Previous list of ideas
Note: Some content may be outdated. Please overlook for the moment, but we'll reassess at the conclusion of this PR to identify any current requirements.
./gno.land/pkg/gnoclient
package (Call, Send, AddPkg, Query, Eval, Package, File)./gno.land/cmd/gnoland/*_test.go
gnofaucet
,gnoweb
,gnoblog
, etc; so they use this new library instead of hardcoded manual clientstm2client
andgnovmclient
libs that this lib will depend on, but will probably do it later and start with a monolith libraryContributors' checklist...
BREAKING CHANGE: xxx
message was included in the description