Remove get-/show- prefix from cli commands
This commit is contained in:
@ -199,14 +199,18 @@ OPTIONS:
|
|||||||
-k, --keypair <PATH> /path/to/id.json
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
|
|
||||||
SUBCOMMANDS:
|
SUBCOMMANDS:
|
||||||
|
account Show the contents of an account
|
||||||
address Get your public key
|
address Get your public key
|
||||||
airdrop Request lamports
|
airdrop Request lamports
|
||||||
authorize-nonce-account Assign account authority to a new entity
|
authorize-nonce-account Assign account authority to a new entity
|
||||||
balance Get your balance
|
balance Get your balance
|
||||||
|
block-production Show information about block production
|
||||||
|
block-time Get estimated production time of a block
|
||||||
cancel Cancel a transfer
|
cancel Cancel a transfer
|
||||||
catchup Wait for a validator to catch up to the cluster
|
catchup Wait for a validator to catch up to the cluster
|
||||||
claim-storage-reward Redeem storage reward credits
|
claim-storage-reward Redeem storage reward credits
|
||||||
cluster-version Get the version of the cluster entrypoint
|
cluster-version Get the version of the cluster entrypoint
|
||||||
|
config Solana command-line tool configuration settings
|
||||||
confirm Confirm transaction by signature
|
confirm Confirm transaction by signature
|
||||||
create-address-with-seed Generate a dervied account address with a seed
|
create-address-with-seed Generate a dervied account address with a seed
|
||||||
create-archiver-storage-account Create an archiver storage account
|
create-archiver-storage-account Create an archiver storage account
|
||||||
@ -217,35 +221,30 @@ SUBCOMMANDS:
|
|||||||
deactivate-stake Deactivate the delegated stake from the stake account
|
deactivate-stake Deactivate the delegated stake from the stake account
|
||||||
delegate-stake Delegate stake to a vote account
|
delegate-stake Delegate stake to a vote account
|
||||||
deploy Deploy a program
|
deploy Deploy a program
|
||||||
|
epoch-info Get information about the current epoch
|
||||||
fees Display current cluster fees
|
fees Display current cluster fees
|
||||||
get Get cli config settings
|
genesis-hash Get the genesis hash
|
||||||
get-block-time Get estimated production time of a block
|
gossip Show the current gossip network nodes
|
||||||
get-epoch-info Get information about the current epoch
|
|
||||||
get-genesis-hash Get the genesis hash
|
|
||||||
get-nonce Get the current nonce value
|
|
||||||
get-slot Get current slot
|
|
||||||
get-transaction-count Get current transaction count
|
|
||||||
help Prints this message or the help of the given subcommand(s)
|
help Prints this message or the help of the given subcommand(s)
|
||||||
new-nonce Generate a new nonce, rendering the existing nonce useless
|
new-nonce Generate a new nonce, rendering the existing nonce useless
|
||||||
|
nonce Get the current nonce value
|
||||||
|
nonce-account Show the contents of a nonce account
|
||||||
pay Send a payment
|
pay Send a payment
|
||||||
ping Submit transactions sequentially
|
ping Submit transactions sequentially
|
||||||
redeem-vote-credits Redeem credits in the stake account
|
redeem-vote-credits Redeem credits in the stake account
|
||||||
send-signature Send a signature to authorize a transfer
|
send-signature Send a signature to authorize a transfer
|
||||||
send-timestamp Send a timestamp to unlock a transfer
|
send-timestamp Send a timestamp to unlock a transfer
|
||||||
set Set a cli config setting
|
slot Get current slot
|
||||||
show-account Show the contents of an account
|
stake-account Show the contents of a stake account
|
||||||
show-block-production Show information about block production
|
|
||||||
show-gossip Show the current gossip network nodes
|
|
||||||
show-nonce-account Show the contents of a nonce account
|
|
||||||
show-stake-account Show the contents of a stake account
|
|
||||||
show-stake-history Show the stake history
|
|
||||||
show-storage-account Show the contents of a storage account
|
|
||||||
show-validators Show information about the current validators
|
|
||||||
show-vote-account Show the contents of a vote account
|
|
||||||
stake-authorize-staker Authorize a new stake signing keypair for the given stake account
|
stake-authorize-staker Authorize a new stake signing keypair for the given stake account
|
||||||
stake-authorize-withdrawer Authorize a new withdraw signing keypair for the given stake account
|
stake-authorize-withdrawer Authorize a new withdraw signing keypair for the given stake account
|
||||||
|
stake-history Show the stake history
|
||||||
|
storage-account Show the contents of a storage account
|
||||||
|
transaction-count Get current transaction count
|
||||||
uptime Show the uptime of a validator, based on epoch voting history
|
uptime Show the uptime of a validator, based on epoch voting history
|
||||||
validator-info Publish/get Validator info on Solana
|
validator-info Publish/get Validator info on Solana
|
||||||
|
validators Show information about the current validators
|
||||||
|
vote-account Show the contents of a vote account
|
||||||
vote-authorize-voter Authorize a new vote signing keypair for the given vote account
|
vote-authorize-voter Authorize a new vote signing keypair for the given vote account
|
||||||
vote-authorize-withdrawer Authorize a new withdraw signing keypair for the given vote account
|
vote-authorize-withdrawer Authorize a new withdraw signing keypair for the given vote account
|
||||||
vote-update-validator Update the vote account's validator identity
|
vote-update-validator Update the vote account's validator identity
|
||||||
@ -835,7 +834,7 @@ solana-get-block-time
|
|||||||
Get estimated production time of a block
|
Get estimated production time of a block
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana get-block-time [FLAGS] [OPTIONS] <SLOT>
|
solana block-time [FLAGS] [OPTIONS] <SLOT>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -862,7 +861,7 @@ solana-get-epoch-info
|
|||||||
Get information about the current epoch
|
Get information about the current epoch
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana get-epoch-info [FLAGS] [OPTIONS]
|
solana epoch-info [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
--confirmed Return information at maximum-lockout commitment level
|
--confirmed Return information at maximum-lockout commitment level
|
||||||
@ -887,7 +886,7 @@ solana-get-genesis-hash
|
|||||||
Get the genesis hash
|
Get the genesis hash
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana get-genesis-hash [FLAGS] [OPTIONS]
|
solana genesis-hash [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -911,7 +910,7 @@ solana-get-nonce
|
|||||||
Get the current nonce value
|
Get the current nonce value
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana get-nonce [FLAGS] [OPTIONS] <NONCE ACCOUNT>
|
solana nonce [FLAGS] [OPTIONS] <NONCE ACCOUNT>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -938,7 +937,7 @@ solana-get-slot
|
|||||||
Get current slot
|
Get current slot
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana get-slot [FLAGS] [OPTIONS]
|
solana slot [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
--confirmed Return slot at maximum-lockout commitment level
|
--confirmed Return slot at maximum-lockout commitment level
|
||||||
@ -963,7 +962,7 @@ solana-get-transaction-count
|
|||||||
Get current transaction count
|
Get current transaction count
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana get-transaction-count [FLAGS] [OPTIONS]
|
solana transaction-count [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
--confirmed Return count at maximum-lockout commitment level
|
--confirmed Return count at maximum-lockout commitment level
|
||||||
@ -1202,13 +1201,13 @@ OPTIONS:
|
|||||||
-k, --keypair <PATH> /path/to/id.json
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-account
|
#### solana-account
|
||||||
```text
|
```text
|
||||||
solana-show-account
|
solana-account
|
||||||
Show the contents of an account
|
Show the contents of an account
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-account [FLAGS] [OPTIONS] <ACCOUNT PUBKEY>
|
solana account [FLAGS] [OPTIONS] <ACCOUNT PUBKEY>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1231,13 +1230,13 @@ ARGS:
|
|||||||
<ACCOUNT PUBKEY> Account pubkey
|
<ACCOUNT PUBKEY> Account pubkey
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-block-production
|
#### solana-block-production
|
||||||
```text
|
```text
|
||||||
solana-show-block-production
|
solana-block-production
|
||||||
Show information about block production
|
Show information about block production
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-block-production [FLAGS] [OPTIONS]
|
solana block-production [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1258,13 +1257,13 @@ OPTIONS:
|
|||||||
epoch]
|
epoch]
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-gossip
|
#### solana-gossip
|
||||||
```text
|
```text
|
||||||
solana-show-gossip
|
solana-gossip
|
||||||
Show the current gossip network nodes
|
Show the current gossip network nodes
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-gossip [FLAGS] [OPTIONS]
|
solana gossip [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1282,13 +1281,13 @@ OPTIONS:
|
|||||||
-k, --keypair <PATH> /path/to/id.json
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-nonce-account
|
#### solana-nonce-account
|
||||||
```text
|
```text
|
||||||
solana-show-nonce-account
|
solana-nonce-account
|
||||||
Show the contents of a nonce account
|
Show the contents of a nonce account
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-nonce-account [FLAGS] [OPTIONS] <NONCE ACCOUNT>
|
solana nonce-account [FLAGS] [OPTIONS] <NONCE ACCOUNT>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1310,13 +1309,13 @@ ARGS:
|
|||||||
<NONCE ACCOUNT> Address of the nonce account to display
|
<NONCE ACCOUNT> Address of the nonce account to display
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-stake-account
|
#### solana-stake-account
|
||||||
```text
|
```text
|
||||||
solana-show-stake-account
|
solana-stake-account
|
||||||
Show the contents of a stake account
|
Show the contents of a stake account
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-stake-account [FLAGS] [OPTIONS] <STAKE ACCOUNT>
|
solana stake-account [FLAGS] [OPTIONS] <STAKE ACCOUNT>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1338,13 +1337,13 @@ ARGS:
|
|||||||
<STAKE ACCOUNT> Address of the stake account to display
|
<STAKE ACCOUNT> Address of the stake account to display
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-stake-history
|
#### solana-stake-history
|
||||||
```text
|
```text
|
||||||
solana-show-stake-history
|
solana-stake-history
|
||||||
Show the stake history
|
Show the stake history
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-stake-history [FLAGS] [OPTIONS]
|
solana stake-history [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1363,13 +1362,13 @@ OPTIONS:
|
|||||||
-k, --keypair <PATH> /path/to/id.json
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-storage-account
|
#### solana-storage-account
|
||||||
```text
|
```text
|
||||||
solana-show-storage-account
|
solana-storage-account
|
||||||
Show the contents of a storage account
|
Show the contents of a storage account
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-storage-account [FLAGS] [OPTIONS] <STORAGE ACCOUNT PUBKEY>
|
solana storage-account [FLAGS] [OPTIONS] <STORAGE ACCOUNT PUBKEY>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1390,13 +1389,13 @@ ARGS:
|
|||||||
<STORAGE ACCOUNT PUBKEY> Storage account pubkey
|
<STORAGE ACCOUNT PUBKEY> Storage account pubkey
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-validators
|
#### solana-validators
|
||||||
```text
|
```text
|
||||||
solana-show-validators
|
solana-validators
|
||||||
Show information about the current validators
|
Show information about the current validators
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-validators [FLAGS] [OPTIONS]
|
solana validators [FLAGS] [OPTIONS]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
@ -1415,13 +1414,13 @@ OPTIONS:
|
|||||||
-k, --keypair <PATH> /path/to/id.json
|
-k, --keypair <PATH> /path/to/id.json
|
||||||
```
|
```
|
||||||
|
|
||||||
#### solana-show-vote-account
|
#### solana-vote-account
|
||||||
```text
|
```text
|
||||||
solana-show-vote-account
|
solana-vote-account
|
||||||
Show the contents of a vote account
|
Show the contents of a vote account
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
solana show-vote-account [FLAGS] [OPTIONS] <VOTE ACCOUNT PUBKEY>
|
solana vote-account [FLAGS] [OPTIONS] <VOTE ACCOUNT PUBKEY>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
|
@ -64,7 +64,7 @@ presently stored nonce value with
|
|||||||
- Command
|
- Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
solana get-nonce nonce-keypair.json
|
solana nonce nonce-keypair.json
|
||||||
```
|
```
|
||||||
|
|
||||||
- Output
|
- Output
|
||||||
@ -105,7 +105,7 @@ Inspect a nonce account in a more human friendly format with
|
|||||||
- Command
|
- Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
solana show-nonce-account nonce-keypair.json
|
solana nonce-account nonce-keypair.json
|
||||||
```
|
```
|
||||||
|
|
||||||
- Output
|
- Output
|
||||||
@ -117,7 +117,7 @@ nonce: DZar6t2EaCFQTbUP4DHKwZ1wT8gCPW2aRfkVWhydkBvS
|
|||||||
```
|
```
|
||||||
|
|
||||||
{% hint style="info" %}
|
{% hint style="info" %}
|
||||||
[Full usage documentation](../api-reference/cli.md#solana-show-nonce-account)
|
[Full usage documentation](../api-reference/cli.md#solana-nonce-account)
|
||||||
{% endhint %}
|
{% endhint %}
|
||||||
|
|
||||||
### Withdraw Funds from a Nonce Account
|
### Withdraw Funds from a Nonce Account
|
||||||
@ -236,7 +236,7 @@ Remember, `alice.json` is the [nonce authority](#nonce-authority) in this exampl
|
|||||||
{% endhint %}
|
{% endhint %}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ solana show-nonce-account nonce.json
|
$ solana nonce-account nonce.json
|
||||||
balance: 1 SOL
|
balance: 1 SOL
|
||||||
minimum balance required: 0.00136416 SOL
|
minimum balance required: 0.00136416 SOL
|
||||||
nonce: F7vmkY3DTaxfagttWjQweib42b6ZHADSx94Tw8gHx3W7
|
nonce: F7vmkY3DTaxfagttWjQweib42b6ZHADSx94Tw8gHx3W7
|
||||||
@ -256,7 +256,7 @@ $ solana balance -k bob.json
|
|||||||
1 SOL
|
1 SOL
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
$ solana show-nonce-account nonce.json
|
$ solana nonce-account nonce.json
|
||||||
balance: 1 SOL
|
balance: 1 SOL
|
||||||
minimum balance required: 0.00136416 SOL
|
minimum balance required: 0.00136416 SOL
|
||||||
nonce: 6bjroqDcZgTv6Vavhqf81oBHTv3aMnX19UTB51YhAZnN
|
nonce: 6bjroqDcZgTv6Vavhqf81oBHTv3aMnX19UTB51YhAZnN
|
||||||
|
@ -149,8 +149,8 @@ From another console, confirm the IP address and **identity pubkey** of your arc
|
|||||||
solana-gossip spy --entrypoint testnet.solana.com:8001
|
solana-gossip spy --entrypoint testnet.solana.com:8001
|
||||||
```
|
```
|
||||||
|
|
||||||
Provide the **storage account pubkey** to the `solana show-storage-account` command to view the recent mining activity from your archiver:
|
Provide the **storage account pubkey** to the `solana storage-account` command to view the recent mining activity from your archiver:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
solana --keypair storage-keypair.json show-storage-account $STORAGE_IDENTITY
|
solana --keypair storage-keypair.json storage-account $STORAGE_IDENTITY
|
||||||
```
|
```
|
||||||
|
@ -21,11 +21,11 @@ solana balance --lamports
|
|||||||
|
|
||||||
## Check Vote Activity
|
## Check Vote Activity
|
||||||
|
|
||||||
The `solana show-vote-account` command displays the recent voting activity from
|
The `solana vote-account` command displays the recent voting activity from
|
||||||
your validator:
|
your validator:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
solana show-vote-account ~/validator-vote-keypair.json
|
solana vote-account ~/validator-vote-keypair.json
|
||||||
```
|
```
|
||||||
|
|
||||||
## Get Cluster Info
|
## Get Cluster Info
|
||||||
|
@ -85,11 +85,11 @@ so it can take an hour or more for stake to come fully online.
|
|||||||
|
|
||||||
To monitor your validator during its warmup period:
|
To monitor your validator during its warmup period:
|
||||||
|
|
||||||
* View your vote account:`solana show-vote-account ~/validator-vote-keypair.json` This displays the current state of all the votes the validator has submitted to the network.
|
* View your vote account:`solana vote-account ~/validator-vote-keypair.json` This displays the current state of all the votes the validator has submitted to the network.
|
||||||
* View your stake account, the delegation preference and details of your stake:`solana show-stake-account ~/validator-stake-keypair.json`
|
* View your stake account, the delegation preference and details of your stake:`solana stake-account ~/validator-stake-keypair.json`
|
||||||
* `solana uptime ~/validator-vote-keypair.json` will display the voting history \(aka, uptime\) of your validator over recent Epochs
|
* `solana uptime ~/validator-vote-keypair.json` will display the voting history \(aka, uptime\) of your validator over recent Epochs
|
||||||
* `solana show-validators` displays the current active stake of all validators, including yours
|
* `solana validators` displays the current active stake of all validators, including yours
|
||||||
* `solana show-stake-history ` shows the history of stake warming up and cooling down over recent epochs
|
* `solana stake-history ` shows the history of stake warming up and cooling down over recent epochs
|
||||||
* Look for log messages on your validator indicating your next leader slot: `[2019-09-27T20:16:00.319721164Z INFO solana_core::replay_stage] <VALIDATOR_IDENTITY_PUBKEY> voted and reset PoH at tick height ####. My next leader slot is ####`
|
* Look for log messages on your validator indicating your next leader slot: `[2019-09-27T20:16:00.319721164Z INFO solana_core::replay_stage] <VALIDATOR_IDENTITY_PUBKEY> voted and reset PoH at tick height ####. My next leader slot is ####`
|
||||||
* Once your stake is warmed up, you will see a stake balance listed for your validator on the [Solana Network Explorer](http://explorer.solana.com/validators)
|
* Once your stake is warmed up, you will see a stake balance listed for your validator on the [Solana Network Explorer](http://explorer.solana.com/validators)
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Before attaching a validator node, sanity check that the cluster is accessible
|
|||||||
to your machine by fetching the transaction count:
|
to your machine by fetching the transaction count:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
solana get-transaction-count
|
solana transaction-count
|
||||||
```
|
```
|
||||||
|
|
||||||
Inspect the network explorer at
|
Inspect the network explorer at
|
||||||
|
@ -179,7 +179,7 @@ startNodes() {
|
|||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
$solana_cli --keypair config/bootstrap-leader/identity-keypair.json \
|
$solana_cli --keypair config/bootstrap-leader/identity-keypair.json \
|
||||||
--url http://127.0.0.1:8899 get-genesis-hash
|
--url http://127.0.0.1:8899 genesis-hash
|
||||||
) | tee genesis-hash.log
|
) | tee genesis-hash.log
|
||||||
maybeExpectedGenesisHash="--expected-genesis-hash $(tail -n1 genesis-hash.log)"
|
maybeExpectedGenesisHash="--expected-genesis-hash $(tail -n1 genesis-hash.log)"
|
||||||
fi
|
fi
|
||||||
|
@ -370,28 +370,28 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
|
|||||||
command: CliCommand::Fees,
|
command: CliCommand::Fees,
|
||||||
require_keypair: false,
|
require_keypair: false,
|
||||||
}),
|
}),
|
||||||
("get-block-time", Some(matches)) => parse_get_block_time(matches),
|
("block-time", Some(matches)) => parse_get_block_time(matches),
|
||||||
("get-epoch-info", Some(matches)) => parse_get_epoch_info(matches),
|
("epoch-info", Some(matches)) => parse_get_epoch_info(matches),
|
||||||
("get-genesis-hash", Some(_matches)) => Ok(CliCommandInfo {
|
("genesis-hash", Some(_matches)) => Ok(CliCommandInfo {
|
||||||
command: CliCommand::GetGenesisHash,
|
command: CliCommand::GetGenesisHash,
|
||||||
require_keypair: false,
|
require_keypair: false,
|
||||||
}),
|
}),
|
||||||
("get-slot", Some(matches)) => parse_get_slot(matches),
|
("slot", Some(matches)) => parse_get_slot(matches),
|
||||||
("get-transaction-count", Some(matches)) => parse_get_transaction_count(matches),
|
("transaction-count", Some(matches)) => parse_get_transaction_count(matches),
|
||||||
("ping", Some(matches)) => parse_cluster_ping(matches),
|
("ping", Some(matches)) => parse_cluster_ping(matches),
|
||||||
("show-block-production", Some(matches)) => parse_show_block_production(matches),
|
("block-production", Some(matches)) => parse_show_block_production(matches),
|
||||||
("show-gossip", Some(_matches)) => Ok(CliCommandInfo {
|
("gossip", Some(_matches)) => Ok(CliCommandInfo {
|
||||||
command: CliCommand::ShowGossip,
|
command: CliCommand::ShowGossip,
|
||||||
require_keypair: false,
|
require_keypair: false,
|
||||||
}),
|
}),
|
||||||
("show-stakes", Some(matches)) => parse_show_stakes(matches),
|
("stakes", Some(matches)) => parse_show_stakes(matches),
|
||||||
("show-validators", Some(matches)) => parse_show_validators(matches),
|
("validators", Some(matches)) => parse_show_validators(matches),
|
||||||
// Nonce Commands
|
// Nonce Commands
|
||||||
("authorize-nonce-account", Some(matches)) => parse_authorize_nonce_account(matches),
|
("authorize-nonce-account", Some(matches)) => parse_authorize_nonce_account(matches),
|
||||||
("create-nonce-account", Some(matches)) => parse_nonce_create_account(matches),
|
("create-nonce-account", Some(matches)) => parse_nonce_create_account(matches),
|
||||||
("get-nonce", Some(matches)) => parse_get_nonce(matches),
|
("nonce", Some(matches)) => parse_get_nonce(matches),
|
||||||
("new-nonce", Some(matches)) => parse_new_nonce(matches),
|
("new-nonce", Some(matches)) => parse_new_nonce(matches),
|
||||||
("show-nonce-account", Some(matches)) => parse_show_nonce_account(matches),
|
("nonce-account", Some(matches)) => parse_show_nonce_account(matches),
|
||||||
("withdraw-from-nonce-account", Some(matches)) => {
|
("withdraw-from-nonce-account", Some(matches)) => {
|
||||||
parse_withdraw_from_nonce_account(matches)
|
parse_withdraw_from_nonce_account(matches)
|
||||||
}
|
}
|
||||||
@ -412,8 +412,8 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
|
|||||||
parse_stake_authorize(matches, StakeAuthorize::Withdrawer)
|
parse_stake_authorize(matches, StakeAuthorize::Withdrawer)
|
||||||
}
|
}
|
||||||
("redeem-vote-credits", Some(matches)) => parse_redeem_vote_credits(matches),
|
("redeem-vote-credits", Some(matches)) => parse_redeem_vote_credits(matches),
|
||||||
("show-stake-account", Some(matches)) => parse_show_stake_account(matches),
|
("stake-account", Some(matches)) => parse_show_stake_account(matches),
|
||||||
("show-stake-history", Some(matches)) => parse_show_stake_history(matches),
|
("stake-history", Some(matches)) => parse_show_stake_history(matches),
|
||||||
// Storage Commands
|
// Storage Commands
|
||||||
("create-archiver-storage-account", Some(matches)) => {
|
("create-archiver-storage-account", Some(matches)) => {
|
||||||
parse_storage_create_archiver_account(matches)
|
parse_storage_create_archiver_account(matches)
|
||||||
@ -422,17 +422,11 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
|
|||||||
parse_storage_create_validator_account(matches)
|
parse_storage_create_validator_account(matches)
|
||||||
}
|
}
|
||||||
("claim-storage-reward", Some(matches)) => parse_storage_claim_reward(matches),
|
("claim-storage-reward", Some(matches)) => parse_storage_claim_reward(matches),
|
||||||
("show-storage-account", Some(matches)) => parse_storage_get_account_command(matches),
|
("storage-account", Some(matches)) => parse_storage_get_account_command(matches),
|
||||||
// Validator Info Commands
|
// Validator Info Commands
|
||||||
("validator-info", Some(matches)) => match matches.subcommand() {
|
("validator-info", Some(matches)) => match matches.subcommand() {
|
||||||
("publish", Some(matches)) => parse_validator_info_command(matches),
|
("publish", Some(matches)) => parse_validator_info_command(matches),
|
||||||
("get", Some(matches)) => parse_get_validator_info_command(matches),
|
("get", Some(matches)) => parse_get_validator_info_command(matches),
|
||||||
("", None) => {
|
|
||||||
eprintln!("{}", matches.usage());
|
|
||||||
Err(CliError::CommandNotRecognized(
|
|
||||||
"no validator-info subcommand given".to_string(),
|
|
||||||
))
|
|
||||||
}
|
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
},
|
},
|
||||||
// Vote Commands
|
// Vote Commands
|
||||||
@ -444,7 +438,7 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
|
|||||||
("vote-authorize-withdrawer", Some(matches)) => {
|
("vote-authorize-withdrawer", Some(matches)) => {
|
||||||
parse_vote_authorize(matches, VoteAuthorize::Withdrawer)
|
parse_vote_authorize(matches, VoteAuthorize::Withdrawer)
|
||||||
}
|
}
|
||||||
("show-vote-account", Some(matches)) => parse_vote_get_account_command(matches),
|
("vote-account", Some(matches)) => parse_vote_get_account_command(matches),
|
||||||
("uptime", Some(matches)) => parse_vote_uptime_command(matches),
|
("uptime", Some(matches)) => parse_vote_uptime_command(matches),
|
||||||
// Wallet Commands
|
// Wallet Commands
|
||||||
("address", Some(_matches)) => Ok(CliCommandInfo {
|
("address", Some(_matches)) => Ok(CliCommandInfo {
|
||||||
@ -560,7 +554,7 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
|
|||||||
require_keypair: true,
|
require_keypair: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
("show-account", Some(matches)) => {
|
("account", Some(matches)) => {
|
||||||
let account_pubkey = pubkey_of(matches, "account_pubkey").unwrap();
|
let account_pubkey = pubkey_of(matches, "account_pubkey").unwrap();
|
||||||
let output_file = matches.value_of("output_file");
|
let output_file = matches.value_of("output_file");
|
||||||
let use_lamports_unit = matches.is_present("lamports");
|
let use_lamports_unit = matches.is_present("lamports");
|
||||||
@ -2003,8 +1997,9 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-account")
|
SubCommand::with_name("account")
|
||||||
.about("Show the contents of an account")
|
.about("Show the contents of an account")
|
||||||
|
.alias("account")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("account_pubkey")
|
Arg::with_name("account_pubkey")
|
||||||
.index(1)
|
.index(1)
|
||||||
|
@ -55,8 +55,9 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|||||||
.about("Get the version of the cluster entrypoint"),
|
.about("Get the version of the cluster entrypoint"),
|
||||||
)
|
)
|
||||||
.subcommand(SubCommand::with_name("fees").about("Display current cluster fees"))
|
.subcommand(SubCommand::with_name("fees").about("Display current cluster fees"))
|
||||||
.subcommand(SubCommand::with_name("get-block-time")
|
.subcommand(SubCommand::with_name("block-time")
|
||||||
.about("Get estimated production time of a block")
|
.about("Get estimated production time of a block")
|
||||||
|
.alias("get-block-time")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("slot")
|
Arg::with_name("slot")
|
||||||
.index(1)
|
.index(1)
|
||||||
@ -67,8 +68,9 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("get-epoch-info")
|
SubCommand::with_name("epoch-info")
|
||||||
.about("Get information about the current epoch")
|
.about("Get information about the current epoch")
|
||||||
|
.alias("get-epoch-info")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("confirmed")
|
Arg::with_name("confirmed")
|
||||||
.long("confirmed")
|
.long("confirmed")
|
||||||
@ -79,10 +81,13 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("get-genesis-hash").about("Get the genesis hash"),
|
SubCommand::with_name("genesis-hash")
|
||||||
|
.about("Get the genesis hash")
|
||||||
|
.alias("get-genesis-hash")
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("get-slot").about("Get current slot")
|
SubCommand::with_name("slot").about("Get current slot")
|
||||||
|
.alias("get-slot")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("confirmed")
|
Arg::with_name("confirmed")
|
||||||
.long("confirmed")
|
.long("confirmed")
|
||||||
@ -93,7 +98,8 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("get-transaction-count").about("Get current transaction count")
|
SubCommand::with_name("transaction-count").about("Get current transaction count")
|
||||||
|
.alias("get-transaction-count")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("confirmed")
|
Arg::with_name("confirmed")
|
||||||
.long("confirmed")
|
.long("confirmed")
|
||||||
@ -151,8 +157,9 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-block-production")
|
SubCommand::with_name("block-production")
|
||||||
.about("Show information about block production")
|
.about("Show information about block production")
|
||||||
|
.alias("show-block-production")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("epoch")
|
Arg::with_name("epoch")
|
||||||
.long("epoch")
|
.long("epoch")
|
||||||
@ -167,11 +174,12 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-gossip")
|
SubCommand::with_name("gossip")
|
||||||
.about("Show the current gossip network nodes"),
|
.about("Show the current gossip network nodes")
|
||||||
|
.alias("show-gossip")
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-stakes")
|
SubCommand::with_name("stakes")
|
||||||
.about("Show stake account information")
|
.about("Show stake account information")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("vote_account_pubkeys")
|
Arg::with_name("vote_account_pubkeys")
|
||||||
@ -190,8 +198,9 @@ impl ClusterQuerySubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-validators")
|
SubCommand::with_name("validators")
|
||||||
.about("Show summary information about the current validators")
|
.about("Show summary information about the current validators")
|
||||||
|
.alias("show-validators")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("lamports")
|
Arg::with_name("lamports")
|
||||||
.long("lamports")
|
.long("lamports")
|
||||||
@ -985,11 +994,10 @@ mod tests {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let slot = 100;
|
let slot = 100;
|
||||||
let test_get_block_time = test_commands.clone().get_matches_from(vec![
|
let test_get_block_time =
|
||||||
"test",
|
test_commands
|
||||||
"get-block-time",
|
.clone()
|
||||||
&slot.to_string(),
|
.get_matches_from(vec!["test", "block-time", &slot.to_string()]);
|
||||||
]);
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_get_block_time).unwrap(),
|
parse_command(&test_get_block_time).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
@ -1000,7 +1008,7 @@ mod tests {
|
|||||||
|
|
||||||
let test_get_epoch_info = test_commands
|
let test_get_epoch_info = test_commands
|
||||||
.clone()
|
.clone()
|
||||||
.get_matches_from(vec!["test", "get-epoch-info"]);
|
.get_matches_from(vec!["test", "epoch-info"]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_get_epoch_info).unwrap(),
|
parse_command(&test_get_epoch_info).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
@ -1013,7 +1021,7 @@ mod tests {
|
|||||||
|
|
||||||
let test_get_genesis_hash = test_commands
|
let test_get_genesis_hash = test_commands
|
||||||
.clone()
|
.clone()
|
||||||
.get_matches_from(vec!["test", "get-genesis-hash"]);
|
.get_matches_from(vec!["test", "genesis-hash"]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_get_genesis_hash).unwrap(),
|
parse_command(&test_get_genesis_hash).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
@ -1022,9 +1030,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
let test_get_slot = test_commands
|
let test_get_slot = test_commands.clone().get_matches_from(vec!["test", "slot"]);
|
||||||
.clone()
|
|
||||||
.get_matches_from(vec!["test", "get-slot"]);
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_get_slot).unwrap(),
|
parse_command(&test_get_slot).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
@ -1037,7 +1043,7 @@ mod tests {
|
|||||||
|
|
||||||
let test_transaction_count = test_commands
|
let test_transaction_count = test_commands
|
||||||
.clone()
|
.clone()
|
||||||
.get_matches_from(vec!["test", "get-transaction-count"]);
|
.get_matches_from(vec!["test", "transaction-count"]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
parse_command(&test_transaction_count).unwrap(),
|
parse_command(&test_transaction_count).unwrap(),
|
||||||
CliCommandInfo {
|
CliCommandInfo {
|
||||||
|
141
cli/src/main.rs
141
cli/src/main.rs
@ -1,4 +1,4 @@
|
|||||||
use clap::{crate_description, crate_name, Arg, ArgGroup, ArgMatches, SubCommand};
|
use clap::{crate_description, crate_name, AppSettings, Arg, ArgGroup, ArgMatches, SubCommand};
|
||||||
use console::style;
|
use console::style;
|
||||||
|
|
||||||
use solana_clap_utils::{
|
use solana_clap_utils::{
|
||||||
@ -19,58 +19,61 @@ use std::error;
|
|||||||
|
|
||||||
fn parse_settings(matches: &ArgMatches<'_>) -> Result<bool, Box<dyn error::Error>> {
|
fn parse_settings(matches: &ArgMatches<'_>) -> Result<bool, Box<dyn error::Error>> {
|
||||||
let parse_args = match matches.subcommand() {
|
let parse_args = match matches.subcommand() {
|
||||||
("get", Some(subcommand_matches)) => {
|
("config", Some(matches)) => match matches.subcommand() {
|
||||||
if let Some(config_file) = matches.value_of("config_file") {
|
("get", Some(subcommand_matches)) => {
|
||||||
let config = Config::load(config_file).unwrap_or_default();
|
if let Some(config_file) = matches.value_of("config_file") {
|
||||||
if let Some(field) = subcommand_matches.value_of("specific_setting") {
|
let config = Config::load(config_file).unwrap_or_default();
|
||||||
let (value, default_value) = match field {
|
if let Some(field) = subcommand_matches.value_of("specific_setting") {
|
||||||
"url" => (config.url, CliConfig::default_json_rpc_url()),
|
let (value, default_value) = match field {
|
||||||
"keypair" => (config.keypair_path, CliConfig::default_keypair_path()),
|
"url" => (config.url, CliConfig::default_json_rpc_url()),
|
||||||
_ => unreachable!(),
|
"keypair" => (config.keypair_path, CliConfig::default_keypair_path()),
|
||||||
};
|
_ => unreachable!(),
|
||||||
println_name_value_or(&format!("* {}:", field), &value, &default_value);
|
};
|
||||||
|
println_name_value_or(&format!("* {}:", field), &value, &default_value);
|
||||||
|
} else {
|
||||||
|
println_name_value("Wallet Config:", config_file);
|
||||||
|
println_name_value_or(
|
||||||
|
"* url:",
|
||||||
|
&config.url,
|
||||||
|
&CliConfig::default_json_rpc_url(),
|
||||||
|
);
|
||||||
|
println_name_value_or(
|
||||||
|
"* keypair:",
|
||||||
|
&config.keypair_path,
|
||||||
|
&CliConfig::default_keypair_path(),
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println_name_value("Wallet Config:", config_file);
|
println!(
|
||||||
println_name_value_or(
|
"{} Either provide the `--config` arg or ensure home directory exists to use the default config location",
|
||||||
"* url:",
|
style("No config file found.").bold()
|
||||||
&config.url,
|
|
||||||
&CliConfig::default_json_rpc_url(),
|
|
||||||
);
|
|
||||||
println_name_value_or(
|
|
||||||
"* keypair:",
|
|
||||||
&config.keypair_path,
|
|
||||||
&CliConfig::default_keypair_path(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
false
|
||||||
println!(
|
|
||||||
"{} Either provide the `--config` arg or ensure home directory exists to use the default config location",
|
|
||||||
style("No config file found.").bold()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
false
|
("set", Some(subcommand_matches)) => {
|
||||||
}
|
if let Some(config_file) = matches.value_of("config_file") {
|
||||||
("set", Some(subcommand_matches)) => {
|
let mut config = Config::load(config_file).unwrap_or_default();
|
||||||
if let Some(config_file) = matches.value_of("config_file") {
|
if let Some(url) = subcommand_matches.value_of("json_rpc_url") {
|
||||||
let mut config = Config::load(config_file).unwrap_or_default();
|
config.url = url.to_string();
|
||||||
if let Some(url) = subcommand_matches.value_of("json_rpc_url") {
|
}
|
||||||
config.url = url.to_string();
|
if let Some(keypair) = subcommand_matches.value_of("keypair") {
|
||||||
|
config.keypair_path = keypair.to_string();
|
||||||
|
}
|
||||||
|
config.save(config_file)?;
|
||||||
|
println_name_value("Wallet Config Updated:", config_file);
|
||||||
|
println_name_value("* url:", &config.url);
|
||||||
|
println_name_value("* keypair:", &config.keypair_path);
|
||||||
|
} else {
|
||||||
|
println!(
|
||||||
|
"{} Either provide the `--config` arg or ensure home directory exists to use the default config location",
|
||||||
|
style("No config file found.").bold()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if let Some(keypair) = subcommand_matches.value_of("keypair") {
|
false
|
||||||
config.keypair_path = keypair.to_string();
|
|
||||||
}
|
|
||||||
config.save(config_file)?;
|
|
||||||
println_name_value("Wallet Config Updated:", config_file);
|
|
||||||
println_name_value("* url:", &config.url);
|
|
||||||
println_name_value("* keypair:", &config.keypair_path);
|
|
||||||
} else {
|
|
||||||
println!(
|
|
||||||
"{} Either provide the `--config` arg or ensure home directory exists to use the default config location",
|
|
||||||
style("No config file found.").bold()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
false
|
_ => unreachable!(),
|
||||||
}
|
},
|
||||||
_ => true,
|
_ => true,
|
||||||
};
|
};
|
||||||
Ok(parse_args)
|
Ok(parse_args)
|
||||||
@ -207,25 +210,31 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
.help(SKIP_SEED_PHRASE_VALIDATION_ARG.help),
|
.help(SKIP_SEED_PHRASE_VALIDATION_ARG.help),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("get")
|
SubCommand::with_name("config")
|
||||||
.about("Get cli config settings")
|
.about("Solana command-line tool configuration settings")
|
||||||
.arg(
|
.aliases(&["get", "set"])
|
||||||
Arg::with_name("specific_setting")
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
.index(1)
|
.subcommand(
|
||||||
.value_name("CONFIG_FIELD")
|
SubCommand::with_name("get")
|
||||||
.takes_value(true)
|
.about("Get current config settings")
|
||||||
.possible_values(&["url", "keypair"])
|
.arg(
|
||||||
.help("Return a specific config setting"),
|
Arg::with_name("specific_setting")
|
||||||
),
|
.index(1)
|
||||||
)
|
.value_name("CONFIG_FIELD")
|
||||||
.subcommand(
|
.takes_value(true)
|
||||||
SubCommand::with_name("set")
|
.possible_values(&["url", "keypair"])
|
||||||
.about("Set a cli config setting")
|
.help("Return a specific config setting"),
|
||||||
.group(
|
),
|
||||||
ArgGroup::with_name("config_settings")
|
)
|
||||||
.args(&["json_rpc_url", "keypair"])
|
.subcommand(
|
||||||
.multiple(true)
|
SubCommand::with_name("set")
|
||||||
.required(true),
|
.about("Set a config setting")
|
||||||
|
.group(
|
||||||
|
ArgGroup::with_name("config_settings")
|
||||||
|
.args(&["json_rpc_url", "keypair"])
|
||||||
|
.multiple(true)
|
||||||
|
.required(true),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
@ -129,8 +129,9 @@ impl NonceSubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("get-nonce")
|
SubCommand::with_name("nonce")
|
||||||
.about("Get the current nonce value")
|
.about("Get the current nonce value")
|
||||||
|
.alias("get-nonce")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("nonce_account_pubkey")
|
Arg::with_name("nonce_account_pubkey")
|
||||||
.index(1)
|
.index(1)
|
||||||
@ -156,8 +157,9 @@ impl NonceSubCommands for App<'_, '_> {
|
|||||||
.arg(nonce_authority_arg()),
|
.arg(nonce_authority_arg()),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-nonce-account")
|
SubCommand::with_name("nonce-account")
|
||||||
.about("Show the contents of a nonce account")
|
.about("Show the contents of a nonce account")
|
||||||
|
.alias("show-nonce-account")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("nonce_account_pubkey")
|
Arg::with_name("nonce_account_pubkey")
|
||||||
.index(1)
|
.index(1)
|
||||||
@ -756,7 +758,7 @@ mod tests {
|
|||||||
// Test ShowNonceAccount Subcommand
|
// Test ShowNonceAccount Subcommand
|
||||||
let test_show_nonce_account = test_commands.clone().get_matches_from(vec![
|
let test_show_nonce_account = test_commands.clone().get_matches_from(vec![
|
||||||
"test",
|
"test",
|
||||||
"show-nonce-account",
|
"nonce-account",
|
||||||
&nonce_account_string,
|
&nonce_account_string,
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
@ -455,8 +455,9 @@ impl StakeSubCommands for App<'_, '_> {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-stake-account")
|
SubCommand::with_name("stake-account")
|
||||||
.about("Show the contents of a stake account")
|
.about("Show the contents of a stake account")
|
||||||
|
.alias("show-stake-account")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("stake_account_pubkey")
|
Arg::with_name("stake_account_pubkey")
|
||||||
.index(1)
|
.index(1)
|
||||||
@ -474,8 +475,9 @@ impl StakeSubCommands for App<'_, '_> {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-stake-history")
|
SubCommand::with_name("stake-history")
|
||||||
.about("Show the stake history")
|
.about("Show the stake history")
|
||||||
|
.alias("show-stake-history")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("lamports")
|
Arg::with_name("lamports")
|
||||||
.long("lamports")
|
.long("lamports")
|
||||||
|
@ -81,8 +81,9 @@ impl StorageSubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-storage-account")
|
SubCommand::with_name("storage-account")
|
||||||
.about("Show the contents of a storage account")
|
.about("Show the contents of a storage account")
|
||||||
|
.alias("show-storage-account")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("storage_account_pubkey")
|
Arg::with_name("storage_account_pubkey")
|
||||||
.index(1)
|
.index(1)
|
||||||
|
@ -3,7 +3,7 @@ use crate::{
|
|||||||
display::println_name_value,
|
display::println_name_value,
|
||||||
};
|
};
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
|
||||||
use reqwest::blocking::Client;
|
use reqwest::blocking::Client;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use serde_json::{Map, Value};
|
use serde_json::{Map, Value};
|
||||||
@ -151,6 +151,7 @@ impl ValidatorInfoSubCommands for App<'_, '_> {
|
|||||||
self.subcommand(
|
self.subcommand(
|
||||||
SubCommand::with_name("validator-info")
|
SubCommand::with_name("validator-info")
|
||||||
.about("Publish/get Validator info on Solana")
|
.about("Publish/get Validator info on Solana")
|
||||||
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("publish")
|
SubCommand::with_name("publish")
|
||||||
.about("Publish Validator info on Solana")
|
.about("Publish Validator info on Solana")
|
||||||
|
@ -157,8 +157,9 @@ impl VoteSubCommands for App<'_, '_> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("show-vote-account")
|
SubCommand::with_name("vote-account")
|
||||||
.about("Show the contents of a vote account")
|
.about("Show the contents of a vote account")
|
||||||
|
.alias("show-vote-account")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("vote_account_pubkey")
|
Arg::with_name("vote_account_pubkey")
|
||||||
.index(1)
|
.index(1)
|
||||||
|
@ -20,7 +20,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
.version(solana_clap_utils::version!())
|
.version(solana_clap_utils::version!())
|
||||||
.setting(AppSettings::SubcommandRequiredElseHelp)
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("get-rpc-url")
|
SubCommand::with_name("rpc-url")
|
||||||
.about("Get an RPC URL for the cluster")
|
.about("Get an RPC URL for the cluster")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("entrypoint")
|
Arg::with_name("entrypoint")
|
||||||
@ -243,7 +243,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
("get-rpc-url", Some(matches)) => {
|
("rpc-url", Some(matches)) => {
|
||||||
let any = matches.is_present("any");
|
let any = matches.is_present("any");
|
||||||
let all = matches.is_present("all");
|
let all = matches.is_present("all");
|
||||||
let entrypoint_addr = parse_entrypoint(&matches);
|
let entrypoint_addr = parse_entrypoint(&matches);
|
||||||
|
@ -56,7 +56,7 @@ done
|
|||||||
: "${storage_keypair:="$SOLANA_ROOT"/farf/archiver-storage-keypair"$label".json}"
|
: "${storage_keypair:="$SOLANA_ROOT"/farf/archiver-storage-keypair"$label".json}"
|
||||||
ledger="$SOLANA_ROOT"/farf/archiver-ledger"$label"
|
ledger="$SOLANA_ROOT"/farf/archiver-ledger"$label"
|
||||||
|
|
||||||
rpc_url=$($solana_gossip get-rpc-url --entrypoint "$entrypoint")
|
rpc_url=$($solana_gossip rpc-url --entrypoint "$entrypoint")
|
||||||
|
|
||||||
if [[ ! -r $identity_keypair ]]; then
|
if [[ ! -r $identity_keypair ]]; then
|
||||||
$solana_keygen new --no-passphrase -so "$identity_keypair"
|
$solana_keygen new --no-passphrase -so "$identity_keypair"
|
||||||
|
@ -100,9 +100,9 @@ $solana_keygen new --no-passphrase -so "$stake_keypair_path"
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
$solana_cli "${common_args[@]}" \
|
$solana_cli "${common_args[@]}" \
|
||||||
show-vote-account "$vote_keypair_path"
|
vote-account "$vote_keypair_path"
|
||||||
$solana_cli "${common_args[@]}" \
|
$solana_cli "${common_args[@]}" \
|
||||||
create-stake-account "$stake_keypair_path" "$stake_lamports" lamports
|
create-stake-account "$stake_keypair_path" "$stake_lamports" lamports
|
||||||
$solana_cli "${common_args[@]}" \
|
$solana_cli "${common_args[@]}" \
|
||||||
delegate-stake $maybe_force "$stake_keypair_path" "$vote_keypair_path"
|
delegate-stake $maybe_force "$stake_keypair_path" "$vote_keypair_path"
|
||||||
$solana_cli "${common_args[@]}" show-stake-account "$stake_keypair_path"
|
$solana_cli "${common_args[@]}" stake-account "$stake_keypair_path"
|
||||||
|
@ -250,7 +250,7 @@ wallet() {
|
|||||||
setup_validator_accounts() {
|
setup_validator_accounts() {
|
||||||
declare node_lamports=$1
|
declare node_lamports=$1
|
||||||
|
|
||||||
if ! wallet show-vote-account "$voting_keypair_path"; then
|
if ! wallet vote-account "$voting_keypair_path"; then
|
||||||
if ((airdrops_enabled)); then
|
if ((airdrops_enabled)); then
|
||||||
echo "Adding $node_lamports to validator identity account:"
|
echo "Adding $node_lamports to validator identity account:"
|
||||||
wallet airdrop "$node_lamports" lamports || return $?
|
wallet airdrop "$node_lamports" lamports || return $?
|
||||||
@ -261,7 +261,7 @@ setup_validator_accounts() {
|
|||||||
fi
|
fi
|
||||||
echo "Validator vote account configured"
|
echo "Validator vote account configured"
|
||||||
|
|
||||||
if ! wallet show-storage-account "$storage_keypair_path"; then
|
if ! wallet storage-account "$storage_keypair_path"; then
|
||||||
echo "Creating validator storage account"
|
echo "Creating validator storage account"
|
||||||
wallet create-validator-storage-account "$identity_keypair_path" "$storage_keypair_path" || return $?
|
wallet create-validator-storage-account "$identity_keypair_path" "$storage_keypair_path" || return $?
|
||||||
fi
|
fi
|
||||||
@ -273,7 +273,7 @@ setup_validator_accounts() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
rpc_url=$($solana_gossip get-rpc-url --entrypoint "$gossip_entrypoint" --any)
|
rpc_url=$($solana_gossip rpc-url --entrypoint "$gossip_entrypoint" --any)
|
||||||
|
|
||||||
[[ -r "$identity_keypair_path" ]] || $solana_keygen new --no-passphrase -so "$identity_keypair_path"
|
[[ -r "$identity_keypair_path" ]] || $solana_keygen new --no-passphrase -so "$identity_keypair_path"
|
||||||
[[ -r "$voting_keypair_path" ]] || $solana_keygen new --no-passphrase -so "$voting_keypair_path"
|
[[ -r "$voting_keypair_path" ]] || $solana_keygen new --no-passphrase -so "$voting_keypair_path"
|
||||||
|
@ -85,7 +85,7 @@ fi
|
|||||||
echo "+++ $sanityTargetIp: validators"
|
echo "+++ $sanityTargetIp: validators"
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
$solana_cli --url http://"$sanityTargetIp":8899 show-validators
|
$solana_cli --url http://"$sanityTargetIp":8899 validators
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "+++ $sanityTargetIp: node count ($numSanityNodes expected)"
|
echo "+++ $sanityTargetIp: node count ($numSanityNodes expected)"
|
||||||
|
@ -20,7 +20,7 @@ $solana_keygen new --no-passphrase -sf
|
|||||||
node_readiness=false
|
node_readiness=false
|
||||||
timeout=60
|
timeout=60
|
||||||
while [[ $timeout -gt 0 ]]; do
|
while [[ $timeout -gt 0 ]]; do
|
||||||
output=$($solana_cli "${args[@]}" get-transaction-count)
|
output=$($solana_cli "${args[@]}" transaction-count)
|
||||||
if [[ -n $output ]]; then
|
if [[ -n $output ]]; then
|
||||||
node_readiness=true
|
node_readiness=true
|
||||||
break
|
break
|
||||||
|
@ -59,7 +59,7 @@ function wait_for_bootstrap_leader_stake_drop {
|
|||||||
loadConfigFile
|
loadConfigFile
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
bootstrap_leader_validator_info="$(ssh "${sshOptions[@]}" "${validatorIpList[0]}" '$HOME/.cargo/bin/solana show-validators | grep "$($HOME/.cargo/bin/solana-keygen pubkey ~/solana/config/bootstrap-leader/identity-keypair.json)"')"
|
bootstrap_leader_validator_info="$(ssh "${sshOptions[@]}" "${validatorIpList[0]}" '$HOME/.cargo/bin/solana validators | grep "$($HOME/.cargo/bin/solana-keygen pubkey ~/solana/config/bootstrap-leader/identity-keypair.json)"')"
|
||||||
bootstrap_leader_stake_percentage="$(echo "$bootstrap_leader_validator_info" | awk '{gsub(/[\(,\),\%]/,""); print $9}')"
|
bootstrap_leader_stake_percentage="$(echo "$bootstrap_leader_validator_info" | awk '{gsub(/[\(,\),\%]/,""); print $9}')"
|
||||||
|
|
||||||
if [[ $(echo "$bootstrap_leader_stake_percentage < $max_stake" | bc) -ne 0 ]]; then
|
if [[ $(echo "$bootstrap_leader_stake_percentage < $max_stake" | bc) -ne 0 ]]; then
|
||||||
|
Reference in New Issue
Block a user