Quick start
Debug a failed transaction from any Stellar network:By default, Erst fetches transaction data from mainnet. Use
--network to specify testnet or other networks.Understanding transaction failures
When a Soroban transaction fails on mainnet, you typically receive a generic XDR error code. Erst bridges the gap between this opaque network error and your source code by:The transaction is re-executed locally using the
erst-sim Rust binary that integrates with soroban-env-host.Interactive trace viewer
Launch an interactive terminal UI to explore transaction execution traces:Key features
Search functionality
Search functionality
- Press
/to search through traces - Search across contract IDs, functions, errors, and events
- Case-insensitive by default
- Highlights all matches in yellow
- Current match highlighted in green
- Shows “Match X of Y” status
- Jump between matches with
n(next) andN(previous)
Tree navigation
Tree navigation
Visual styling
Visual styling
- Color-coded elements:
- Contract IDs in cyan
- Function names in blue
- Errors in red
- Search matches in yellow
- Depth indentation for clear hierarchy
- Visual indicators for expanded (v) and collapsed (>) nodes
Keyboard shortcuts
Debugging offline
Debug a transaction envelope from stdin without RPC access:- Working with pre-downloaded transaction data
- Debugging in air-gapped environments
- Testing with custom transaction envelopes
Common debugging workflows
Search for specific errors
insufficient - Find balance/permission errorsnot found - Locate missing data errorsTrace execution flow
Find contract interactions
Source mapping
To map WASM instruction failures to Rust source code lines, you need to compile your contracts with debug symbols enabled.
- Show which Rust source line caused a failure
- Generate GitHub links to source code locations
- Provide more context about execution state
Error suggestions
Erst includes a heuristic-based engine that suggests potential fixes for common Soroban errors:Performance considerations
Caching
Erst automatically caches transaction data to improve performance:- Faster repeated debugging of the same transaction
- Offline analysis after initial fetch
- Reduced load on RPC endpoints
Network timeout
For slow or unreliable networks, increase the timeout:Troubleshooting
Transaction not found
- Verify the transaction hash is correct
- Check you’re using the right network (
--network testnet) - Ensure the transaction exists on the specified network
- Try a different RPC endpoint if available
XDR decode error
- Check that the XDR format is correct
- Verify you’re not mixing testnet and mainnet data
- Ensure the XDR isn’t truncated or corrupted
Empty trace output
- Transaction may have failed before execution started
- Check that diagnostic events are enabled on your RPC
- Try debugging with
--verbosefor more details