@@ -10,7 +10,7 @@ namespace QuIXI.Meta
1010 public class Config
1111 {
1212 // Read-only values
13- public static readonly string version = "qxc-0.9.1c " ;
13+ public static readonly string version = "qxc-0.9.2 " ;
1414
1515 public static readonly string checkVersionUrl = "https://resources.ixian.io/qxc-update.txt" ;
1616 public static readonly int checkVersionSeconds = 6 * 60 * 60 ; // 6 hours
@@ -27,23 +27,23 @@ public class Config
2727 public static int apiPort = 8001 ;
2828 public static int serverPort = 0 ;
2929
30- public static string userFolder = "" ;
30+ public static string dataFolder = Path . Combine ( Environment . CurrentDirectory , "data" ) ;
3131
3232 public static Dictionary < string , string > apiUsers = new Dictionary < string , string > ( ) ;
3333
3434 public static List < string > apiAllowedIps = new List < string > ( ) ;
3535 public static List < string > apiBinds = new List < string > ( ) ;
3636
3737 public static string configFilename = "ixian.cfg" ;
38- public static string walletFile = "ixian.wal " ;
38+ public static string walletFile = "" ;
3939
40- public static string headersFolderPath = Path . Combine ( Environment . CurrentDirectory , "headers" ) ;
41- public static string logFolderPath = Environment . CurrentDirectory ;
40+ public static string headersFolderPath = "" ;
41+ public static string logFolderPath = "" ;
4242
4343 public static int maxLogSize = 50 ;
4444 public static int maxLogCount = 10 ;
4545
46- public static int logVerbosity = ( int ) LogSeverity . info + ( int ) LogSeverity . warn + ( int ) LogSeverity . error ;
46+ public static int logVerbosity = ( int ) LogSeverity . info + ( int ) LogSeverity . warn + ( int ) LogSeverity . error + ( int ) LogSeverity . trace ;
4747 public static bool verboseOutput = false ;
4848
4949 public static bool onlyShowAddresses = false ;
@@ -102,6 +102,7 @@ private static void outputHelp()
102102 Console . WriteLine ( " --networkType\t mainnet, testnet or regtest." ) ;
103103 Console . WriteLine ( " --logFolderPath\t location where to store log files." ) ;
104104 Console . WriteLine ( " --headersFolderPath\t location where to store block header data." ) ;
105+ Console . WriteLine ( " --dataFolderPath\t root location where to store data." ) ;
105106 Console . WriteLine ( "" ) ;
106107 Console . WriteLine ( " --name\t \t Specify the name of this QuIXI instance" ) ;
107108 Console . WriteLine ( "" ) ;
@@ -128,6 +129,11 @@ private static void outputHelp()
128129 Console . WriteLine ( " logVerbosity\t Sets log verbosity (same as --logVerbosity CLI)" ) ;
129130 Console . WriteLine ( " logFolderPath\t location where to store log files." ) ;
130131 Console . WriteLine ( " headersFolderPath\t location where to store block header data." ) ;
132+ Console . WriteLine ( " dataFolderPath\t root location where to store data." ) ;
133+ Console . WriteLine ( " checksumLock\t Sets the checksum lock for seeding checksums - useful for custom networks." ) ;
134+ Console . WriteLine ( " networkType\t \t mainnet, testnet or regtest." ) ;
135+ Console . WriteLine ( " wallet\t \t Specify location of the ixian.wal file" ) ;
136+ Console . WriteLine ( " walletPassword\t Specify the password for the wallet." ) ;
131137 Console . WriteLine ( "" ) ;
132138 Console . WriteLine ( " mqDriver\t \t Message Queue Driver - mqtt or rabbitmq" ) ;
133139 Console . WriteLine ( " mqHost\t \t Message Queue Hostname" ) ;
@@ -141,7 +147,6 @@ private static void outputHelp()
141147 private static void outputVersion ( )
142148 {
143149 // Do nothing but exit since version is the first thing displayed
144-
145150 Environment . Exit ( 0 ) ;
146151 }
147152
@@ -288,21 +293,34 @@ private static void readConfigFile(string filename)
288293 case "headersFolderPath" :
289294 headersFolderPath = value ;
290295 break ;
296+ case "dataFolderPath" :
297+ dataFolder = value ;
298+ break ;
299+ case "wallet" :
300+ walletFile = value ;
301+ break ;
302+ case "walletPassword" :
303+ dangerCommandlinePasswordCleartextUnsafe = value ;
304+ break ;
291305 default :
292306 // unknown key
293307 Logging . warn ( "Unknown config parameter was specified '" + key + "'" ) ;
294308 break ;
295309 }
296310 }
297311 }
298- public static bool init ( string [ ] args )
312+
313+ public static void init ( string [ ] args )
299314 {
300315 // first pass
301316 var cmd_parser = new FluentCommandLineParser ( ) ;
302317
303318 // help
304319 cmd_parser . SetupHelp ( "h" , "help" ) . Callback ( text => outputHelp ( ) ) ;
305320
321+ // version
322+ cmd_parser . Setup < bool > ( 'v' , "version" ) . Callback ( text => outputVersion ( ) ) ;
323+
306324 // config file
307325 cmd_parser . Setup < string > ( "config" ) . Callback ( value => configFilename = value ) . Required ( ) ;
308326
@@ -329,9 +347,6 @@ public static bool init(string[] args)
329347
330348 bool start_clean = false ; // Flag to determine if node should delete cache+logs
331349
332- // version
333- cmd_parser . Setup < bool > ( 'v' , "version" ) . Callback ( text => outputVersion ( ) ) ;
334-
335350 // Check for password change
336351 cmd_parser . Setup < bool > ( 'x' , "changepass" ) . Callback ( value => changePass = value ) . Required ( ) ;
337352
@@ -358,6 +373,8 @@ public static bool init(string[] args)
358373
359374 cmd_parser . Setup < string > ( "logFolderPath" ) . Callback ( value => logFolderPath = value ) . Required ( ) ;
360375
376+ cmd_parser . Setup < string > ( "dataFolderPath" ) . Callback ( value => dataFolder = value ) . Required ( ) ;
377+
361378 // Debug
362379
363380 cmd_parser . Setup < string > ( "walletPassword" ) . Callback ( value => dangerCommandlinePasswordCleartextUnsafe = value ) . SetDefault ( "" ) ;
@@ -397,7 +414,27 @@ public static bool init(string[] args)
397414 }
398415 }
399416
400- return true ;
417+ if ( headersFolderPath == "" )
418+ {
419+ if ( IxianHandler . networkType == NetworkType . main )
420+ {
421+ headersFolderPath = Path . Combine ( dataFolder , "headers" ) ;
422+ }
423+ else
424+ {
425+ headersFolderPath = Path . Combine ( dataFolder , "testnet-headers" ) ;
426+ }
427+ }
428+
429+ if ( logFolderPath == "" )
430+ {
431+ logFolderPath = dataFolder ;
432+ }
433+
434+ if ( walletFile == "" )
435+ {
436+ walletFile = Path . Combine ( dataFolder , "ixian.wal" ) ;
437+ }
401438 }
402439 }
403440}
0 commit comments