#[repr(u8)]pub enum MinerInstruction {
Initialize = 0,
Register = 1,
AuthorizeSession = 2,
Mine = 3,
Claim = 4,
Crank = 5,
CloseRound = 6,
UpdateConfig = 7,
SetAdmin = 8,
}Expand description
Instruction tags (first byte of instruction data).
Variants§
Initialize = 0
Program initialization. Accounts: [admin (signer, payer), config (PDA), mint, round0 (PDA), system_program] Mint requirements (created outside the program before initialize): decimals = 9, mint_authority = “treasury” PDA, freeze_authority = None.
Register = 1
Miner registration. Accounts: [authority (signer, payer), miner (PDA), slot_hashes, system_program]
AuthorizeSession = 2
Set a session key (signs background submits). Accounts: [authority (signer), miner] Data: session_key [u8;32] (zeros = revoke)
Mine = 3
Hash submission (once per round): PoW verification, weight accrual, lazy settlement of the previous round. Accounts: [signer (authority or session), miner, config, current_round, prev_round, token_account (authority ATA), slot_hashes] Data: nonce u64 LE
Claim = 4
Claim accrued rewards (mint to the authority’s ATA). Accounts: [authority (signer), miner, config, prev_round, mint, treasury (PDA), token_account (authority ATA), token_program]
Crank = 5
Close the current round and open the next (permissionless crank). Accounts: [payer (signer), config, new_round (PDA), system_program]
CloseRound = 6
Close an expired Round account after retention (rent to the caller). Accounts: [recipient (signer), config, round]
UpdateConfig = 7
Admin parameter change. Accounts: [admin (signer), config] Data: min_difficulty u64 LE, base_weight u64 LE, round_seconds u64 LE
SetAdmin = 8
Admin role handover (ultimately: a multisig with a timelock). Accounts: [admin (signer), config] Data: new_admin [u8;32]
Implementations§
Trait Implementations§
Source§impl Clone for MinerInstruction
impl Clone for MinerInstruction
Source§fn clone(&self) -> MinerInstruction
fn clone(&self) -> MinerInstruction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more