Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions docs/src/cli/deploy-a-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,42 +152,47 @@ Then issue a new `deploy` command and specify the buffer:
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
lamports. The buffer account can either be used to [resume a
deploy](#resuming-a-failed-deploy) or closed. When closed, the full balance of
the buffer account will be transferred to the recipient's account.
deploy](#resuming-a-failed-deploy) or closed.

The buffer account's authority must be present to close a buffer account, to
list all the open buffer accounts that match the default authority:
The program or buffer account's authority must be present to close an account,
to list all the open program or buffer accounts that match the default
authority:

```bash
solana program show --programs
solana program show --buffers
```

To specify a different authority:

```bash
solana program show --programs --buffer-authority <AURTHORITY_ADRESS>
solana program show --buffers --buffer-authority <AURTHORITY_ADRESS>
```

To close a single account:

```bash
solana program close <BUFFER_ADDRESS>
solana program close <BADDRESS>
```

To close a single account and specify a different authority than the default:

```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:

```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:
Expand Down