Commit Graph

334 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
Tyera Eulberg c24eaa36f8
Split up solana-client (#27246)
* Move thin-client to new crate

* Move tpu client and varieties to new crate

* Move pubsub-client to new crate

* Move rpc-client to new crate

* Add client-common crate to avoid circular dependencies

* Move rpc_cache and make less pub

* Remove unused unpub modules

* Add nonce-client

* Remove unused dependencies

* Fix rpc_client docs

* Move spinner to calling clients

* Rename client-common to rpc-client-api

* Remove unnecessary rpc_ prefix

* Remove unused ClientErrorKind variant

* Remove unnecessary Client prefix

* Move mod declarations into lib.rs and remove unnecessary files

* Rename nonce-client and remove redundant module name

* Restore mock_sender_for_cli in solana-client
2022-08-24 05:34:35 +00:00
Justin Starry d8380e4d4a
cli: Add subcommands for address lookup tables (#27123)
* cli: Add subcommand for creating address lookup tables

* cli: Add additional subcommands for address lookup tables

* short commands
2022-08-18 22:12:53 +01: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 b660ac511d cli: Add stake redelegation support 2022-07-27 20:24:25 -06:00
Brooks Prumo 8105b761ed
Add CLI to get stake minimum delegation (#26645) 2022-07-21 07:23:18 -05:00
Michael Vines fdb186ba3b pacify nightly clippy 2022-06-30 21:31:49 -07:00
godmodegalactus 7d54807da0
Filter stakes by withdrawer (#25939)
* Add a new argument to stake cli to filter stakes by withdrawer

* some fix on compilation errors

* fixing rust format

* defining withdrawer in cli arguments

* changes after review.

* minor changes after review
2022-06-17 15:52:23 -04:00
behzad nouri b4190319a1
feat(nonce): adds system instruction to upgrade legacy nonce versions (#25789)
https://github.com/solana-labs/solana/pull/25788
permanently disables durable transactions with legacy nonce versions
which are within chain blockhash domain.

This commit adds a new system instruction for a one-time idempotent
upgrade of legacy nonce accounts in order to bump them out of chain
blockhash domain.
2022-06-10 00:04:29 +00:00
Tao Zhu b1b3702e6d
Prioritize transactions in banking stage by their compute unit price (#25178)
* - get prioritization fee from compute_budget instruction;
- update compute_budget::process_instruction function to take instruction iter to support sanitized versioned message;
- updated runtime.md

* update transaction fee calculation for prioritization fee rate as lamports per 10K CUs

* review changes

* fix test

* fix a bpf test

* fix bpf test

* patch feedback

* fix clippy

* fix bpf test

* feedback

* rename prioritization fee rate to compute unit price

* feedback

Co-authored-by: Justin Starry <justin@solana.com>
2022-05-16 12:06:33 +08:00
Jack May cde15ff687
support 64-bit prioritization fee (#25027) 2022-05-12 11:07:36 -07:00
Justin Starry a118af069e
RPC: Add API version to context response (#25134)
* RPC: Add API version to context response

* restore backwards compatibility
2022-05-12 12:17:21 +08:00
Michael Vines 57ff7371b4 Add StakeInstruction::DeactivateDelinquent 2022-04-14 01:49:22 -04:00
Tyera Eulberg 8a73badf3d
Move helpers to solana-cli-config (#24246)
* Add solana-cli-utils crate

* Use cli-utils in cli

* Move println fn to cli-output

* Use cli-config instead
2022-04-11 12:56:51 -06:00
Trent Nelson bd27eedd15 cli: allow skipping fee-checks when writing program buffers (hidden) 2022-03-25 18:19:03 -06:00
Justin Starry 0eccacbd5b
Add CLI support for versioned transactions (#23606) 2022-03-17 11:43:04 +08:00
Tao Zhu e790d0fc53
Optional Cli parameter to add additional-fee to solana ping (#23513)
* Optional Cli parameter to add additional-fee to solana ping

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update cli/src/cluster_query.rs

correct the help message for arg

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-03-08 03:49:36 +00:00
Michael Vines 85e8bece2e Add solana_client::nonblocking::RpcClient 2022-01-26 17:58:00 -08:00
Tyera Eulberg 90689585ef
Update ping to transfer to self, with rotating amount (#22657)
* Update ping to transfer to self, with rotating amount

* Remove balance check
2022-01-21 22:10:50 -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
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
Trent Nelson 21bc43ed58
nonce: Unify `NonceError` with `SystemError` 2021-07-30 14:47:14 -06:00
Tyera Eulberg 662ccfa558
Cli: app and wallet command reorg (#18955)
* Clean up wallet commands

* Move global args
2021-07-29 00:19:34 -06: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
Trent Nelson a4a24b6531 cli: allow returning more `solana validators` 2021-07-14 08:41:52 +00:00
Tyera Eulberg f39ffa69f6
Remove dead solana airdrop parameters (#18520) 2021-07-08 18:18:44 +00: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
Tyera Eulberg 9d4428d3d8
Use timeout to allow RpcClient to retry initial transaction confirmation (#18311)
* Tidying: relocate function

* Use proper helper method for RpcClient commitment

* Add RpcClientConfig

* Add configurable confirm_transaction_initial_timeout

* Use default 5s timeout for initial tx confirmation
2021-06-30 01:08:45 +00:00
Alexander Meißner 789f33e8db chore: cargo fmt 2021-06-18 10:42:46 -07:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Jon Cinque 1b1d34da59
Refactor stake program into solana_program (#17906)
* Move stake state / instructions into solana_program

* Update account-decoder

* Update cli and runtime

* Update all other parts

* Commit Cargo.lock changes in programs/bpf

* Update cli stake instruction import

* Allow integer arithmetic

* Update ABI digest

* Bump rust mem instruction count

* Remove useless structs

* Move stake::id() -> stake::program::id()

* Re-export from solana_sdk and mark deprecated

* Address feedback

* Run cargo fmt
2021-06-15 18:04:00 +02:00
Tyera Eulberg b7f98ea18a
Cli: Decode known program custom errors returned from simulation (#17652) 2021-06-01 23:22:01 -06: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
Michael Vines cbce440af4 simulateTransaction can now return accounts modified by the simulation 2021-05-26 14:20:23 -07:00
Jack May 6d40d0d141
Improve missing default signer error messaging (#17486) 2021-05-25 18:31:27 -07:00
Greg Fitzgerald 3805874c86
Add --no-wait option to CLI's stake-authorize command (#17244) 2021-05-17 16:54:33 +00:00
Michael Vines cf779c63c5 Add ALL support to withdraw-stake subcommand 2021-04-26 11:03:37 -07:00
Justin Starry 75b8434b76
Add TPU client for sending txs to the current leader tpu port (#16736)
* Add TPU client for sending txs to the current leader tpu port

* Update tpu_client.rs
2021-04-23 09:35:12 +08:00
Trent Nelson 63957f0677 CLI: Make `pay` subcommand a proper alias of `transfer` 2021-04-21 21:21:06 +00:00
Michael Vines ba9a502e7e Add --seed support to delegate-stake and withdraw-stake commands 2021-04-21 20:25:01 +00:00
Trent Nelson f91de6a84d CLI: Limit `stake-history` output by default 2021-04-20 10:15:25 +00:00
Michael Vines f14cf3ed1a Add --number argument 2021-04-19 16:31:23 -07:00
Michael Vines b66faf7e80 Add --sort argument to `solana validators` 2021-04-19 16:31:23 -07:00
Trent Nelson 09dcc9ea04 clap-utils: Rename KeypairUrl to SignerSource 2021-04-16 13:56:12 -06:00