Skip to content

Commit 0bcac36

Browse files
committed
- migrated to .net10
- startup and build improvements
1 parent 7946a77 commit 0bcac36

6 files changed

Lines changed: 85 additions & 45 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,5 @@ FodyWeavers.xsd
398398

399399
# JetBrains Rider
400400
*.sln.iml
401+
402+
.DS_Store

QuIXI/Meta/Config.cs

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

QuIXI/Meta/Node.cs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,24 @@ private void init()
5858

5959
initMessageQueue();
6060

61-
PeerStorage.init(Config.userFolder);
61+
PeerStorage.init(Config.dataFolder);
6262

6363
// Network configuration
6464
networkClientManagerStatic = new NetworkClientManagerStatic(Config.maxRelaySectorNodesToConnectTo);
6565
NetworkClientManager.init(networkClientManagerStatic);
6666

6767
// Prepare the stream processor
68-
streamProcessor = new StreamProcessor(new ICPendingMessageProcessor(Config.userFolder, false), Config.streamCapabilities);
68+
streamProcessor = new StreamProcessor(new ICPendingMessageProcessor(Config.dataFolder, false), Config.streamCapabilities);
6969

7070
// Init TIV
7171
tiv = new TransactionInclusion(new ICTransactionInclusionCallbacks(), false);
7272

7373
Logging.info("Initing local storage");
7474

7575
// Prepare the local storage
76-
IxianHandler.localStorage = new LocalStorage(Config.userFolder, new ICLocalStorageCallbacks());
76+
IxianHandler.localStorage = new LocalStorage(Config.dataFolder, new ICLocalStorageCallbacks());
7777

78-
FriendList.init(Config.userFolder);
78+
FriendList.init(Config.dataFolder);
7979

8080
UpdateVerify.init(Config.checkVersionUrl, Config.checkVersionSeconds);
8181

@@ -135,22 +135,6 @@ public void start(bool verboseConsoleOutput)
135135
ulong block_height = 0;
136136
byte[] block_checksum = null;
137137

138-
string headers_path;
139-
if (Config.headersFolderPath != "")
140-
{
141-
headers_path = Config.headersFolderPath;
142-
}
143-
else
144-
{
145-
if (IxianHandler.networkType == NetworkType.main)
146-
{
147-
headers_path = Path.Combine(Config.userFolder, "headers");
148-
}
149-
else
150-
{
151-
headers_path = Path.Combine(Config.userFolder, "testnet-headers");
152-
}
153-
}
154138

155139
if (IxianHandler.networkType == NetworkType.main)
156140
{
@@ -159,7 +143,7 @@ public void start(bool verboseConsoleOutput)
159143
}
160144

161145
// Start TIV
162-
tiv.start(headers_path, block_height, block_checksum, true);
146+
tiv.start(Config.headersFolderPath, block_height, block_checksum, true);
163147

164148
// Generate presence list
165149
PresenceList.init(IxianHandler.publicIP, 0, 'C', CoreConfig.clientKeepAliveInterval);

QuIXI/Program.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ static void Main(string[] args)
1919
Console.Clear();
2020
}
2121

22+
ConsoleHelpers.prepareWindowsConsole();
23+
24+
ConsoleHelpers.verboseConsoleOutput = true;
25+
26+
Console.ForegroundColor = ConsoleColor.Magenta;
27+
Console.WriteLine(string.Format("QuIXI {0} ({1})", Config.version, CoreConfig.version));
28+
Console.ResetColor();
29+
30+
// Read configuration from command line
31+
Config.init(args);
32+
2233
// Start logging
2334
if (!Logging.start(Config.logFolderPath, Config.logVerbosity))
2435
{
@@ -44,13 +55,6 @@ static void Main(string[] args)
4455

4556
static bool onStart(string[] args)
4657
{
47-
// Read configuration from command line
48-
if (!Config.init(args))
49-
{
50-
Environment.Exit(2);
51-
return false;
52-
}
53-
5458
// Set the logging options
5559
Logging.setOptions(Config.maxLogSize, Config.maxLogCount);
5660
Logging.flush();

QuIXI/QuIXI.csproj

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<RootNamespace>QuIXI</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
@@ -24,14 +24,27 @@
2424

2525
<ItemGroup>
2626
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
27-
<PackageReference Include="FluentCommandLineParser" Version="1.4.3" />
28-
<PackageReference Include="MQTTnet" Version="5.0.1.1416" />
27+
<PackageReference Include="FluentCommandLineParser-netstandard" Version="1.4.3.13" />
28+
<PackageReference Include="Mono.Nat" Version="3.0.4" />
29+
<PackageReference Include="MQTTnet" Version="5.1.0.1559" />
2930
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
30-
<PackageReference Include="Open.Nat" Version="2.1.0" />
3131
<PackageReference Include="RabbitMQ.Client" Version="7.2.0" />
32-
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="9.0.10" />
3332
</ItemGroup>
3433

34+
<PropertyGroup>
35+
<ApplicationIcon>QuIXI.ico</ApplicationIcon>
36+
<AssemblyName>QuIXI</AssemblyName>
37+
<AssemblyTitle>QuIXI</AssemblyTitle>
38+
<AssemblyDescription></AssemblyDescription>
39+
<AssemblyCompany>Ixian</AssemblyCompany>
40+
<Product>QuIXI</Product>
41+
<Copyright>Copyright © 2026 Ixian</Copyright>
42+
<VersionPrefix>0.9.2.0</VersionPrefix>
43+
<PackageProjectUrl>https://www.ixian.io</PackageProjectUrl>
44+
<CLSCompliant>true</CLSCompliant>
45+
<ComVisible>false</ComVisible>
46+
</PropertyGroup>
47+
3548
<Target Name="CopyHTMLToOutput" AfterTargets="CoreCompile">
3649
<ItemGroup>
3750
<IXIPB1 Include="$(SolutionDir)\..\Ixian-Core\html\**\*.*" />

QuIXI/QuIXI.ico

54.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)