Skip to content

Commit

Permalink
xs2c-0.5.1
Browse files Browse the repository at this point in the history
.net6 migration
  • Loading branch information
IxiAngel committed Dec 31, 2022
1 parent 4aba70a commit af8614e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 125 deletions.
2 changes: 1 addition & 1 deletion IxianS2/Meta/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class Config
public static string externalIp = "";

// Read-only values
public static readonly string version = "xs2c-0.5.0b"; // S2 Node version
public static readonly string version = "xs2c-0.5.1"; // S2 Node version

public static readonly string checkVersionUrl = "https://www.ixian.io/s2-update.txt";
public static readonly int checkVersionSeconds = 6 * 60 * 60; // 6 hours
Expand Down
7 changes: 4 additions & 3 deletions IxianS2/Meta/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ static public void stop()

if (maintenanceThread != null)
{
maintenanceThread.Abort();
maintenanceThread.Interrupt();
maintenanceThread.Join();
maintenanceThread = null;
}

Expand Down Expand Up @@ -429,7 +430,7 @@ public override int getLastBlockVersion()
public override bool addTransaction(Transaction tx, bool force_broadcast)
{
// TODO Send to peer if directly connectable
CoreProtocolMessage.broadcastProtocolMessage(new char[] { 'M', 'H' }, ProtocolMessageCode.transactionData, tx.getBytes(), null);
CoreProtocolMessage.broadcastProtocolMessage(new char[] { 'M', 'H' }, ProtocolMessageCode.transactionData2, tx.getBytes(true, true), null);
PendingTransactions.addPendingLocalTransaction(tx);
return true;
}
Expand Down Expand Up @@ -552,7 +553,7 @@ public static void processPendingTransactions()

if (cur_time - tx_time > 40) // if the transaction is pending for over 40 seconds, resend
{
CoreProtocolMessage.broadcastProtocolMessage(new char[] { 'M', 'H' }, ProtocolMessageCode.transactionData, t.getBytes(), null);
CoreProtocolMessage.broadcastProtocolMessage(new char[] { 'M', 'H' }, ProtocolMessageCode.transactionData2, t.getBytes(true, true), null);
entry.addedTimestamp = cur_time;
entry.confirmedNodeList.Clear();
}
Expand Down
2 changes: 1 addition & 1 deletion IxianS2/Network/StreamProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public static void receivedTransactionSignature(byte[] bytes, RemoteEndpoint end
if (transaction.verifySignature(transaction.pubKey.pubKey, null))
{
// Broadcast the transaction
CoreProtocolMessage.broadcastProtocolMessage(new char[] { 'M', 'H' }, ProtocolMessageCode.transactionData, transaction.getBytes(), null, endpoint);
CoreProtocolMessage.broadcastProtocolMessage(new char[] { 'M', 'H' }, ProtocolMessageCode.transactionData2, transaction.getBytes(true, true), null, endpoint);
}
return;

Expand Down
5 changes: 4 additions & 1 deletion IxianS2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static void checkRequiredFiles()
}
static void checkVCRedist()
{
#pragma warning disable CA1416 // Validate platform compatibility
object installed_vc_redist = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64", "Installed", 0);
object installed_vc_redist_debug = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\debug\\x64", "Installed", 0);
bool success = false;
Expand Down Expand Up @@ -144,6 +145,7 @@ static void checkVCRedist()
Console.ReadLine();
Environment.Exit(-1);
}
#pragma warning restore CA1416 // Validate platform compatibility
}

static void Main(string[] args)
Expand Down Expand Up @@ -242,7 +244,8 @@ static void onStart(string[] args)

if (mainLoopThread != null)
{
mainLoopThread.Abort();
mainLoopThread.Interrupt();
mainLoopThread.Join();
mainLoopThread = null;
}

Expand Down
113 changes: 17 additions & 96 deletions IxianS2/S2Node.csproj
Original file line number Diff line number Diff line change
@@ -1,104 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F408F9F2-C3A1-4FE2-8443-6D9E251924A8}</ProjectGuid>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>S2</RootNamespace>
<AssemblyName>IxianS2</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;S2_BUILD</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;S2_BUILD</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>IxianS2.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.8.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.8\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="FluentCommandLineParser, Version=1.4.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluentCommandLineParser.1.4.3\lib\net35\FluentCommandLineParser.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Open.Nat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f22a6a4582336c76, processorArchitecture=MSIL">
<HintPath>..\packages\Open.NAT.2.1.0.0\lib\net45\Open.Nat.dll</HintPath>
</Reference>
<Reference Include="SQLite-net, Version=1.6.292.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\sqlite-net-pcl.1.6.292\lib\netstandard1.1\SQLite-net.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.1.14.520, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.bundle_green.1.1.14\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.1.14.520, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.bundle_green.1.1.14\lib\net45\SQLitePCLRaw.batteries_v2.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.core, Version=1.1.14.520, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.1.1.14\lib\net45\SQLitePCLRaw.core.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.provider.e_sqlite3, Version=1.1.14.520, Culture=neutral, PublicKeyToken=9c301db686d0bd12, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.14\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="API\APIServer.cs" />
<Compile Include="Meta\Config.cs" />
<Compile Include="Meta\Node.cs" />
<Compile Include="Meta\StatsConsoleScreen.cs" />
<Compile Include="Network\NetworkProtocol.cs" />
<Compile Include="Network\QuotaManager.cs" />
<Compile Include="Network\StreamProcessor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tests\TestClientNode.cs" />
<Compile Include="Tests\TestFriend.cs" />
<Compile Include="Tests\TestStreamClient.cs" />
<Compile Include="Tests\TestStreamClientManager.cs" />
<Content Include="IxianS2.ico" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="IxianS2.ico" />
<PackageReference Include="FluentCommandLineParser" Version="1.4.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Open.Nat" Version="2.1.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="sqlite-net-pcl" Version="1.6.292" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.14" />
<PackageReference Include="SQLitePCLRaw.core" Version="1.1.14" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.linux" Version="1.1.14" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.osx" Version="1.1.14" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.v110_xp" Version="1.1.14" />
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3.netstandard11" Version="1.1.14" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="7.0.0" />
</ItemGroup>
<Import Project="..\..\Ixian-Core\IXICore.projitems" Label="Shared" />
<Target Name="CopyHTMLToOutput" AfterTargets="CoreCompile">
<ItemGroup>
<IXIPB1 Include="$(SolutionDir)\..\Ixian-Core\html\*.*" />
Expand All @@ -117,19 +53,4 @@
<Copy SourceFiles="@(IXIPB3)" DestinationFolder="$(OutputPath)\html\css" ContinueOnError="true" />
<Copy SourceFiles="@(IXIPB4)" DestinationFolder="$(OutputPath)\html\js" ContinueOnError="true" />
</Target>
<Import Project="..\..\Ixian-Core\IXICore.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\IxianDLT\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.11\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets" Condition="Exists('..\IxianDLT\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.11\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" />
<Import Project="..\IxianDLT\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.11\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets" Condition="Exists('..\IxianDLT\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.11\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" />
<Import Project="..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets'))" />
<Error Condition="!Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets'))" />
<Error Condition="!Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets'))" />
</Target>
<Import Project="..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets" Condition="Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" />
<Import Project="..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets" Condition="Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.14\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" />
</Project>
3 changes: 2 additions & 1 deletion IxianS2/Tests/TestStreamClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static void stop()
// Force stopping of reconnect thread
if (reconnectThread == null)
return;
reconnectThread.Abort();
reconnectThread.Interrupt();
reconnectThread.Join();
reconnectThread = null;
}

Expand Down
15 changes: 0 additions & 15 deletions IxianS2/packages.config

This file was deleted.

14 changes: 7 additions & 7 deletions S2Node.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.572
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S2Node", "IxianS2\S2Node.csproj", "{F408F9F2-C3A1-4FE2-8443-6D9E251924A8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "S2Node", "IxianS2\S2Node.csproj", "{F408F9F2-C3A1-4FE2-8443-6D9E251924A8}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "IXICore", "..\Ixian-Core\IXICore.shproj", "{80487C64-619A-4B60-97BD-ED7670BF45B3}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\Ixian-Core\IXICore.projitems*{80487c64-619a-4b60-97bd-ed7670bf45b3}*SharedItemsImports = 13
..\Ixian-Core\IXICore.projitems*{f408f9f2-c3a1-4fe2-8443-6d9e251924a8}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand All @@ -28,4 +24,8 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {97344C29-18D5-463D-AD09-4E397CAFA4B6}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\Ixian-Core\IXICore.projitems*{80487c64-619a-4b60-97bd-ed7670bf45b3}*SharedItemsImports = 13
..\Ixian-Core\IXICore.projitems*{f408f9f2-c3a1-4fe2-8443-6d9e251924a8}*SharedItemsImports = 5
EndGlobalSection
EndGlobal

0 comments on commit af8614e

Please sign in to comment.