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

go/oasis-node/cmd: Add oasis-node stake account nonce CLI command #3559

Merged
merged 3 commits into from
Dec 9, 2020

Conversation

tjanez
Copy link
Member

@tjanez tjanez commented Dec 9, 2020

It can be used to get a staking account's current nonce.

@tjanez tjanez added the c:cli Category: command line interface label Dec 9, 2020
@codecov
Copy link

codecov bot commented Dec 9, 2020

Codecov Report

Merging #3559 (bdceea5) into master (c0f8364) will decrease coverage by 0.09%.
The diff coverage is 63.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3559      +/-   ##
==========================================
- Coverage   66.56%   66.46%   -0.10%     
==========================================
  Files         377      377              
  Lines       34273    34288      +15     
==========================================
- Hits        22813    22791      -22     
- Misses       8183     8189       +6     
- Partials     3277     3308      +31     
Impacted Files Coverage Δ
go/oasis-node/cmd/stake/account.go 56.93% <63.15%> (-0.29%) ⬇️
go/oasis-node/cmd/common/metrics/disk.go 65.38% <0.00%> (-19.24%) ⬇️
go/oasis-node/cmd/common/metrics/resource.go 78.94% <0.00%> (-10.53%) ⬇️
go/common/sgx/aesm/aesm.go 62.61% <0.00%> (-6.55%) ⬇️
go/worker/common/committee/runtime_host.go 65.04% <0.00%> (-4.86%) ⬇️
go/runtime/tagindexer/tagindexer.go 66.27% <0.00%> (-4.66%) ⬇️
go/storage/mkvs/lookup.go 72.04% <0.00%> (-4.31%) ⬇️
go/worker/keymanager/watcher.go 60.00% <0.00%> (-3.34%) ⬇️
go/storage/mkvs/iterator.go 80.29% <0.00%> (-2.92%) ⬇️
.../consensus/tendermint/apps/roothash/state/state.go 74.28% <0.00%> (-2.86%) ⬇️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0f8364...bdceea5. Read the comment docs.

Add getAccountNonce() helper to stakeCLIImpl and use it obtain the
accounts' nonces instead of hardcoding them.
@tjanez tjanez merged commit b838743 into master Dec 9, 2020
@tjanez tjanez deleted the tjanez/stake-account-nonce branch December 9, 2020 13:22
@@ -0,0 +1,3 @@
go/oasis-node/cmd: Add `oasis-node stake account nonce` CLI command

It can be used to get a staking account's current nonce.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering what's the use case for this, since the stake account info command already includes this in response?

The only thing i can come up with is using this in some automation - which i think we actually want to discourage and instead defer to the grpc api.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering what's the use case for this, since the stake account info command already includes this in response?

The use case I have in mind is to have an elegant way of getting an account's nonce instead of having to parse the stake account info command's response which is not guaranteed to stay stable.

The only thing i can come up with is using this in some automation - which i think we actually want to discourage and instead defer to the grpc api.

You guessed it 🙂. I've had some occasions where it was the most convenient to just write a simple Bash script to generate, sign and submit a batch of staking transactions.

Something like a more proper Go program acting as a gRPC client and a CLI would be nice, but out of scope for these smallish projects.

So, I would say that we probably don't want to discourage all such usage of our CLI tools, just not relying on their output being stable and using them to actually write a backend, e.g. a gateway, a staking dashboard, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:cli Category: command line interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants