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

getinfo JSON-RPC method #3142

Closed
Tracked by #3134
mpguerra opened this issue Dec 3, 2021 · 4 comments · Fixed by #3660
Closed
Tracked by #3134

getinfo JSON-RPC method #3142

mpguerra opened this issue Dec 3, 2021 · 4 comments · Fixed by #3660
Assignees
Labels
lightwalletd any work associated with lightwalletd

Comments

@mpguerra
Copy link
Contributor

mpguerra commented Dec 3, 2021

Motivation

lightwalletd uses the getinfo JSON-RPC method.

Required Fields

The method is documented here: https://zcash.github.io/rpc/getinfo.html

But only the following fields are used by lightwalletd: https://github.com/zcash/lightwalletd/blob/master/common/common.go#L91

Field list:

{
  "build": xxxxx,           (string) `zcashd`'s CLIENT_BUILD
  "subversion": xxxxx,   (string) Subversion as sent to the P2P network in `version` messages - `zcashd`'s CLIENT_NAME, CLIENT_VERSION, uacomments
}

Tasks

  • Implement the RPC method
    • build: app_version()
    • subversion: USER_AGENT
  • Add RPC acceptance tests to CI
  • Test that the RPC method works with lightwalletd

API Reference

We plan to use jsonrpc_core with:

Example Code

Here are examples of:

@teor2345 teor2345 changed the title Create a dummy JSON-RPC method getinfo JSON-RPC method Dec 6, 2021
@ftm1000 ftm1000 added the S-needs-triage Status: A bug report needs triage label Feb 10, 2022
@ftm1000
Copy link

ftm1000 commented Feb 10, 2022

@ftm1000 ftm1000 removed the S-needs-triage Status: A bug report needs triage label Feb 16, 2022
@oxarbitrage oxarbitrage self-assigned this Feb 24, 2022
@oxarbitrage
Copy link
Contributor

I think it will make sense to put the app_version() function we need (currently in zebrad) in the new crate zebra-node-services of #3626

So this is partially blocked by that, however the PR that creates the crate should be merged soon and some work can be advanced without it so i will not tag this as blocked.

@teor2345
Copy link
Contributor

I think it will make sense to put the app_version() function we need (currently in zebrad) in the new crate zebra-node-services of #3626

app_version() returns the version of the zebrad cargo package or git, so it can't be moved to another crate. (The other crate's version could be different.)

We could pass app_version().to_string() to RpcServer::spawn, and store the string in RpcServer?

@oxarbitrage
Copy link
Contributor

Oh, I did not think on that, thanks!

We could pass app_version().to_string() to RpcServer::spawn, and store the string in RpcServer?

Yea, i think this is doable. Thanks again.

@mergify mergify bot closed this as completed in #3660 Mar 1, 2022
@ftm1000 ftm1000 added the lightwalletd any work associated with lightwalletd label Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lightwalletd any work associated with lightwalletd
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants