@@ -681,16 +681,25 @@ async fn detect_current_phase() -> (u8, PricingInfo) {
681681 println ! ( " Error: {}" , e) ;
682682 println ! ( " Trying backup RPC nodes..." ) ;
683683
684- // Try backup devnet RPC nodes
685- let backup_rpcs = vec ! [
686- "https://api.devnet.solana.com" ,
687- "https://devnet.helius-rpc.com" ,
688- "https://solana-devnet.g.alchemy.com/v2/demo" ,
689- ] ;
684+ // Try backup RPC nodes (network-aware)
685+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
686+ let backup_rpcs = if network_config. is_testnet ( ) {
687+ vec ! [
688+ "https://api.devnet.solana.com" ,
689+ "https://devnet.helius-rpc.com" ,
690+ "https://solana-devnet.g.alchemy.com/v2/demo" ,
691+ ]
692+ } else {
693+ vec ! [
694+ "https://api.mainnet-beta.solana.com" ,
695+ "https://solana-mainnet.g.alchemy.com/v2/demo" ,
696+ "https://mainnet.helius-rpc.com" ,
697+ ]
698+ } ;
690699
691700 for rpc_url in backup_rpcs {
692701 println ! ( "🔄 Trying backup RPC: {}" , rpc_url) ;
693- match get_real_token_supply ( rpc_url, "62PPztDN8t6dAeh3FvxXfhkDJirpHZjGvCYdHM54FHHJ" ) . await {
702+ match get_real_token_supply ( rpc_url, & network_config . solana . onedev_mint ) . await {
694703 Ok ( supply_data) => {
695704 println ! ( "✅ Data retrieved from backup RPC!" ) ;
696705
@@ -774,9 +783,10 @@ struct RealNodeCounts {
774783
775784// Fetch real data from Solana contract
776785async fn fetch_burn_tracker_data ( ) -> Result < BurnTrackerData , String > {
777- // Testnet Solana RPC configuration (devnet)
786+ // Network-aware Solana RPC configuration
787+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
778788 let rpc_url = std:: env:: var ( "SOLANA_RPC_URL" ) . unwrap_or_else ( |_| {
779- "https://api.devnet. solana.com" . to_string ( )
789+ network_config . solana . rpc_url . clone ( )
780790 } ) ;
781791
782792 let program_id = std:: env:: var ( "BURN_TRACKER_PROGRAM_ID" ) . unwrap_or_else ( |_| {
@@ -854,8 +864,9 @@ async fn get_real_token_supply(rpc_url: &str, token_mint: &str) -> Result<TokenS
854864 token_mint
855865 ) ;
856866
867+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
857868 match tokio:: process:: Command :: new ( "curl" )
858- . args ( & [ "-s" , "-X" , "POST" , "https://api.devnet. solana.com" ] )
869+ . args ( & [ "-s" , "-X" , "POST" , & network_config . solana . rpc_url ] )
859870 . args ( & [ "-H" , "Content-Type: application/json" ] )
860871 . args ( & [ "-d" , & payload] )
861872 . output ( )
@@ -2096,6 +2107,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
20962107 return Err ( "No activation code provided" . into ( ) ) ;
20972108 }
20982109
2110+ // PRODUCTION: Load network configuration based on QNET_NETWORK env
2111+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
2112+ println ! ( "🌐 Network: {}" , network_config. network_name( ) ) ;
2113+ println ! ( " Environment: {:?}" , network_config. environment) ;
2114+ println ! ( " Chain ID: {}" , network_config. chain_id) ;
2115+ println ! ( " QNet RPC: {}" , network_config. endpoints. qnet_rpc) ;
2116+ println ! ( " Bridge API: {}" , network_config. endpoints. bridge_api) ;
2117+ println ! ( " Solana RPC: {}" , network_config. solana. rpc_url) ;
2118+ println ! ( " 1DEV Token: {}" , network_config. solana. onedev_mint) ;
2119+
20992120 // PRODUCTION: Full activation code validation in main for security
21002121 let ( current_phase, pricing_info) = detect_current_phase ( ) . await ;
21012122
@@ -2816,8 +2837,9 @@ async fn verify_1dev_burn(node_type: &NodeType) -> Result<(), String> {
28162837async fn verify_solana_burn_transaction ( wallet_address : & str , required_amount : f64 ) -> Result < bool , String > {
28172838 println ! ( "📡 Querying Solana devnet for burn transaction..." ) ;
28182839
2819- // PRODUCTION: Use devnet RPC for our 1DEV token
2820- let solana_rpc = "https://api.devnet.solana.com" ;
2840+ // PRODUCTION: Use network-aware RPC configuration
2841+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
2842+ let solana_rpc = & network_config. solana . rpc_url ;
28212843
28222844 // Build RPC request to check burn transactions
28232845 let request_body = serde_json:: json!( {
@@ -2874,10 +2896,11 @@ async fn verify_solana_burn_transaction(wallet_address: &str, required_amount: f
28742896async fn verify_solana_burn_for_activation ( wallet_address : & str , expected_tx_hash : & str , required_amount : u64 ) -> Result < bool , String > {
28752897 println ! ( "📡 PRODUCTION: Verifying 1DEV burn on Solana for node activation..." ) ;
28762898
2877- // PRODUCTION: Use devnet RPC for our 1DEV token
2878- let solana_rpc = "https://api.devnet.solana.com" ;
2879- let onedev_mint = "62PPztDN8t6dAeh3FvxXfhkDJirpHZjGvCYdHM54FHHJ" ; // Real 1DEV token mint
2880- let burn_address = "1nc1nerator11111111111111111111111111111111" ; // Official Solana incinerator
2899+ // PRODUCTION: Use network-aware RPC configuration
2900+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
2901+ let solana_rpc = & network_config. solana . rpc_url ;
2902+ let onedev_mint = & network_config. solana . onedev_mint ;
2903+ let burn_address = & network_config. solana . burn_address ;
28812904
28822905 // Convert to 6 decimals for comparison
28832906 let required_amount_decimals = required_amount * 1_000_000 ;
@@ -2994,7 +3017,8 @@ async fn verify_solana_burn_for_activation(wallet_address: &str, expected_tx_has
29943017
29953018async fn is_burn_transaction ( signature : & str ) -> Result < bool , String > {
29963019 // Query transaction details to check if it's a burn to 1DEV burn address
2997- let solana_rpc = "https://api.devnet.solana.com" ;
3020+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
3021+ let solana_rpc = & network_config. solana . rpc_url ;
29983022
29993023 let request_body = serde_json:: json!( {
30003024 "jsonrpc" : "2.0" ,
@@ -3039,7 +3063,8 @@ async fn is_burn_transaction(signature: &str) -> Result<bool, String> {
30393063
30403064async fn get_burned_amount ( signature : & str ) -> Result < f64 , String > {
30413065 // Parse burn amount from transaction
3042- let solana_rpc = "https://api.devnet.solana.com" ;
3066+ let network_config = qnet_integration:: network_config:: get_network_config ( ) ;
3067+ let solana_rpc = & network_config. solana . rpc_url ;
30433068
30443069 let request_body = serde_json:: json!( {
30453070 "jsonrpc" : "2.0" ,
0 commit comments