Files

1.8 KiB

Spel Framework Template

This project was generated with:

logos-scaffold new <name> --template lez-framework

It uses the Spel Framework for an ergonomic developer experience similar to Anchor on Solana:

  • #[lez_program] macro eliminates boilerplate
  • #[instruction] attribute marks instruction handlers
  • #[account(...)] annotations for account constraints and PDA derivation
  • Compile-time IDL generation via PROGRAM_IDL_JSON

First Run

logos-scaffold run
logos-scaffold doctor

logos-scaffold run includes build and IDL generation for lez-framework projects, then starts localnet, tops up the wallet, and deploys — all in one pipeline.

First run step-by-step (optional)

Run each phase run performs yourself when debugging a single step:

logos-scaffold setup
logos-scaffold localnet start
logos-scaffold build
logos-scaffold build idl
logos-scaffold deploy
logos-scaffold wallet topup
logos-scaffold doctor

Build

Equivalent to the build phase inside run; use it to iterate on the program without the full pipeline:

logos-scaffold build

IDL

Equivalent to the IDL phase inside run:

logos-scaffold build idl

Diagnostics Bundle

logos-scaffold report [--out PATH] [--tail N]

Inspect the generated archive before attaching it to public issues.

Project Structure

  • Program: methods/guest/src/bin/lez_counter.rs
  • Generated IDL: idl/lez_counter.json
  • Runner: src/bin/run_lez_counter.rs

Writing Programs

#[lez_program]
mod my_program {
    #[instruction]
    pub fn my_handler(
        #[account(init, pda = literal("state"))]
        state: AccountWithMetadata,
        #[account(signer)]
        authority: AccountWithMetadata,
    ) -> SpelResult {
        // your logic here
    }
}