#[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
Tagi instrukcji (pierwszy bajt danych).
Variants§
Initialize = 0
Inicjalizacja programu. Konta: [admin (signer, payer), config (PDA), mint, round0 (PDA), system_program] Wymagania wobec minta (tworzonego poza programem przed initialize): decimals = 9, mint_authority = PDA “treasury”, freeze_authority = None.
Register = 1
Rejestracja minera. Konta: [authority (signer, payer), miner (PDA), slot_hashes, system_program]
AuthorizeSession = 2
Ustawienie session keya (podpisuje submity w tle). Konta: [authority (signer), miner] Dane: session_key [u8;32] (zera = odwołanie)
Mine = 3
Submit hasha (raz na rundę): weryfikacja PoW, naliczenie wagi, rozliczenie poprzedniej rundy (lazy). Konta: [signer (authority lub session), miner, config, current_round, prev_round, token_account (ATA authority), slot_hashes] Dane: nonce u64 LE
Claim = 4
Odbiór naliczonych nagród (mint do ATA authority). Konta: [authority (signer), miner, config, prev_round, mint, treasury (PDA), token_account (ATA authority), token_program]
Crank = 5
Zamknięcie rundy i otwarcie kolejnej (permissionless crank). Konta: [payer (signer), config, new_round (PDA), system_program]
CloseRound = 6
Zamknięcie starego konta rundy po retencji (rent dla wołającego). Konta: [recipient (signer), config, round]
UpdateConfig = 7
Zmiana parametrów przez admina. Konta: [admin (signer), config] Dane: min_difficulty u64 LE, base_weight u64 LE, round_seconds u64 LE
SetAdmin = 8
Przekazanie roli admina (docelowo: multisig z timelockiem). Konta: [admin (signer), config] Dane: 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