Skip to main content
Environment variables provide a flexible way to configure Erst without modifying configuration files, making them ideal for CI/CD pipelines, Docker containers, and dynamic environments.

Configuration variables

All configuration options can be set via environment variables using the ERST_ prefix.

Network and RPC

string
Single RPC endpoint URL for connecting to the Stellar network.
string
Comma-separated list of RPC URLs for automatic fallback.
string
Alternative to ERST_RPC_URLS. Comma-separated list of RPC URLs.
ERST_RPC_URLS takes precedence if both are set.
string
Network identifier: public, testnet, futurenet, or standalone.
string
Authentication token for RPC endpoints that require authorization.

Simulator configuration

string
Custom path to the erst-sim binary.
If not set, Erst searches in order:
  1. ./erst-sim (current directory)
  2. ./simulator/target/release/erst-sim (development path)
  3. System PATH

Logging

string
default:"info"
Unified log level for both the Go CLI and Rust simulator.Valid values: trace, debug, info, warn, error
The --verbose / -v flag is a shorthand that sets the log level to debug for that invocation.
string
Override Rust simulator logging independently. When both ERST_LOG_LEVEL and RUST_LOG are set, the simulator prefers ERST_LOG_LEVEL.

Storage and caching

string
default:"~/.erst/cache"
Directory for storing transaction traces and snapshots.

Request settings

number
default:"15"
HTTP request timeout in seconds. Must be an integer between 1 and 300.

Sandbox mode

number
Hard cap (in stroops) on the sum of native XLM payment amounts in transaction envelopes during simulation.Used in local/sandbox mode to simulate realistic economic constraints during integration tests.
Simulations exceeding this cap will fail before the simulator runs, with a clear error message.
Request-level sandbox_native_token_cap_stroops overrides this when set programmatically.

Crash reporting

boolean
default:"false"
Enable anonymous crash reporting.
Valid values: 1, true, yes (enable) or 0, false, no (disable)
string
default:"https://crash.erst.dev/v1/report"
Override the crash report collection endpoint.
string
Sentry DSN for crash reporting.

HSM configuration

string
Path to PKCS#11 module for Hardware Security Module (HSM) support.
number
default:"1000"
Maximum requests per minute to protect HSM from rate limiting.

Unified logging behavior

Setting ERST_LOG_LEVEL controls verbosity across the entire tool chain:
  1. The Go CLI reads the variable at startup to configure its slog logger
  2. When spawning the Rust simulator, it translates the value into a RUST_LOG filter
  3. Both processes honor the same log level
You can still override the Rust side independently by setting RUST_LOG directly. When both variables are present, the simulator prefers ERST_LOG_LEVEL.

Usage examples

Linux and macOS

Setting environment variables

Temporary override (single command)

Adding to shell profile

~/.bashrc or ~/.zshrc

Windows PowerShell

Setting environment variables

Persistent environment variables

Docker

Dockerfile

Docker Compose

docker-compose.yml

Docker run

CI/CD pipelines

GitHub Actions

.github/workflows/test.yml

GitLab CI

.gitlab-ci.yml

Custom network with environment variables

Sandbox token cap for integration tests

Simulate realistic economic constraints in CI:
Any simulation whose envelope contains native payments totaling more than the cap will fail before the simulator runs, with a clear error.
You can also set sandbox_native_token_cap_stroops on the simulation request when building it programmatically. The request value overrides the environment variable.

Best practices

Security

  1. Never commit secrets: Don’t commit .env files or API tokens to version control
  2. Use CI/CD secrets: Store sensitive values in your CI/CD platform’s secret management
  3. Restrict permissions: Use environment variables for credentials rather than config files

Organization

  1. Use .env files locally: Keep local development settings in .env (add to .gitignore)
  2. Document required variables: List all required environment variables in your README
  3. Provide example files: Include .env.example with dummy values

Development vs production

.env.development
.env.production

Troubleshooting

Verification

Check if environment variables are set:

Common issues

Ensure the variable is exported:
Use -e flag or environment in docker-compose:
Check variable naming and ensure they’re exported in the job environment, not just set as CI/CD variables.

Notes

  • All environment variables are optional and have sensible defaults
  • Environment variables override configuration file settings
  • Command-line flags override environment variables
  • The simulator binary path detection works out-of-the-box for development and production
  • If the simulator binary cannot be found, Erst displays a helpful error with setup instructions

Next steps

Configuration overview

Learn about all configuration methods

Custom networks

Configure private and local Stellar networks