Managing Configurations¶
Configurations are managed by the config
package. It provides both environment and application configurations.
.
├── src
│ └── 📁 config [Application wide environment and configurations]
│ ├── 📄 __init__.py
│ ├── 📄 app.py [Configurations for application framework]
│ ├── 📄 docs.py [Configurations for documentation]
│ └── 📄 env.py [Exposes `env.yaml` to the application]
└── 📄 env.yaml [Environment file (git ignored)]
Environment Configurations¶
Application-wide environment configuration, which varies across staging, production, and development environments are read from env.yaml
in the project root.
This file will not be tracked by git, making it safe for storing local secrets.
To get started, run the command env_init cli to initialize your environment configuration.
Usage¶
1. Generate env file¶
Run the env_init
cli tool.
➜ uv run env_init
Env file created: execution-spec-tests/env.yaml
which should generate an env.yaml
in the project root.
remote_nodes:
- name: mainnet_archive
# Replace with your Ethereum RPC node URL
node_url: http://example.com
# Optional: Headers for RPC requests
rpc_headers:
client-secret: <secret>
2. Import EnvConfig
¶
from config import EnvConfig
EnvConfig().remote_nodes[0].name
'mainnet_archive'
Application configuration¶
Application configuration are pydantic classes.
from config import DocsConfig
DocsConfig().TARGET_FORK
'Prague'