Update program close docs (#22026)

This commit is contained in:
Jack May 2021-12-20 10:30:06 -08:00 committed by GitHub
parent eeb063b957
commit b8eff3456c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 8 deletions

View File

@ -152,42 +152,47 @@ Then issue a new `deploy` command and specify the buffer:
solana program deploy --buffer <KEYPAIR_PATH> <PROGRAM_FILEPATH> solana program deploy --buffer <KEYPAIR_PATH> <PROGRAM_FILEPATH>
``` ```
### Closing buffer accounts and reclaiming their lamports ### Closing program and buffer accounts, and reclaiming their lamports
Both program and buffer accounts can be closed and their lamport balances
transferred to a recipient's account.
If deployment fails there will be a left over buffer account that holds If deployment fails there will be a left over buffer account that holds
lamports. The buffer account can either be used to [resume a lamports. The buffer account can either be used to [resume a
deploy](#resuming-a-failed-deploy) or closed. When closed, the full balance of deploy](#resuming-a-failed-deploy) or closed.
the buffer account will be transferred to the recipient's account.
The buffer account's authority must be present to close a buffer account, to The program or buffer account's authority must be present to close an account,
list all the open buffer accounts that match the default authority: to list all the open program or buffer accounts that match the default
authority:
```bash ```bash
solana program show --programs
solana program show --buffers solana program show --buffers
``` ```
To specify a different authority: To specify a different authority:
```bash ```bash
solana program show --programs --buffer-authority <AURTHORITY_ADRESS>
solana program show --buffers --buffer-authority <AURTHORITY_ADRESS> solana program show --buffers --buffer-authority <AURTHORITY_ADRESS>
``` ```
To close a single account: To close a single account:
```bash ```bash
solana program close <BUFFER_ADDRESS> solana program close <BADDRESS>
``` ```
To close a single account and specify a different authority than the default: To close a single account and specify a different authority than the default:
```bash ```bash
solana program close <BUFFER_ADDRESS> --buffer-authority <KEYPAIR_FILEPATH> solana program close <ADDRESS> --buffer-authority <KEYPAIR_FILEPATH>
``` ```
To close a single account and specify a different recipient than the default: To close a single account and specify a different recipient than the default:
```bash ```bash
solana program close <BUFFER_ADDRESS> --recipient <RECIPIENT_ADDRESS> solana program close <ADDRESS> --recipient <RECIPIENT_ADDRESS>
``` ```
To close all the buffer accounts associated with the current authority: To close all the buffer accounts associated with the current authority: