Skip to main content
Export debugging data, such as state snapshots and memory dumps, from the currently active session.

Usage

Description

The export command allows you to extract and save debugging data from an active session for:
  • Offline analysis
  • Sharing with team members
  • Integration with other tools
  • Creating reproducible test fixtures
  • Memory forensics
You must run erst debug <tx-hash> first to create an active session before using this command.

Subcommands

export

Export the current session’s ledger state and optionally WASM linear memory to a JSON snapshot file.

Flags

string
required
Output file for JSON snapshotThe snapshot will contain all ledger entries accessed during the transaction.
boolean
default:"false"
Include WASM linear memory dump from simulation responseOnly available if the simulator was configured to capture memory.

Examples

Output

With --include-memory:

Snapshot format

The exported JSON file contains:
  • ledger_entries: Map of ledger keys to XDR-encoded values
  • linear_memory: Base64-encoded WASM memory dump (if --include-memory)

decode-memory

Decode and display a hexdump of the linear memory from a snapshot file.

Flags

string
required
Snapshot file that contains linear memory
int
default:"0"
Start offset in bytesMust be >= 0 and within memory bounds.
int
default:"256"
Number of bytes to printMust be > 0.

Examples

Output format

Displays a hexdump with ASCII representation:
Format:
  • Address: Hexadecimal offset
  • Hex bytes: Up to 16 bytes per line
  • ASCII: Printable characters (. for non-printable)

Use cases

Create test fixtures

Export ledger state for unit tests:

Offline debugging

Export data for analysis without network:

Share debugging context

Share exact ledger state with team:

Memory forensics

Analyze WASM memory for debugging:

Compare states

Export before/after snapshots:

Snapshot files

Size

Snapshot file sizes vary based on:
  • Ledger entries: Typically 10-500 KB
  • Linear memory: Adds 64 KB - 4 MB (if included)

Compression

For large snapshots, consider compression:

Portability

Snapshots are portable across:
  • Different machines
  • Different OS platforms
  • Different Erst versions (same schema)
Snapshots use XDR encoding for ledger entries, making them network-agnostic and version-stable.

Error handling

No active session

Solution: Debug a transaction first:

No memory dump available

Cause: Simulator wasn’t configured to capture memory. Solution: This is expected - memory dumps are optional. The snapshot still contains all ledger state.

Invalid offset

Solution: Use a valid offset:
  • debug - Create sessions for export
  • session - Manage saved sessions
  • trace - Analyze execution traces