Skip to content

Commit

Permalink
Add stake-account to docs (solana-labs#9010)
Browse files Browse the repository at this point in the history
  • Loading branch information
garious authored Mar 22, 2020
1 parent 4bbb0b1 commit ba52783
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* [Paper Wallet Usage](paper-wallet/usage.md)
* [Generate Keys](cli/generate-keys.md)
* [Send and Receive Tokens](cli/transfer-tokens.md)
* [Earn Staking Rewards](cli/delegate-stake.md)
* [Delegate Stake](cli/delegate-stake.md)
* [Offline Signing](offline-signing/README.md)
* [Durable Transaction Nonces](offline-signing/durable-nonce.md)
* [Command-line Reference](cli/usage.md)
Expand Down
37 changes: 36 additions & 1 deletion src/cli/delegate-stake.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Earn Staking Rewards
# Delegate Stake

After you have [received SOL](transfer-tokens.md), you might consider putting
it to use by delegating *stake* to a validator. Stake is what we call tokens
Expand Down Expand Up @@ -43,6 +43,21 @@ The stake-account.json file can now be discarded. To authorize additional
actions, you will use the `--stake-authority` or `withdraw-authority` keypair,
not stake-account.json.

View the new stake account with the `solana stake-account` command:

```bash
solana stake-account <STAKE_ACCOUNT_ADDRESS>
```

The output will look similar to this:

```text
Total Stake: 5000 SOL
Stake account is undelegated
Stake Authority: EXU95vqs93yPeCeAU7mPPu6HbRUmTFPEiGug9oCdvQ5F
Withdraw Authority: EXU95vqs93yPeCeAU7mPPu6HbRUmTFPEiGug9oCdvQ5F
```

### Set Stake and Withdraw Authorities

Staking commands look to keypairs to authorize certain stake account
Expand Down Expand Up @@ -114,6 +129,26 @@ solana delegate-stake --stake-authority=<KEYPAIR> <STAKE_ACCOUNT_ADDRESS> <VOTE_
`<STAKE_ACCOUNT_ADDRESS>`. The stake is delegated to the vote account with
address `<VOTE_ACCOUNT_ADDRESS>`.

After delegating stake, use `solana stake-account` to observe the changes
to the stake account:

```bash
solana stake-account <STAKE_ACCOUNT_ADDRESS>
```

You will see new fields "Delegated Stake" and "Delegated Vote Account Address"
in the output. The output will look similar to this:

```text
Total Stake: 5000 SOL
Credits Observed: 147462
Delegated Stake: 4999.99771712 SOL
Delegated Vote Account Address: CcaHc2L43ZWjwCHART3oZoJvHLAe9hzT2DJNUpBzoTN1
Stake activates starting from epoch: 42
Stake Authority: EXU95vqs93yPeCeAU7mPPu6HbRUmTFPEiGug9oCdvQ5F
Withdraw Authority: EXU95vqs93yPeCeAU7mPPu6HbRUmTFPEiGug9oCdvQ5F
```

## Deactivate Stake

Once delegated, you can undelegate stake with the `solana deactivate-stake`
Expand Down

0 comments on commit ba52783

Please sign in to comment.