Complete, runnable examples demonstrating litesvm-go. Each example is a
self-contained Go test you can drop into a package and run with go test.
SOL Transfer
Build and send a system-program transfer
Account Setup
Seed test accounts and program data state
Program Testing
Load and exercise custom SBF programs
Time-Based Testing
Test time-dependent logic with WarpToSlot / SetClock
Running Examples
# 1) Initialize a Go module (skip if you already have a go.mod)go mod init mytest# 2) Add the dependencies to your Go projectgo get github.com/LiteSVM/litesvm-gogo get github.com/gagliardetto/solana-go# 3) Drop an example into a _test.go file and rungo test ./...
On Alpine / musl, add -tags musl to your go test invocation so the right
vendored archive is linked.
For a standalone command-line example (no test runner), see
examples/transfer/main.go
in the litesvm-go repo.
Is this page helpful?