Skip to main content
Erst is designed to solve the “black box” debugging experience on Soroban by helping you understand why a transaction failed. This guide walks you through the complete debugging workflow.

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:

Interactive trace viewer

Launch an interactive terminal UI to explore transaction execution traces:

Key features

  • 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) and N (previous)
  • Expand/collapse nodes with Enter or Space
  • Navigate with arrow keys or vim-style j/k
  • Expand all nodes with e
  • Collapse all nodes with c
  • Jump to start with Home or g
  • Jump to end with End or G
  • Page up/down with PgUp/PgDn
  • 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:
This is useful when:
  • Working with pre-downloaded transaction data
  • Debugging in air-gapped environments
  • Testing with custom transaction envelopes

Common debugging workflows

Search for specific errors

Trace 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.
When debug symbols are available, Erst can:
  • Show which Rust source line caused a failure
  • Generate GitHub links to source code locations
  • Provide more context about execution state
See the Source Mapping feature for setup instructions.

Error suggestions

Erst includes a heuristic-based engine that suggests potential fixes for common Soroban errors:
If a known error pattern is detected, you’ll see suggestions like:

Performance considerations

Caching

Erst automatically caches transaction data to improve performance:
Cached data enables:
  • 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

Solutions:
  • 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

Solutions:
  • 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

Solutions:
  • Transaction may have failed before execution started
  • Check that diagnostic events are enabled on your RPC
  • Try debugging with --verbose for more details

Next steps

Using flamegraphs

Profile CPU and memory usage during contract execution

Working with sessions

Save and resume debugging sessions

Local WASM replay

Test contracts locally without network access

Cache management

Optimize cache usage for faster debugging