Quasar
Getting Started

Quickstart

Build your first Quasar program in minutes.

alt

Scaffold a new project

quasar init my-program

The CLI prompts for toolchain, testing framework, and template. Skip prompts with flags:

quasar init my-program --toolchain solana --framework quasarsvm-rust --template minimal

Templates

MinimalFull
Use whenQuick start, prototypingProduction programs with multiple instructions
StructureEverything in src/lib.rsstate.rs, errors.rs, instructions/ modules

Key macros

MacroWhat it does
declare_id!Sets the program's on-chain address
#[program]Generates the entrypoint and dispatch table
#[instruction(discriminator = N)]Routes an instruction by its discriminator
#[derive(Accounts)]Generates account parsing and validation
#[account(discriminator = N)]Defines an on-chain account type
#[error_code]Defines custom program errors (ProgramError::Custom)

Scaffold with quasar add

Add instructions, state, and errors to your project. Flags can be combined:

quasar add -i transfer -s vault -e access
FlagWhat it creates
-i transfersrc/instructions/transfer.rs + wires it into lib.rs with the next discriminator
-s vault#[account] struct in src/state.rs with auto-incremented discriminator
-e access#[error_code] enum in src/errors.rs

Works on both templates. On minimal projects, -i creates the src/instructions/ directory and wires the module automatically.

Build, test, deploy

quasar build                # compile → target/deploy/my_program.so
quasar build --debug        # with debug symbols

quasar test                 # builds then runs the test suite
quasar test -f test_init    # filter by name
quasar test --features debug

quasar deploy --url devnet  # builds then deploys
quasar deploy --url devnet --skip-build --keypair ./payer.json

Next steps

On this page