Commit Graph

104 Commits

Author SHA1 Message Date
Tyera Eulberg b8b3d723da
Use new client crates (#27360)
* Update ancillary cli crates

* Update cli

* Update command-line tools

* Update rpc, etc

* Update client-test

* Update core, validator

* Update local-cluster
2022-08-24 10:47:02 -06:00
Tao Zhu 6892970c19
Cli support compute_unit_price (#26464)
* add compute-unit-price trait to insert compute_budget instruction to set priorization fee

* add clap arg for compute-unit-price

* add compute-unit-price arg to commands that send transactions

* add and update tests
2022-08-02 22:23:05 -05:00
Michael Vines 57ff7371b4 Add StakeInstruction::DeactivateDelinquent 2022-04-14 01:49:22 -04:00
Michael Vines c8c3c4359f `vote-authorize-voter` now accepts either the vote or withdraw authority 2022-03-24 16:46:41 -07:00
Justin Starry ae6c511f13
Refactor: Split vote_instruction.rs into multiple files (#22502) 2022-01-14 17:25:15 +08:00
Tyera Eulberg bed1b143a5
Restore ALL behavior; add enum variant, comments, and help text to make behavior clearer (#21854) 2021-12-13 19:00:29 -07:00
Tyera Eulberg 873fe81bc0
Add offline and fee-payer utilities to CLI vote module (#21579)
* create-vote-account: add offline, nonce, fee_payer capabilities

* vote-authorize: add offline, nonce, fee-payer

* vote-update-things: add offline, nonce, fee-payer

* withdraw-vote: add offline, nonce, fee-payer

* close-vote-acct: add fee-payer

* Allow WithdrawVoteAccount to empty account, since offline operations cannot perform account state queries as in CloseVoteAccount

* Fix lint

* Update offline-signing docs

* Add some parse unit tests

* Add offline integration test
2021-12-06 15:54:50 -07:00
Michael Vines b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
DimAn 09799590ac
fix checks in process_vote_authorize (#21465) 2021-11-29 09:46:29 -06:00
Tyera Eulberg 0b8fcf0808
Check whether vote-authorize-voter-checked new vote authority is_interactive (#21051)
* Check interactive signer for vote-authorize-voter-checked

* Recommend checked vote reauthorization
2021-10-28 20:48:16 +00:00
Jack May da45be366a
Remove blockhash from fee calculation (#20641) 2021-10-13 13:10:58 -07:00
Tyera Eulberg 15144fc923
Cli: check current authorities before attempting to change them (#19853)
* Stake-authorize: check account current authority

* Stake-set-lockup: check account current custodian

* Make helper fn pub(crate)

* Vote-authorize: check account current authority
2021-09-15 13:59:05 -06:00
Drew Taylor 2a29072019
Add `solana-close-vote-account` to CLI (#19756) 2021-09-13 08:13:59 -07:00
Bryan Ischo e288459cf2 Removed the --authorized-withdrawer argument from create-vote-account
The parameter is now a required third argument.  This is because authorized
withdrawer should never be the same as vote account keypair or validator
identity keypair for security reasons.

Added a --allow-unsafe-authorized-withdrawer to override this restriction if
necessary.
2021-09-03 16:45:06 -07:00
Jack May 0b50bb2b20
Deprecate FeeCalculator returning APIs (#19120) 2021-08-13 09:08:20 -07:00
theonekeyg 9d0a937a05
Auto-generate shell completions for solana-cli (issue #8879 and #14005) (#18931)
* Auto-generate shell completions for solana-cli (issue #8879 and #14005)

Implement `completion` SubCommand for solana-cli, which outputs
completion script to stdout and exits the process. The script generation
handled completely by clap.

In order to implement the generation, one minor design change was
necessary regarding the creation of clap `App`.

Previously: One part of App initialization was in the `app` function,
and some other arguments and subcommands were added later directly in
the `main` function.

Now: The whole construction of App was moved to `get_clap_app` function.

P.S. I wasn't sure if constructing App separately had visual importance,
so both constructing parts are still separate in `base_clap_app` and
`final_clap_app` functions. But they sure could be in one single
function.

* Dereplicode match expr, fix clippy warning.

* Move clap App construction into separate module

Also join two parts of the construction into a single function

* Fix tests

* Apply rustfmt lints
2021-07-28 09:43:32 -06:00
Tyera Eulberg aeb30fa873
Cli: Support checked stake and vote operations (#18449)
* Refactor VoteAuthorize to use SignerIndex and support vote-authorize-*-checked

* Add checked bool const and use in command parsing

* Add create-stake-account-checked handling

* Add stake-set-lockup-checked handling

* Remove unnecessary mut

* Add stake-authorized-checked handling
2021-07-15 16:45:03 -06:00
Tyera Eulberg 1dd730d685
Cli: expose `--with-memo` to nonce and stake commands (#18404)
* Fmt memo_arg

* Add --with-memo to nonce and stake cli commands
2021-07-03 11:46:52 -06:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Trent Nelson 06a926f2f4 Improve missing default filepath signer error messaging 2021-05-28 20:10:36 -06:00
Trent Nelson ca8c1c6c42 Revert "Improve missing default signer error messaging (#17486)"
This reverts commit 6d40d0d141.
2021-05-28 20:10:36 -06:00
Jack May 6d40d0d141
Improve missing default signer error messaging (#17486) 2021-05-25 18:31:27 -07:00
Tyera Eulberg bb9d2fd07a
Cli: use get_inflation_rewards and limit epochs queried (#16408)
* Fix block-with-limit when not finalized blocks found

* Enable confirmed commitment in getInflationReward

* Use get_inflation_rewards in cli

* Line up rewards output

* Add range validator

* Change cli epoch arg -> num epochs

* Add solana inflation rewards subcommand

* Consolidate epoch rewards meta
2021-04-08 10:57:33 -06:00
bji 364af3a3e0
issue #10831: added --with-memo option to all cli commands that submit (#16291)
* issue #10831: added --with-memo option to all cli commands that submit
transactions.  Also, improve the block command to show UTF-8 string instead
of integer values for memo program data.

* Fixed tests and changed some syntax according to feedback.

* Use spl_memo id (all versions where applicable) instead of hardcoding id.

* Update Cargo.toml in programs/bpf.

* Update formatting via cargo fmt.

* Update to use spl_memo version 3.0.1, which simplifies package imports
2021-04-05 20:53:50 +00:00
Tyera Eulberg a7086a0f83
Cli: promote commitment to a global arg + config.yml (#14684)
* Make commitment a global arg

* Add commitment to solana/cli/config.yml

* Fixup a couple Display/Verbose bugs
2021-01-20 09:48:10 -07:00
Tyera Eulberg 4964b0fe61
Cli: default to single gossip (#14673)
* Init cli RpcClient with chosen commitment; default to single_gossip

* Fill in missing client methods

* Cli tests: make RpcClient commitment specific

* Simply rpc_client calls, using configured commitment

* Check validator vote account with single-gossip commitment
2021-01-19 15:33:03 -07:00
Ryo Onodera c5b9831bfb
Don't abort for missing epoch rewards; intead display warn (#13457) 2020-11-07 09:32:29 +00:00
Ryo Onodera d08c3232e2
Show more detailed vote history in shorter format (#13374)
* Show more detailed vote history in shorter format

* Improve wording

* fmt
2020-11-07 00:07:40 +09:00
Michael Vines 7bc073defe Run `codemod --extensions rs Pubkey::new_rand solana_sdk::pubkey::new_rand` 2020-10-21 19:08:13 -07:00
Michael Vines 346890ded3 Display vote/stake account epoch rewards 2020-10-07 17:14:12 -07:00
Trent Nelson 325a7e9f86 Move CLI cli_output module to its own crate 2020-09-23 15:58:44 -06:00
Trent Nelson 0c58123b45 Move CLI Signer utils into clap-utils 2020-09-23 15:58:44 -06:00
Trent Nelson 9a60353fa9 CLI: Encapsulate default signer attributes 2020-09-23 15:58:44 -06:00
Trent Nelson 14ac233d01 CLI: Fix explicitly plumb vote_account through create-vote-account 2020-07-14 07:29:53 -06:00
Trent Nelson 2284699889 CLI: Fix explicitly plumb withdraw_authority through vote-update-validator 2020-07-14 07:29:53 -06:00
Trent Nelson 3392ecc310 CLI: Fix explicitly plumb withdraw_authority through vote-update-commission 2020-07-14 07:29:53 -06:00
Greg Fitzgerald 1c498369b5
Remove fee-payer guesswork from Message and Transaction (#10776)
* Make Message::new_with_payer the default constructor

* Remove Transaction::new_[un]signed_instructions

These guess the fee-payer instead of stating it explicitly
2020-06-24 14:52:38 -06:00
Tyera Eulberg 7a741bb79a
Move commitment to CliConfig to enable faster integration tests (#10627)
* Add commitment config to CliConfig

* Use config.commitment in cluster_query

* Use config.commitment in vote

* Add method with spinner + commitment

* Add send-transaction config to CliConfig

* Remove superfluous nonce check

* Add with_commitment helper fns

* Update src to use commitment

* Fix pay and transfer integration tests

* Fix nonce int tests

* Fix deploy int test

* Fix vote int test

* Fix stake int tests

* Nightly clippy

* Review comments
2020-06-17 12:18:48 -06:00
Michael Vines 296ac10b3a
|solana withdraw-from-vote-account| now supports ALL, and refuses to deallocate the vote account (#10602) 2020-06-15 21:36:47 +00:00
Michael Vines c3bb4b7405 Add `vote-update-commission` subcommand 2020-06-10 08:30:55 -07:00
Tyera Eulberg ed53a70b5c
Cli: transfer ALL; check spend+fee in client (#10012)
* lamports->SOL in user-facing error msg

* Check for sufficient balance for spend and fee

* Add ALL option to solana transfer

* Rework TransferAmount to check for sign_only in parse

* Refactor TransferAmount & fee-check handling to be more general

* Add addl checks mechanism

* Move checks out of cli.rs

* Rename to SpendAmount to be more general & move

* Impl ALL/spend helpers for create-nonce-account

* Impl spend helpers for create-vote-account

* Impl ALL/spend helpers for create-stake-account

* Impl spend helpers for ping

* Impl ALL/spend helpers for pay

* Impl spend helpers for validator-info

* Remove unused fns

* Remove retry_get_balance

* Add a couple unit tests

* Rework send_util fn signatures
2020-05-14 12:24:14 -06:00
Michael Vines cb50877bbf
send_and_confirm_transaction() no longer needs a keypair (#9950) 2020-05-09 09:06:32 -07:00
VadimGrznk f6e26f6c8c
Add using OutputFormat enum to --sign-only transactions (#9650)
* Add using OutputFormat enum to --sign-only commands

* Renaming

* Code formating

* Appease clippy

* Add returning json string to pay command for tests

* Code refactoring

* Appease clippy

* Rebase and dedupe signature prints

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2020-05-06 22:21:48 -06:00
Tyera Eulberg 65a52a4145
Cli: Update OutputFormat method to return a String to restore consistency (#9904)
* Update OutputFormat method to return a String to restore consistency

* Remove process_show_account special case
2020-05-06 20:27:15 -06:00
Michael Vines ffbbdd46e8
Add clap.rs default for --commitment (#9859) 2020-05-02 13:06:35 -07:00
Tyera Eulberg 6deaf649ef
Add commitment Root variant, and add fleshed out --commitment arg to Cli (#9806)
automerge
2020-04-29 21:55:33 -07:00
Tyera Eulberg 679e7863cb
Tame wallet manager better (#9567)
automerge
2020-04-18 11:54:21 -07:00
Tyera Eulberg 5298e3872c
Cli: enable json output (#9478)
automerge
2020-04-14 12:10:25 -07:00
Michael Vines 5a0c2a0c1d Rename UpdateNode to UpdateValidatorIdentity 2020-04-13 17:25:39 -07:00
Michael Vines 66c78cb819 Apply suggestions from code review 2020-04-03 09:58:40 -07:00