Skip to content

okxlabs/sonar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

399 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sonar — Solana transaction simulator & utilities

A CLI for local Solana transaction simulation (LiteSVM) plus developer utilities.

  • Simulate transactions locally without deploying programs (raw tx, signature, or bundle)
  • Override programs/accounts, fund SOL or tokens, patch data
  • Store accounts once, replay without hitting RPC
  • Serialize/deserialize Borsh with a type descriptor DSL
  • Decode, convert, derive PDAs, inspect accounts, pull program ELF, send transactions

Installation

git clone https://github.com/user/sonar.git
cd sonar
cargo build --release
# Binary at target/release/sonar

Quick start

# Simulate a transaction locally
sonar simulate <BASE58_OR_BASE64_TX> --rpc-url https://api.mainnet-beta.solana.com

# Or fetch by signature (auto-detected)
sonar simulate <SIGNATURE> --rpc-url https://api.mainnet-beta.solana.com

# Decode an account
sonar account <PUBKEY> --rpc-url https://api.mainnet-beta.solana.com

Command reference

Command Use when
simulate Local execution logs, balance changes, and failure reasons
decode Transaction structure (instructions/accounts) without execution
replay Replay a confirmed transaction from on-chain metadata (no local simulation)
account Decoded account metadata/data for a pubkey
program-elf Raw ELF bytes from upgradeable program/buffer accounts
idl Fetch/sync Anchor IDLs or derive an IDL account address
send Submit a signed transaction to the network
borsh Serialize JSON to Borsh bytes or deserialize Borsh bytes to JSON
convert Format conversion
pda Derive a PDA from seeds
config Inspect or update ~/.config/sonar/config.toml
cache List, clean, or inspect cached account data
completions Generate shell completion scripts

Documentation

License

MIT

About

A CLI tool for local Solana transaction simulation (LiteSVM) plus common developer utilities

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages