LogoLogo
GithubDiscordTwitter
  • Welcome
    • What is Clockwork?
    • Quickstart
    • Installation
  • Guides
    • 1. Scheduling an SPL transfer
    • 2. Auto-incrementing counter
  • Reference
    • Threads
      • Account
      • Address
      • Authority
      • Fees
      • Payers
      • Triggers
    • Localnet
    • SDK
    • Support
  • Node operators
    • Deploy a worker
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Reference
  2. Threads

Account

PreviousThreadsNextAddress

Last updated 2 years ago

Was this helpful?

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,

}
clockwork/thread.rs at main · clockwork-xyz/clockworkGitHub
thread.rs
Logo