File size: 3,521 Bytes
f832ee5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// The primary modules that define the Qanto node and its behavior.
pub mod adaptive_mining;
pub mod analytics_dashboard;
pub mod block_producer;
pub mod config;
pub mod config_validator;
pub mod consensus;
pub mod decentralization;
pub mod decoupled_producer;
pub mod deterministic_mining;
pub mod diagnostics;
pub mod elite_mempool;
pub mod emission;
pub mod gas_fee_model;
pub mod graphql_server;
pub mod hame;
pub mod interoperability;
pub mod keygen;
pub mod mempool;
pub mod metrics;
pub mod miner;
pub mod mining_celebration;
pub mod mining_metrics;
pub mod node;
pub mod omega;
pub mod omega_enhanced;
pub mod optimized_decoupled_producer;
pub mod optimized_qdag;
pub mod p2p;
pub mod password_utils;
pub mod performance_monitoring;
pub mod performance_optimizations;
pub mod performance_validation;
pub mod persistence;
pub mod post_quantum_crypto;
pub mod pq_suite;
pub mod privacy;
pub mod resource_cleanup;
pub mod safe_interval;
pub mod shutdown;
pub mod telemetry;
pub mod timing;
pub mod interplanetary;
pub mod kernel_boot;
pub mod heritage_archive;
pub mod storage_mesh;
pub mod formal_verifier;

pub mod derive_genesis_key;
pub mod generate_wallet;
pub mod get_address;
pub mod import_wallet;
pub mod metrics_server;
pub mod mock_traits;
pub mod monitor;
pub mod qanto;
pub mod qanto_ai_metrics;
// Re-export core modules from the `qanto-core` crate instead of duplicating them.
pub use qanto_core::{
    qanto_compat, qanto_native_crypto, qanto_net, qanto_p2p, qanto_serde, qanto_storage,
    storage_adapter, storage_traits,
};
pub mod qantodag;
pub mod rpc_backend;
pub mod saga;
pub mod transaction;
pub mod types;
pub mod wallet;
pub mod websocket_server;
pub mod x_phyrus;

// Conditionally compiled modules for extended features.
#[cfg(feature = "infinite-strata")]
pub mod infinite_strata_node;

// Use the full zkp module when the `zk` feature is enabled
#[cfg(feature = "zk")]
pub mod zkp;

// Provide a lightweight stub for the `zkp` module when the `zk` feature is disabled,
// so dependent modules can compile without pulling in heavy Arkworks dependencies.
#[cfg(not(feature = "zk"))]
#[path = "zkp_stub.rs"]
pub mod zkp;

pub mod memory_optimization;
pub use my_blockchain::qanhash;

pub mod qantowallet;
pub mod qds;

pub mod start_node;
// Test-safe tracing initialization to avoid double-init panics in tests
use std::sync::Once;
static INIT_TRACING: Once = Once::new();

/// Initialize tracing subscriber once for tests.
/// Uses `RUST_LOG` via `EnvFilter` when set; otherwise defaults to `info`.
pub fn init_test_tracing() {
    use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};

    INIT_TRACING.call_once(|| {
        let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
        // Try init; ignore error if already initialized by other harness
        let _ = tracing_subscriber::registry()
            .with(filter)
            .with(fmt::layer())
            .try_init();
    });
}
pub mod ipc_server;

pub const Q_SCALE: u128 = 1_000_000_000;
pub const QANTO_SCALE: u128 = Q_SCALE;
pub const SCORE_SCALE: i128 = 1_000_000_000;

/// QAmount: Fixed-point u128 representing a decimal quantity (scale 1e9).
/// Used for balances, rewards, fees, and stakes.
pub type QAmount = u128;

/// QScore: Fixed-point i128 representing a signed score (scale 1e9).
/// Used for Saga scoring and reputation.
pub type QScore = i128;

/// QDifficulty: Mining difficulty ONLY.
pub type QDifficulty = u64;

pub mod math;