solana-cliv2.1.7
Use the .env.example file to create a .env file.
This is the bare minimum setup to run the recipes.
This project uses two environment files:
-
.env: Contains initial configuration values that remain unchanged during runtime. -
runtime_output.env: Generated during execution to store all runtime values and execution results.
This approach provides several advantages:
-
Clean Separation: The original
.envconfiguration remains untouched during recipe execution. -
Runtime Value Storage: All dynamically generated values (keypairs, transaction results, etc.) are serialized to
runtime_output.env. -
Prioritized Loading: When a recipe or ingredient runs:
- Values are first searched for in
runtime_output.env(from prior executions) - If not found, the system falls back to the original
.envfile - If not found in either, a new value is generated and stored in
runtime_output.env
- Values are first searched for in
-
Reusability: This approach enables:
- Running individual ingredients in isolation using data from prior recipe runs
- Collecting all resulting private keys from a single recipe execution
-
Reset Capability: To reset to a clean state, simply delete
runtime_output.env
This behavior is implemented using the dotenvy crate.
# Run all tests in an ingredient
cargo test -p setup_participants
# Run a specific test from an ingredient
cargo test -p setup_participants setup_basic_participant# Run all recipes
cargo test -p test-runner
# Run a specific recipe
cargo test -p test-runner recipe::basic_transfer_recipe# Show log output mid-test
cargo test -- --nocapture
# Show test execution time
cargo test -- --show-output