2023-09-11 09:59:33 +00:00
|
|
|
|
using KubernetesWorkflow;
|
2023-09-08 07:39:56 +00:00
|
|
|
|
using Utils;
|
2023-04-13 07:33:10 +00:00
|
|
|
|
|
2023-09-11 09:59:33 +00:00
|
|
|
|
namespace CodexPlugin
|
2023-04-12 11:53:55 +00:00
|
|
|
|
{
|
|
|
|
|
public class CodexStartupConfig
|
|
|
|
|
{
|
2023-04-30 08:56:19 +00:00
|
|
|
|
public string? NameOverride { get; set; }
|
2023-09-25 06:47:19 +00:00
|
|
|
|
public ILocation Location { get; set; } = KnownLocations.UnspecifiedLocation;
|
2023-09-13 12:37:53 +00:00
|
|
|
|
public CodexLogLevel LogLevel { get; set; }
|
2023-10-07 07:48:12 +00:00
|
|
|
|
public CodexLogCustomTopics? CustomTopics { get; set; }
|
2023-04-12 11:53:55 +00:00
|
|
|
|
public ByteSize? StorageQuota { get; set; }
|
2023-09-13 09:59:21 +00:00
|
|
|
|
public bool MetricsEnabled { get; set; }
|
2023-09-19 08:24:43 +00:00
|
|
|
|
public MarketplaceInitialConfig? MarketplaceConfig { get; set; }
|
2023-04-24 12:09:23 +00:00
|
|
|
|
public string? BootstrapSpr { get; set; }
|
2023-06-29 14:03:45 +00:00
|
|
|
|
public int? BlockTTL { get; set; }
|
2023-09-14 05:02:53 +00:00
|
|
|
|
public uint? SimulateProofFailures { get; set; }
|
|
|
|
|
public bool? EnableValidator { get; set; }
|
2023-08-14 13:51:03 +00:00
|
|
|
|
public TimeSpan? BlockMaintenanceInterval { get; set; }
|
2023-08-14 14:37:31 +00:00
|
|
|
|
public int? BlockMaintenanceNumber { get; set; }
|
2023-09-21 09:07:27 +00:00
|
|
|
|
|
|
|
|
|
public string LogLevelWithTopics()
|
|
|
|
|
{
|
|
|
|
|
var level = LogLevel.ToString()!.ToUpperInvariant();
|
2023-10-07 07:48:12 +00:00
|
|
|
|
if (CustomTopics != null)
|
2023-09-21 09:07:27 +00:00
|
|
|
|
{
|
2023-10-07 07:48:12 +00:00
|
|
|
|
var discV5Topics = new[]
|
|
|
|
|
{
|
|
|
|
|
"discv5",
|
|
|
|
|
"providers",
|
|
|
|
|
"manager",
|
|
|
|
|
"cache",
|
|
|
|
|
};
|
|
|
|
|
var libp2pTopics = new[]
|
|
|
|
|
{
|
|
|
|
|
"libp2p",
|
|
|
|
|
"multistream",
|
|
|
|
|
"switch",
|
|
|
|
|
"transport",
|
|
|
|
|
"tcptransport",
|
|
|
|
|
"semaphore",
|
|
|
|
|
"asyncstreamwrapper",
|
|
|
|
|
"lpstream"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
level = $"{level};" +
|
|
|
|
|
$"{CustomTopics.DiscV5.ToString()!.ToLowerInvariant()}:{string.Join(",", discV5Topics)};" +
|
|
|
|
|
$"{CustomTopics.Libp2p.ToString()!.ToLowerInvariant()}:{string.Join(",", libp2pTopics)}";
|
2023-09-21 09:07:27 +00:00
|
|
|
|
}
|
|
|
|
|
return level;
|
|
|
|
|
}
|
2023-04-12 11:53:55 +00:00
|
|
|
|
}
|
|
|
|
|
}
|