Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 2.24 KB

File metadata and controls

88 lines (61 loc) · 2.24 KB

LazorKit Development Workflow

This document outlines the standard procedures for building, deploying, and testing the LazorKit program and its associated SDK.

Prerequisites

Project Structure

/program           Rust smart contract (pinocchio, zero-copy)
/sdk/solita-client  TypeScript SDK (Solita-generated + hand-written utils)
/tests-sdk          Integration tests (vitest, @solana/web3.js v1)
/scripts            Build/deploy automation
/audits             Audit reports
/no-padding         Custom NoPadding derive macro
/assertions         Custom assertion helpers

Core Workflows

A. Build Program

cargo build-sbf

B. Run Rust Tests

cargo test

C. IDL Generation (using Shank)

cd program && shank idl -o . --out-filename idl.json -p FLb7fyAtkfA4TSa2uYcAT8QKHd2pkoMHgmqfnXFXo7ao

D. SDK Generation (using Solita)

cd sdk/solita-client && node generate.mjs

The generate.mjs script reads the Shank IDL, enriches it with accounts/errors/types, and runs Solita to produce TypeScript code in src/generated/.

E. Running Integration Tests

# Terminal 1: Start local validator with program loaded
cd tests-sdk && npm run validator:start

# Terminal 2: Run all 56 tests
cd tests-sdk && npm test

F. Running Benchmarks

cd tests-sdk && npm run benchmark

Measures CU usage and transaction sizes for all instructions, including deferred execution (Authorize TX1 + ExecuteDeferred TX2).

G. Program ID Sync

./scripts/sync-program-id.sh <NEW_PROGRAM_ID>

H. Deploy to Devnet

cargo build-sbf
solana program deploy target/deploy/lazorkit_program.so -u d

Troubleshooting

  • 429 Too Many Requests: Check RPC credits or use local validator.
  • Already Initialized: Use fresh userSeed or reset validator with --reset.
  • InvalidSeeds: Verify PDA derivation matches on-chain seeds.
  • 0xbc0 (InvalidSessionDuration): expires_at must be a future slot, not Unix timestamp.