Practical overview
When it fits
Use it when Go tests need an in-process Solana execution environment for program behavior, client transactions or configurable account and runtime fixtures, rather than a connection to a remote validator.
Who it is for
- Go developers testing Solana programs in an isolated in-process VM.
- Client developers who want to test transaction construction and outcomes with Go Solana types.
- Teams building account, sysvar or runtime-feature fixtures for Solana integration tests.
Documented uses
- Load a Solana program from bytes or a file for a test.
- Create, fund, inspect and modify accounts, and configure sysvars and runtime feature gates.
- Send or simulate legacy and versioned transactions, including v0 transactions with address-table lookups.
- Check transaction outcomes, logs, balances and transaction history within isolated VM instances.
Requirements & limits
The repository is public and identifies its license as Apache-2.0. The README specifies Go 1.25.7 or newer and local-path replacements for patched mithril and solana-go checkouts.
- It runs as pure Go in the test process and does not require a remote validator connection.
- The README requires Go 1.25.7 or newer and says patched mithril and solana-go dependencies must currently be supplied through local-path replacements.
- A LiteSVM handle is not safe for concurrent goroutine use without synchronization.
- Compute-budget configuration honors ComputeUnitLimit and HeapSize; other fields must keep the engine's defaults.
- Fresh VM instances include a default program set, including SPL Token, Token-2022, Memo, Associated Token Account, Address Lookup Table and Stake.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Litesvm Go in a Go project
Add the library to a Go project and account for the documented local dependency replacements.
Before you start
- Go 1.25.7 or newer.
- Local checkouts of the patched mithril and solana-go dependencies, because the README says the module contains local-path replace directives for them.
Steps
Run the command below in the Go project.
go get github.com/LiteSVM/litesvm-goPoint the two local-path replace directives in go.mod at your own patched mithril and solana-go checkouts.
Expected outcome
The library is added as a Go dependency with its documented local dependency paths configured.
Guide limitations
- The README says the patched dependencies have not yet been published.
- This setup guide does not establish that a project builds or that a test runs successfully.
Write an in-process Solana transfer test
Use the README's example flow to submit a signed legacy transfer to a LiteSVM instance and check the recipient balance.
Before you start
- Go 1.25.7 or newer and the library's documented local dependency replacements configured.
- The README's Go example uses litesvm-go and solana-go, including its system-program instructions.
Steps
Create a VM with
litesvm.New()and close it when the test ends.Create a payer key and recipient, then airdrop test lamports to the payer.
Get the VM's latest blockhash, build and sign a transfer with solana-go, and serialize the transaction.
Submit the bytes with
SendLegacyTransaction, check the outcome, and read the recipient balance withBalance.
Expected outcome
The example checks that the recipient's balance reflects the transfer after the VM processes it.
Guide limitations
- The README's sample is an example, not evidence of an independently executed test.
- A LiteSVM handle is not safe for concurrent use across goroutines; confine it to one goroutine or guard it with a mutex.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- LiteSVM/litesvm-go · Official homepage title · retained in its source language

