diff --git a/AutoClient/AutoClient.csproj b/Tools/AutoClient/AutoClient.csproj similarity index 52% rename from AutoClient/AutoClient.csproj rename to Tools/AutoClient/AutoClient.csproj index fbbe450..9340dc9 100644 --- a/AutoClient/AutoClient.csproj +++ b/Tools/AutoClient/AutoClient.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/AutoClient/Codex.cs b/Tools/AutoClient/Codex.cs similarity index 100% rename from AutoClient/Codex.cs rename to Tools/AutoClient/Codex.cs diff --git a/AutoClient/Configuration.cs b/Tools/AutoClient/Configuration.cs similarity index 100% rename from AutoClient/Configuration.cs rename to Tools/AutoClient/Configuration.cs diff --git a/AutoClient/Program.cs b/Tools/AutoClient/Program.cs similarity index 79% rename from AutoClient/Program.cs rename to Tools/AutoClient/Program.cs index 1358586..ebaefb9 100644 --- a/AutoClient/Program.cs +++ b/Tools/AutoClient/Program.cs @@ -32,12 +32,29 @@ public static class Program var fileManager = tools.GetFileManager(); var codex = new Codex(tools, address); + CheckCodex(codex, log); + var runner = new Runner(log, codex, fileManager, cancellationToken, config); runner.Run(); log.Log("Done."); } + private static void CheckCodex(Codex codex, ILog log) + { + log.Log("Checking Codex..."); + try + { + var info = codex.GetDebugInfo(); + if (string.IsNullOrEmpty(info.Id)) throw new Exception("Failed to fetch Codex node id"); + } + catch (Exception ex) + { + log.Log($"Codex not OK: {ex}"); + throw; + } + } + private static void PrintHelp() { Console.WriteLine("Generates fake data and creates Codex storage contracts for it."); diff --git a/AutoClient/Runner.cs b/Tools/AutoClient/Runner.cs similarity index 100% rename from AutoClient/Runner.cs rename to Tools/AutoClient/Runner.cs diff --git a/cs-codex-dist-testing.sln b/cs-codex-dist-testing.sln index 809f971..eb7de47 100644 --- a/cs-codex-dist-testing.sln +++ b/cs-codex-dist-testing.sln @@ -66,7 +66,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoClient", "AutoClient\AutoClient.csproj", "{8B8BF2B9-5855-4C92-A5DA-D13D778B7934}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoClient", "Tools\AutoClient\AutoClient.csproj", "{73599F9C-98BB-4C6A-9D7D-7C50FBF2993B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -174,10 +174,10 @@ Global {88C212E9-308A-46A4-BAAD-468E8EBD8EDF}.Debug|Any CPU.Build.0 = Debug|Any CPU {88C212E9-308A-46A4-BAAD-468E8EBD8EDF}.Release|Any CPU.ActiveCfg = Release|Any CPU {88C212E9-308A-46A4-BAAD-468E8EBD8EDF}.Release|Any CPU.Build.0 = Release|Any CPU - {8B8BF2B9-5855-4C92-A5DA-D13D778B7934}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B8BF2B9-5855-4C92-A5DA-D13D778B7934}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B8BF2B9-5855-4C92-A5DA-D13D778B7934}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B8BF2B9-5855-4C92-A5DA-D13D778B7934}.Release|Any CPU.Build.0 = Release|Any CPU + {73599F9C-98BB-4C6A-9D7D-7C50FBF2993B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73599F9C-98BB-4C6A-9D7D-7C50FBF2993B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73599F9C-98BB-4C6A-9D7D-7C50FBF2993B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73599F9C-98BB-4C6A-9D7D-7C50FBF2993B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -208,7 +208,7 @@ Global {F730DA73-1C92-4107-BCFB-D33759DAB0C3} = {81AE04BC-CBFA-4E6F-B039-8208E9AFAAE7} {B07820C4-309F-4454-BCC1-1D4902C9C67B} = {81AE04BC-CBFA-4E6F-B039-8208E9AFAAE7} {88C212E9-308A-46A4-BAAD-468E8EBD8EDF} = {8F1F1C2A-E313-4E0C-BE40-58FB0BA91124} - {8B8BF2B9-5855-4C92-A5DA-D13D778B7934} = {7591C5B3-D86E-4AE4-8ED2-B272D17FE7E3} + {73599F9C-98BB-4C6A-9D7D-7C50FBF2993B} = {7591C5B3-D86E-4AE4-8ED2-B272D17FE7E3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {237BF0AA-9EC4-4659-AD9A-65DEB974250C}