2018-11-08 14:42:20 -08:00
|
|
|
## solana-wallet CLI
|
|
|
|
|
|
|
|
The [solana crate](https://crates.io/crates/solana) is distributed with a command-line interface tool
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
|
|
|
#### Get Pubkey
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet address
|
|
|
|
|
|
|
|
// Return
|
|
|
|
<PUBKEY>
|
|
|
|
```
|
|
|
|
|
2019-03-05 17:17:50 -08:00
|
|
|
#### Airdrop Lamports
|
2018-11-08 14:42:20 -08:00
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet airdrop 123
|
|
|
|
|
|
|
|
// Return
|
|
|
|
"Your balance is: 123"
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Get Balance
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet balance
|
|
|
|
|
|
|
|
// Return
|
|
|
|
"Your balance is: 123"
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Confirm Transaction
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet confirm <TX_SIGNATURE>
|
|
|
|
|
|
|
|
// Return
|
2019-04-05 20:25:50 -07:00
|
|
|
"Confirmed" / "Not found" / "Transaction failed with error <ERR>"
|
2018-11-08 14:42:20 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Deploy program
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet deploy <PATH>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
<PROGRAM_ID>
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Unconditional Immediate Transfer
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet pay <PUBKEY> 123
|
|
|
|
|
|
|
|
// Return
|
|
|
|
<TX_SIGNATURE>
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Post-Dated Transfer
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet pay <PUBKEY> 123 \
|
|
|
|
--after 2018-12-24T23:59:00 --require-timestamp-from <PUBKEY>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
{signature: <TX_SIGNATURE>, processId: <PROCESS_ID>}
|
|
|
|
```
|
|
|
|
*`require-timestamp-from` is optional. If not provided, the transaction will expect a timestamp signed by this wallet's secret key*
|
|
|
|
|
|
|
|
#### Authorized Transfer
|
|
|
|
|
2019-03-05 17:17:50 -08:00
|
|
|
A third party must send a signature to unlock the lamports.
|
2018-11-08 14:42:20 -08:00
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet pay <PUBKEY> 123 \
|
|
|
|
--require-signature-from <PUBKEY>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
{signature: <TX_SIGNATURE>, processId: <PROCESS_ID>}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Post-Dated and Authorized Transfer
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet pay <PUBKEY> 123 \
|
|
|
|
--after 2018-12-24T23:59 --require-timestamp-from <PUBKEY> \
|
|
|
|
--require-signature-from <PUBKEY>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
{signature: <TX_SIGNATURE>, processId: <PROCESS_ID>}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Multiple Witnesses
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet pay <PUBKEY> 123 \
|
|
|
|
--require-signature-from <PUBKEY> \
|
|
|
|
--require-signature-from <PUBKEY>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
{signature: <TX_SIGNATURE>, processId: <PROCESS_ID>}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Cancelable Transfer
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet pay <PUBKEY> 123 \
|
|
|
|
--require-signature-from <PUBKEY> \
|
|
|
|
--cancelable
|
|
|
|
|
|
|
|
// Return
|
|
|
|
{signature: <TX_SIGNATURE>, processId: <PROCESS_ID>}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Cancel Transfer
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet cancel <PROCESS_ID>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
<TX_SIGNATURE>
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Send Signature
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet send-signature <PUBKEY> <PROCESS_ID>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
<TX_SIGNATURE>
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Indicate Elapsed Time
|
|
|
|
|
|
|
|
Use the current system time:
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet send-timestamp <PUBKEY> <PROCESS_ID>
|
|
|
|
|
|
|
|
// Return
|
|
|
|
<TX_SIGNATURE>
|
|
|
|
```
|
|
|
|
|
|
|
|
Or specify some other arbitrary timestamp:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
// Command
|
|
|
|
$ solana-wallet send-timestamp <PUBKEY> <PROCESS_ID> --date 2018-12-24T23:59:00
|
|
|
|
|
|
|
|
// Return
|
|
|
|
<TX_SIGNATURE>
|
|
|
|
```
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet 0.12.0
|
2018-11-08 14:42:20 -08:00
|
|
|
|
|
|
|
USAGE:
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet [FLAGS] [OPTIONS] [SUBCOMMAND]
|
2018-11-08 14:42:20 -08:00
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
2019-01-16 20:43:00 -08:00
|
|
|
--rpc-tls Enable TLS for the RPC endpoint
|
2018-11-08 14:42:20 -08:00
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
OPTIONS:
|
2019-01-16 20:43:00 -08:00
|
|
|
--drone-host <IP ADDRESS> Drone host to use [default: same as --host]
|
|
|
|
--drone-port <PORT> Drone port to use [default: 9900]
|
|
|
|
-n, --host <IP ADDRESS> Host to use for both RPC and drone [default: 127.0.0.1]
|
|
|
|
-k, --keypair <PATH> /path/to/id.json
|
|
|
|
--rpc-host <IP ADDRESS> RPC host to use [default: same as --host]
|
|
|
|
--rpc-port <PORT> RPC port to use [default: 8899]
|
2018-11-08 14:42:20 -08:00
|
|
|
|
|
|
|
SUBCOMMANDS:
|
|
|
|
address Get your public key
|
2019-03-05 17:17:50 -08:00
|
|
|
airdrop Request a batch of lamports
|
2018-11-08 14:42:20 -08:00
|
|
|
balance Get your balance
|
|
|
|
cancel Cancel a transfer
|
|
|
|
confirm Confirm transaction by signature
|
|
|
|
deploy Deploy a program
|
|
|
|
get-transaction-count Get current transaction count
|
|
|
|
help Prints this message or the help of the given subcommand(s)
|
|
|
|
pay Send a payment
|
|
|
|
send-signature Send a signature to authorize a transfer
|
|
|
|
send-timestamp Send a timestamp to unlock a transfer
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-address
|
2018-11-08 14:42:20 -08:00
|
|
|
Get your public key
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet address
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-airdrop
|
2019-03-05 17:17:50 -08:00
|
|
|
Request a batch of lamports
|
2018-11-08 14:42:20 -08:00
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet airdrop <NUM>
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
ARGS:
|
2019-03-05 17:17:50 -08:00
|
|
|
<NUM> The number of lamports to request
|
2018-11-08 14:42:20 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-balance
|
2018-11-08 14:42:20 -08:00
|
|
|
Get your balance
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet balance
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-cancel
|
2018-11-08 14:42:20 -08:00
|
|
|
Cancel a transfer
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet cancel <PROCESS_ID>
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
ARGS:
|
|
|
|
<PROCESS_ID> The process id of the transfer to cancel
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-confirm
|
2018-11-08 14:42:20 -08:00
|
|
|
Confirm transaction by signature
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet confirm <SIGNATURE>
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
ARGS:
|
|
|
|
<SIGNATURE> The transaction signature to confirm
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-deploy
|
2018-11-08 14:42:20 -08:00
|
|
|
Deploy a program
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet deploy <PATH>
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
ARGS:
|
|
|
|
<PATH> /path/to/program.o
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-get-transaction-count
|
2018-11-08 14:42:20 -08:00
|
|
|
Get current transaction count
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet get-transaction-count
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-pay
|
2018-11-08 14:42:20 -08:00
|
|
|
Send a payment
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet pay [FLAGS] [OPTIONS] <PUBKEY> <NUM>
|
|
|
|
|
|
|
|
FLAGS:
|
2019-01-16 20:43:00 -08:00
|
|
|
--cancelable
|
2018-11-08 14:42:20 -08:00
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
OPTIONS:
|
|
|
|
--after <DATETIME> A timestamp after which transaction will execute
|
|
|
|
--require-timestamp-from <PUBKEY> Require timestamp from this third party
|
2019-03-05 17:17:50 -08:00
|
|
|
--require-signature-from <PUBKEY>... Any third party signatures required to unlock the lamports
|
2018-11-08 14:42:20 -08:00
|
|
|
|
|
|
|
ARGS:
|
|
|
|
<PUBKEY> The pubkey of recipient
|
2019-03-05 17:17:50 -08:00
|
|
|
<NUM> The number of lamports to send
|
2018-11-08 14:42:20 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-send-signature
|
2018-11-08 14:42:20 -08:00
|
|
|
Send a signature to authorize a transfer
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet send-signature <PUBKEY> <PROCESS_ID>
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
ARGS:
|
|
|
|
<PUBKEY> The pubkey of recipient
|
|
|
|
<PROCESS_ID> The process id of the transfer to authorize
|
|
|
|
```
|
|
|
|
|
|
|
|
```manpage
|
2019-01-16 20:43:00 -08:00
|
|
|
solana-wallet-send-timestamp
|
2018-11-08 14:42:20 -08:00
|
|
|
Send a timestamp to unlock a transfer
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
solana-wallet send-timestamp [OPTIONS] <PUBKEY> <PROCESS_ID>
|
|
|
|
|
|
|
|
FLAGS:
|
|
|
|
-h, --help Prints help information
|
|
|
|
-V, --version Prints version information
|
|
|
|
|
|
|
|
OPTIONS:
|
|
|
|
--date <DATETIME> Optional arbitrary timestamp to apply
|
|
|
|
|
|
|
|
ARGS:
|
|
|
|
<PUBKEY> The pubkey of recipient
|
|
|
|
<PROCESS_ID> The process id of the transfer to unlock
|
|
|
|
```
|