docs: write-buffer clarifications (#34366)

* docs: write-buffer clarifications

* clarifying adjustments (review-based)

---------

Co-authored-by: norwnd <norwnd>
This commit is contained in:
norwnd 2023-12-11 11:57:19 +00:00 committed by GitHub
parent 2971e84ec8
commit bbeca163b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -282,14 +282,24 @@ intermediary buffer contents and then vote to allow an upgrade using it.
solana program write-buffer <PROGRAM_FILEPATH>
```
Buffer accounts support authorities like program accounts:
Buffer accounts are managed by an authority. To create a buffer and specify a different
authority than the default:
```bash
solana program write-buffer <PROGRAM_FILEPATH> --buffer-authority <BUFFER_AUTHORITY_SIGNER>
```
Only the buffer authority may write to the buffer, so the `--buffer-authority` above must be a
**signer**, and not an address. This requirement limits usage with offline signers.
To use an offline address as a buffer authority, the buffer account must be initialized and
written with an online keypair, and then the buffer authority must be assigned using
`solana program set-buffer-authority`:
```bash
solana program set-buffer-authority <BUFFER_ADDRESS> --new-buffer-authority <NEW_BUFFER_AUTHORITY>
```
One exception is that buffer accounts cannot be marked immutable like program
accounts can, so they don't support `--final`.
Unlike program accounts buffer accounts cannot be marked immutable, so they don't support the `--final` option.
The buffer account, once entirely written, can be passed to `deploy` to deploy
the program: