Usage
Description
Theexport 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
Subcommands
- export - Export state snapshot
- decode-memory - Decode and print linear memory dump
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
--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:- 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.