quantus_cli/config/
mod.rs

1/// Configuration management module
2///
3/// This module handles:
4/// - Loading and saving CLI configuration
5/// - Managing default settings
6/// - Environment variable handling
7/// - Configuration file validation
8/// - Runtime compatibility information
9use serde::{Deserialize, Serialize};
10
11/// List of runtime spec versions that this CLI is compatible with
12pub const COMPATIBLE_RUNTIME_VERSIONS: &[u32] = &[108];
13
14/// Check if a runtime version is compatible with this CLI
15pub fn is_runtime_compatible(spec_version: u32) -> bool {
16	COMPATIBLE_RUNTIME_VERSIONS.contains(&spec_version)
17}
18
19/// Main CLI configuration
20#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct Config {
22	/// Default node URL
23	pub node_url: String,
24
25	/// Default wallet name
26	pub default_wallet: Option<String>,
27
28	/// Logging level
29	pub log_level: String,
30
31	/// Configuration file version
32	pub version: String,
33}
34
35impl Default for Config {
36	fn default() -> Self {
37		Self {
38			node_url: "ws://127.0.0.1:9944".to_string(),
39			default_wallet: None,
40			log_level: "info".to_string(),
41			version: "1.0.0".to_string(),
42		}
43	}
44}