From ecb26443d4081d6cd7788fa50dbcc22770020db3 Mon Sep 17 00:00:00 2001 From: Cedric Decoster Date: Sat, 14 Sep 2024 09:38:44 +0200 Subject: [PATCH] removing obsolete test project --- Substrate.NetApi.Console/Program.cs | 60 ------------------- .../Substrate.NetApi.Console.csproj | 18 ------ SubstrateNetApi.sln | 10 ---- 3 files changed, 88 deletions(-) delete mode 100644 Substrate.NetApi.Console/Program.cs delete mode 100644 Substrate.NetApi.Console/Substrate.NetApi.Console.csproj diff --git a/Substrate.NetApi.Console/Program.cs b/Substrate.NetApi.Console/Program.cs deleted file mode 100644 index ecf632d..0000000 --- a/Substrate.NetApi.Console/Program.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Serilog; -using Substrate.NetApi; -using Substrate.NetApi.Model.Extrinsics; - -internal class Program -{ - private static async Task Main(string[] args) - { - // Configure Serilog for logging - Log.Logger = new LoggerConfiguration() - .WriteTo.Console() - .MinimumLevel.Debug() - .CreateLogger(); - - // Set up a cancellation token for graceful shutdown - CancellationTokenSource cts = new CancellationTokenSource(); - - await MainAsync(cts.Token); - - // Keep the application alive to continue monitoring the connection - Console.WriteLine("Press any key to exit..."); - Console.ReadKey(); - - // Cleanup logging resources - await Log.CloseAndFlushAsync(); - } - - private static async Task MainAsync(CancellationToken token) - { - // Create the client - string substrateNodeUrl = "wss://rpc-parachain.bajun.network"; - var client = new SubstrateClient(new Uri(substrateNodeUrl), ChargeTransactionPayment.Default()); - - while (!token.IsCancellationRequested) - { - // Ensure the client is connected - if (!client.IsConnected) - { - Log.Information("Attempting to connect to the client..."); - await client.ConnectAsync( - useMetaData: true, - standardSubstrate: true, - maxRetryAttempts: 5, - delayRetryMilliseconds: 5000, - token: token - ); - Log.Information("Client connected successfully."); - } - - var currentBlocknumber = await client.State.GetStorageAsync(Utils.HexToByteArray("0x26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac"), (string)null, token); - Log.Information("MainAsync running... block: {blocknumber}", currentBlocknumber.ToString()); - - // Wait before next call - await Task.Delay(12000); - } - - // Gracefully shut down - await client.CloseAsync(); - } -} \ No newline at end of file diff --git a/Substrate.NetApi.Console/Substrate.NetApi.Console.csproj b/Substrate.NetApi.Console/Substrate.NetApi.Console.csproj deleted file mode 100644 index d28447d..0000000 --- a/Substrate.NetApi.Console/Substrate.NetApi.Console.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - Exe - net8.0 - enable - enable - - - - - - - - - - - diff --git a/SubstrateNetApi.sln b/SubstrateNetApi.sln index fa92792..bfcb753 100644 --- a/SubstrateNetApi.sln +++ b/SubstrateNetApi.sln @@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Substrate.NetApi", "Substra EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Substrate.NetApi.TestNode", "Substrate.NetApi.TestNode\Substrate.NetApi.TestNode.csproj", "{1866CE09-C874-4E65-A443-49DCBFC583A1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Substrate.NetApi.Console", "Substrate.NetApi.Console\Substrate.NetApi.Console.csproj", "{78AD3039-CDC8-479C-A91E-494998510AD2}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -43,14 +41,6 @@ Global {1866CE09-C874-4E65-A443-49DCBFC583A1}.Release|Any CPU.Build.0 = Release|Any CPU {1866CE09-C874-4E65-A443-49DCBFC583A1}.Release|x64.ActiveCfg = Release|Any CPU {1866CE09-C874-4E65-A443-49DCBFC583A1}.Release|x64.Build.0 = Release|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Debug|x64.ActiveCfg = Debug|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Debug|x64.Build.0 = Debug|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Release|Any CPU.Build.0 = Release|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Release|x64.ActiveCfg = Release|Any CPU - {78AD3039-CDC8-479C-A91E-494998510AD2}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE