The
debug command is the primary entry point for debugging Soroban transactions. It fetches transaction data from the network, simulates execution locally, and provides detailed error traces.Usage
Description
Thedebug command helps you understand why a Soroban transaction failed by:
- Fetching the transaction envelope and ledger state from the network
- Simulating execution locally with detailed instrumentation
- Decoding errors and mapping them to readable instructions
- Tracking token flows and contract events
- Generating execution traces for further analysis
Examples
Flags
Network configuration
Stellar network to use:
testnet, mainnet, or futurenetCustom Soroban RPC URL (overrides default for network)
RPC authentication token (can also use
ERST_RPC_TOKEN env var)Local testing
Path to local WASM file for testing without deploying
Run dead-code elimination on local WASM before simulation
Mock arguments to pass to the local WASM execution
Output options
Print detailed simulation output and diagnostic informationAlias:
-vLaunch interactive trace viewer after debuggingAlias:
-iColor theme for output:
default, deuteranopia, protanopia, tritanopia, or high-contrastAdvanced options
Override protocol version for simulation (20, 21, 22, etc.)
Path to erst-sim binary (overrides auto-discovery)
Interactive mode
When using--interactive, the debug command launches a terminal UI with:
- Search: Press
/to search through traces - Navigation: Use arrow keys to expand/collapse nodes
- Help: Press
?orhto see all keyboard shortcuts - Syntax highlighting: Color-coded contract IDs, functions, and errors
- Match counter: See “Match 2 of 5” while searching
Performance profiling
When using--profile, generates an interactive flamegraph visualizing CPU and memory consumption:
- Hover tooltips with frame details
- Click-to-zoom for specific call stacks
- Search/highlight to find frames by name
- Dark mode support