#[repr(u8)]pub enum LoaderV4Instruction {
Write {
offset: u32,
bytes: Vec<u8>,
},
Truncate {
offset: u32,
},
Deploy,
Retract,
TransferAuthority,
}
Variants§
Write
Write ELF data into an undeployed program account.
Writing at the end (offset is length) increases the size of the program account and providing additional lamports (via the payer account) is necessary to reach rent exemption. The first write (at offset zero when the account is empty) automatically initializes the program account and sets the authority needed for subsequent writes. Thus, the first write should be in the same transaction as the account creation.
Account references
[writable]
The program account to write to.[signer]
The authority of the program.[signer]
Optional, the payer account.
Truncate
Decrease the size of an undeployed program account.
Decreasing to size zero closes the program account and resets it into an uninitialized state. Superflous lamports are transfered to the recipient account.
Account references
[writable]
The program account to change the size of.[signer]
The authority of the program.[writable]
The recipient account.
Deploy
Verify the data of a program account to be a valid ELF.
If this succeeds the program becomes executable, and is ready to use. A source program account can be provided to overwrite the data before deployment in one step, instead retracting the program and writing to it and redeploying it. The source program is truncated to zero (thus closed) and lamports necessary for rent exemption are transferred, in case that the source was bigger than the program.
Account references
[writable]
The program account to deploy.[signer]
The authority of the program.[writable]
Optional, an undeployed source program account to take data and lamports from.
Retract
Undo the deployment of a program account.
The program is no longer executable and goes into maintainance. Necessary for writing data and truncating.
Account references
[writable]
The program account to retract.[signer]
The authority of the program.
TransferAuthority
Transfers the authority over a program account.
WARNING: Using this instruction without providing a new authority finalizes the program (it becomes immutable).
Account references
[writable]
The program account to change the authority of.[signer]
The current authority of the program.[signer]
The new authority of the program. Optional if program is currently deployed.
Trait Implementations§
source§impl Clone for LoaderV4Instruction
impl Clone for LoaderV4Instruction
source§fn clone(&self) -> LoaderV4Instruction
fn clone(&self) -> LoaderV4Instruction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LoaderV4Instruction
impl Debug for LoaderV4Instruction
source§impl<'de> Deserialize<'de> for LoaderV4Instruction
impl<'de> Deserialize<'de> for LoaderV4Instruction
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<LoaderV4Instruction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<LoaderV4Instruction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for LoaderV4Instruction
impl PartialEq for LoaderV4Instruction
source§fn eq(&self, other: &LoaderV4Instruction) -> bool
fn eq(&self, other: &LoaderV4Instruction) -> bool
self
and other
values to be equal, and is used
by ==
.