Enum solana_sdk::loader_upgradeable_instruction::UpgradeableLoaderInstruction [−][src]
#[repr(u8)] pub enum UpgradeableLoaderInstruction { InitializeBuffer, Write { offset: u32, bytes: Vec<u8, Global>, }, DeployWithMaxDataLen { max_data_len: usize, }, Upgrade, SetAuthority, Close, }
Variants
Expand description
Initialize a Buffer account.
A Buffer account is an intermediary that once fully populated is used
with the DeployWithMaxDataLen
instruction to populate the program’s
ProgramData account.
The InitializeBuffer
instruction requires no signers and MUST be
included within the same Transaction as the system program’s
CreateAccount
instruction that creates the account being initialized.
Otherwise another party may initialize the account.
Account references
- [writable] source account to initialize.
- [] Buffer authority, optional, if omitted then the buffer will be immutable.
Expand description
Write program data into a Buffer account.
Account references
- [writable] Buffer account to write program data to.
- [signer] Buffer authority
Show fields
Expand description
Deploy an executable program.
A program consists of a Program and ProgramData account pair.
- The Program account’s address will serve as the program id for any instructions that execute this program.
- The ProgramData account will remain mutable by the loader only and holds the program data and authority information. The ProgramData account’s address is derived from the Program account’s address and created by the DeployWithMaxDataLen instruction.
The ProgramData address is derived from the Program account’s address as follows:
let (program_data_address, _) = Pubkey::find_program_address( &[program_address], &bpf_loader_upgradeable::id() );
The DeployWithMaxDataLen
instruction does not require the ProgramData
account be a signer and therefore MUST be included within the same
Transaction as the system program’s CreateAccount
instruction that
creates the Program account. Otherwise another party may initialize the
account.
Account references
- [signer] The payer account that will pay to create the ProgramData account.
- [writable] The uninitialized ProgramData account.
- [writable] The uninitialized Program account.
- [writable] The Buffer account where the program data has been written. The buffer account’s authority must match the program’s authority
- [] Rent sysvar.
- [] Clock sysvar.
- [] System program (
solana_sdk::system_program::id()
). - [signer] The program’s authority
Show fields
Fields of DeployWithMaxDataLen
max_data_len: usize
Expand description
Maximum length that the program can be upgraded to.
Expand description
Upgrade a program.
A program can be updated as long as the program’s authority has not been
set to None
.
The Buffer account must contain sufficient lamports to fund the ProgramData account to be rent-exempt, any additional lamports left over will be transferred to the spill account, leaving the Buffer account balance at zero.
Account references
- [writable] The ProgramData account.
- [writable] The Program account.
- [writable] The Buffer account where the program data has been written. The buffer account’s authority must match the program’s authority
- [writable] The spill account.
- [] Rent sysvar.
- [] Clock sysvar.
- [signer] The program’s authority.
Expand description
Set a new authority that is allowed to write the buffer or upgrade the program. To permanently make the buffer immutable or disable program updates omit the new authority.
Account references
[writable]
The Buffer or ProgramData account to change the authority of.[signer]
The current authority.[]
The new authority, optional, if omitted then the program will not be upgradeable.
Expand description
Closes an account owned by the upgradeable loader of all lamports and withdraws all the lamports
Account references
[writable]
The account to close.[writable]
The account to deposit the closed account’s lamports.[signer]
The account’s authority.
Trait Implementations
impl Clone for UpgradeableLoaderInstruction
[src]
impl Clone for UpgradeableLoaderInstruction
[src]pub fn clone(&self) -> UpgradeableLoaderInstruction
[src]
pub fn clone(&self) -> UpgradeableLoaderInstruction
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for UpgradeableLoaderInstruction
[src]
impl Debug for UpgradeableLoaderInstruction
[src]impl<'de> Deserialize<'de> for UpgradeableLoaderInstruction
[src]
impl<'de> Deserialize<'de> for UpgradeableLoaderInstruction
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<UpgradeableLoaderInstruction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<UpgradeableLoaderInstruction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl PartialEq<UpgradeableLoaderInstruction> for UpgradeableLoaderInstruction
[src]
impl PartialEq<UpgradeableLoaderInstruction> for UpgradeableLoaderInstruction
[src]pub fn eq(&self, other: &UpgradeableLoaderInstruction) -> bool
[src]
pub fn eq(&self, other: &UpgradeableLoaderInstruction) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &UpgradeableLoaderInstruction) -> bool
[src]
pub fn ne(&self, other: &UpgradeableLoaderInstruction) -> bool
[src]This method tests for !=
.
impl Serialize for UpgradeableLoaderInstruction
[src]
impl Serialize for UpgradeableLoaderInstruction
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
impl Eq for UpgradeableLoaderInstruction
[src]
impl StructuralEq for UpgradeableLoaderInstruction
[src]
impl StructuralPartialEq for UpgradeableLoaderInstruction
[src]
Auto Trait Implementations
impl RefUnwindSafe for UpgradeableLoaderInstruction
impl Send for UpgradeableLoaderInstruction
impl Sync for UpgradeableLoaderInstruction
impl Unpin for UpgradeableLoaderInstruction
impl UnwindSafe for UpgradeableLoaderInstruction
Blanket Implementations
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
[src]
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
[src]pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
[src]
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
[src]
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
[src]pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
[src]
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiExample for T
[src]
impl<T> AbiExample for T
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,