| Crates.io | riglr-config |
| lib.rs | riglr-config |
| version | 0.3.0 |
| created_at | 2025-09-10 18:13:56.399884+00 |
| updated_at | 2025-09-10 18:13:56.399884+00 |
| description | Unified configuration management for RIGLR applications |
| homepage | |
| repository | https://github.com/riglr/riglr |
| max_upload_size | |
| id | 1832828 |
| size | 257,593 |
Unified, hierarchical configuration management for RIGLR applications.
riglr-config provides a fail-fast, environment-driven configuration system that ensures your riglr applications are configured correctly before they start. It consolidates all configuration concerns into a single, well-structured system with strong typing and comprehensive validation.
RPC_URL_{CHAIN_ID} convention📚 View Full Documentation for detailed usage guides and examples.
use riglr_config::Config;
// Load configuration from environment (fail-fast)
let config = Config::from_env();
// Access configuration values
println!("Redis URL: {}", config.database.redis_url);
println!("Environment: {:?}", config.app.environment);
// Get RPC URL for any chain
if let Some(rpc_url) = config.network.get_rpc_url("ethereum") {
println!("Ethereum RPC: {}", rpc_url);
}
Address validation is decoupled from the core configuration to maintain chain-agnostic architecture:
use riglr_config::{Config, AddressValidator};
use riglr_evm_common::validation::EvmAddressValidator;
let config = Config::from_env();
// Optional: Validate blockchain addresses
config.network.validate_config(Some(&EvmAddressValidator))?;
REDIS_URL=redis://localhost:6379
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
RPC_URL_1=https://eth-mainnet.alchemyapi.io/v2/your-key # Or any EVM chain
Add new chains without code changes:
# Using chain ID
export RPC_URL_137=https://polygon-rpc.com
# Using network name
export RPC_URL_POLYGON=https://polygon-rpc.com
📚 View Full Documentation for complete environment variable reference, chain configuration, and migration guides.