diff --git a/Tools/CodexNetDeployer/CodexNodeStarter.cs b/Tools/CodexNetDeployer/CodexNodeStarter.cs index f1cfed48..6ed65280 100644 --- a/Tools/CodexNetDeployer/CodexNodeStarter.cs +++ b/Tools/CodexNetDeployer/CodexNodeStarter.cs @@ -36,7 +36,7 @@ namespace CodexNetDeployer codexNode = ci.StartCodexNode(s => { s.WithName(name); - s.WithLogLevel(config.CodexLogLevel); + s.WithLogLevel(config.CodexLogLevel, new CodexLogCustomTopics(config.Discv5LogLevel, config.Libp2pLogLevel)); s.WithStorageQuota(config.StorageQuota!.Value.MB()); s.EnableMarketplace(gethNode, contracts, 100.Eth(), config.InitialTestTokens.TestTokens(), validatorsLeft > 0); s.EnableMetrics(); diff --git a/Tools/CodexNetDeployer/Configuration.cs b/Tools/CodexNetDeployer/Configuration.cs index dbf2c89d..3a371cd7 100644 --- a/Tools/CodexNetDeployer/Configuration.cs +++ b/Tools/CodexNetDeployer/Configuration.cs @@ -36,6 +36,12 @@ namespace CodexNetDeployer [Uniform("log-level", "l", "LOGLEVEL", true, "Log level used by each Codex node. [Trace, Debug*, Info, Warn, Error]")] public CodexLogLevel CodexLogLevel { get; set; } = CodexLogLevel.Debug; + + [Uniform("log-level-libp2p", "lp2p", "LOGLEVELLIBP2P", true, "Log level for all libp2p topics. [Trace, Debug, Info, Warn*, Error]")] + public CodexLogLevel Libp2pLogLevel { get; set; } = CodexLogLevel.Warn; + + [Uniform("log-level-discv5", "ldv5", "LOGLEVELDISCV5", true, "Log level for all discv5 topics. [Trace, Debug, Info, Warn*, Error]")] + public CodexLogLevel Discv5LogLevel { get; set; } = CodexLogLevel.Warn; [Uniform("test-tokens", "tt", "TESTTOKENS", true, "Initial amount of test-tokens minted for each Codex node.")] public int InitialTestTokens { get; set; } = int.MaxValue; @@ -68,9 +74,6 @@ namespace CodexNetDeployer [Uniform("check-connect", "cc", "CHECKCONNECT", false, "If true, deployer check ensure peer-connectivity between all deployed nodes after deployment. Default is false.")] public bool CheckPeerConnection { get; set; } = false; - //[Uniform("replication", "rep", "REPLICATION", false, "Number of times to repeat")] - //public int Replication { get; set; } = 0; - public List Validate() { var errors = new List(); diff --git a/Tools/CodexNetDeployer/Program.cs b/Tools/CodexNetDeployer/Program.cs index 2a879b43..aad5fab5 100644 --- a/Tools/CodexNetDeployer/Program.cs +++ b/Tools/CodexNetDeployer/Program.cs @@ -23,6 +23,9 @@ public class Program return; } + var deployer = new Deployer(config); + deployer.AnnouncePlugins(); + if (!args.Any(a => a == "-y")) { Console.WriteLine("Does the above config look good? [y/n]"); @@ -30,35 +33,11 @@ public class Program Console.WriteLine("I think so too."); } - //if (config.Replication == 0) - { - var deployer = new Deployer(config); - deployer.AnnouncePlugins(); - var deployment = deployer.Deploy(); + var deployment = deployer.Deploy(); - Console.WriteLine($"Writing deployment file '{config.DeployFile}'..."); - File.WriteAllText(config.DeployFile, JsonConvert.SerializeObject(deployment, Formatting.Indented)); - Console.WriteLine("Done!"); - } - //else - //{ - // var originalNamespace = config.KubeNamespace; - // var originalDeployFile = config.DeployFile; - // for (var i = 0; i < config.Replication; i++) - // { - // config.KubeNamespace = originalNamespace + "-" + i; - // config.DeployFile = originalDeployFile.ToLowerInvariant().Replace(".json", $"-{i}.json"); - - // var deployer = new Deployer(config); - // deployer.AnnouncePlugins(); - // var deployment = deployer.Deploy(); - - // Console.WriteLine($"Writing deployment file '{config.DeployFile}'..."); - // File.WriteAllText(config.DeployFile, JsonConvert.SerializeObject(deployment, Formatting.Indented)); - // } - - // Console.WriteLine("Done!"); - //} + Console.WriteLine($"Writing deployment file '{config.DeployFile}'..."); + File.WriteAllText(config.DeployFile, JsonConvert.SerializeObject(deployment, Formatting.Indented)); + Console.WriteLine("Done!"); } private static void PrintHelp()