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:- Identifies the oldest cached files based on access time
- Prompts for confirmation before deletion (unless
--force) - Deletes files until cache size is reduced to 50% of maximum
- Reports number of files deleted and space freed
Flags
Skip confirmation promptAlias:
-fRemove entries older than N daysOnly applies to RPC cache (SQLite database).
Remove entries for a specific networkOptions:
testnet, mainnet, futurenetOnly applies to RPC cache.Remove all RPC cache entriesOnly applies to RPC cache (SQLite database).
Examples
clear
Delete all cached files from the cache directory.Usage
Flags
Skip confirmation promptAlias:
-fExamples
Confirmation prompt
Without--force, prompts:
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