Skip to main content
Manage the local cache that stores transaction data and simulation results.

Usage

Description

Caching improves performance and enables offline analysis by storing:
  • Transaction envelopes and metadata
  • Simulation results and traces
  • Ledger entries and state
  • RPC responses
Cache location: ~/.erst/cache (configurable via ERST_CACHE_DIR environment variable)

Subcommands

  • status - View cache statistics
  • clean - Remove old files using LRU strategy
  • clear - Delete all cached data

status

Display the current cache size, number of cached files, and disk usage statistics.

Usage

Output

Shows:
  • Cache directory path
  • Total cache size (human-readable)
  • Number of cached files
  • Maximum configured size
  • Warning if cache exceeds limit

Example output

clean

Remove old cached files using LRU (Least Recently Used) strategy.

Usage

Description

This command:
  1. Identifies the oldest cached files based on access time
  2. Prompts for confirmation before deletion (unless --force)
  3. Deletes files until cache size is reduced to 50% of maximum
  4. Reports number of files deleted and space freed

Flags

boolean
default:"false"
Skip confirmation promptAlias: -f
int
Remove entries older than N daysOnly applies to RPC cache (SQLite database).
string
Remove entries for a specific networkOptions: testnet, mainnet, futurenetOnly applies to RPC cache.
boolean
default:"false"
Remove all RPC cache entriesOnly applies to RPC cache (SQLite database).

Examples

clear

Delete all cached files from the cache directory.

Usage

This action cannot be undone. All cached transaction data and simulation results will be permanently deleted.

Flags

boolean
default:"false"
Skip confirmation promptAlias: -f

Examples

Confirmation prompt

Without --force, prompts:
Type yes or y to confirm.

Cache types

Erst maintains two separate caches:

File cache

Stores transaction and simulation data as files:
  • Location: ~/.erst/cache/
  • Format: JSON and XDR files
  • Managed by: status, clean, clear

RPC cache

Stores RPC responses in SQLite database:
  • Location: ~/.erst/cache.db
  • Format: SQLite database
  • Managed by: clean --older-than, clean --network, clean --all

Performance impact

Caching provides significant performance benefits:
  • Network requests: Avoid repeated RPC calls
  • Simulation: Reuse ledger state for similar transactions
  • Offline mode: Debug without network connectivity
  • Cost reduction: Minimize API usage for rate-limited endpoints
  • session - Manage debugging sessions (separate from cache)
  • debug - Debugging uses cached data when available