Wires up the codex log topics config options.

This commit is contained in:
benbierens 2023-10-08 07:29:55 +02:00
parent ab9257ce56
commit 4f764ac4c7
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 14 additions and 32 deletions

View File

@ -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();

View File

@ -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<string> Validate()
{
var errors = new List<string>();

View File

@ -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()