Ask or search…
Comment on page


On Solana, we often say that everything is an account. Threads are no different. A thread account simply holds the on-chain state needed to schedule and execute a series of static and/or dynamic instructions on Solana.
pub struct Thread {
/// The owner of this thread.
pub authority: Pubkey,
/// The bump, used for PDA validation.
pub bump: u8,
/// The cluster clock at the moment the thread was created.
pub created_at: ClockData,
/// The context of the thread's current execution state.
pub exec_context: Option<ExecContext>,
/// The number of lamports to payout to workers per execution.
pub fee: u64,
/// The id of the thread, given by the authority.
pub id: Vec<u8>,
/// The instructions to be executed.
pub instructions: Vec<SerializableInstruction>,
/// The name of the thread.
pub name: String,
/// The next instruction to be executed.
pub next_instruction: Option<SerializableInstruction>,
/// Whether or not the thread is currently paused.
pub paused: bool,
/// The maximum number of execs allowed per slot.
pub rate_limit: u64,
/// The triggering event to kickoff a thread.
pub trigger: Trigger,