riglr-config
Unified, hierarchical configuration management for RIGLR applications.
Overview
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.
Key Features
- Fail-Fast Validation: Configuration errors crash at startup, not runtime
- Environment-Driven: All configuration loaded from environment variables
- Multi-Chain Support: Dynamic chain configuration via
RPC_URL_{CHAIN_ID}convention - Type-Safe: Strongly typed configuration with compile-time guarantees
- Hierarchical Structure: Logical organization of related settings
📚 View Full Documentation for detailed usage guides and examples.
Quick Start
use Config;
// Load configuration from environment (fail-fast)
let config = from_env;
// Access configuration values
println!;
println!;
// Get RPC URL for any chain
if let Some = config.network.get_rpc_url
Address Validation (v0.3.0+)
Address validation is decoupled from the core configuration to maintain chain-agnostic architecture:
use ;
use EvmAddressValidator;
let config = from_env;
// Optional: Validate blockchain addresses
config.network.validate_config?;
Configuration Structure
- app: Server settings, transaction defaults, retry configuration
- database: Redis (required), Neo4j, ClickHouse
- network: RPC URLs for all chains, contract addresses
- providers: API keys for AI, blockchain, and market data providers
- features: Feature flags for enabling/disabling functionality
Required Environment Variables
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
Dynamic Chain Support
Add new chains without code changes:
# Using chain ID
# Using network name
📚 View Full Documentation for complete environment variable reference, chain configuration, and migration guides.