2023-09-11 11:59:33 +02:00
|
|
|
|
using KubernetesWorkflow;
|
2023-09-08 09:39:56 +02:00
|
|
|
|
using Utils;
|
2023-04-13 09:33:10 +02:00
|
|
|
|
|
2023-09-11 11:59:33 +02:00
|
|
|
|
namespace CodexPlugin
|
2023-04-12 13:53:55 +02:00
|
|
|
|
{
|
|
|
|
|
public class CodexStartupConfig
|
|
|
|
|
{
|
2023-04-30 10:56:19 +02:00
|
|
|
|
public string? NameOverride { get; set; }
|
2023-09-25 08:47:19 +02:00
|
|
|
|
public ILocation Location { get; set; } = KnownLocations.UnspecifiedLocation;
|
2023-09-13 14:37:53 +02:00
|
|
|
|
public CodexLogLevel LogLevel { get; set; }
|
2023-10-17 13:52:04 +02:00
|
|
|
|
public CodexLogCustomTopics? CustomTopics { get; set; } = new CodexLogCustomTopics(CodexLogLevel.Warn, CodexLogLevel.Warn);
|
2023-04-12 13:53:55 +02:00
|
|
|
|
public ByteSize? StorageQuota { get; set; }
|
2023-09-13 11:59:21 +02:00
|
|
|
|
public bool MetricsEnabled { get; set; }
|
2023-09-19 10:24:43 +02:00
|
|
|
|
public MarketplaceInitialConfig? MarketplaceConfig { get; set; }
|
2023-04-24 14:09:23 +02:00
|
|
|
|
public string? BootstrapSpr { get; set; }
|
2023-06-29 16:03:45 +02:00
|
|
|
|
public int? BlockTTL { get; set; }
|
2023-09-14 15:02:53 +10:00
|
|
|
|
public uint? SimulateProofFailures { get; set; }
|
|
|
|
|
public bool? EnableValidator { get; set; }
|
2023-08-14 15:51:03 +02:00
|
|
|
|
public TimeSpan? BlockMaintenanceInterval { get; set; }
|
2023-08-14 16:37:31 +02:00
|
|
|
|
public int? BlockMaintenanceNumber { get; set; }
|
2023-10-23 12:33:48 +02:00
|
|
|
|
public CodexTestNetConfig? PublicTestNet { get; set; }
|
2023-09-21 11:07:27 +02:00
|
|
|
|
|
|
|
|
|
public string LogLevelWithTopics()
|
|
|
|
|
{
|
|
|
|
|
var level = LogLevel.ToString()!.ToUpperInvariant();
|
2023-10-07 09:48:12 +02:00
|
|
|
|
if (CustomTopics != null)
|
2023-09-21 11:07:27 +02:00
|
|
|
|
{
|
2023-10-07 09:48:12 +02:00
|
|
|
|
var discV5Topics = new[]
|
|
|
|
|
{
|
|
|
|
|
"discv5",
|
|
|
|
|
"providers",
|
|
|
|
|
"manager",
|
|
|
|
|
"cache",
|
|
|
|
|
};
|
|
|
|
|
var libp2pTopics = new[]
|
|
|
|
|
{
|
|
|
|
|
"libp2p",
|
|
|
|
|
"multistream",
|
|
|
|
|
"switch",
|
|
|
|
|
"transport",
|
|
|
|
|
"tcptransport",
|
|
|
|
|
"semaphore",
|
|
|
|
|
"asyncstreamwrapper",
|
2023-10-08 08:04:04 +02:00
|
|
|
|
"lpstream",
|
|
|
|
|
"mplex",
|
|
|
|
|
"mplexchannel",
|
|
|
|
|
"noise",
|
|
|
|
|
"bufferstream",
|
|
|
|
|
"mplexcoder",
|
2023-10-09 12:33:35 +02:00
|
|
|
|
"secure",
|
|
|
|
|
"chronosstream",
|
|
|
|
|
"connection",
|
|
|
|
|
"connmanager",
|
2023-10-08 08:04:04 +02:00
|
|
|
|
"websock",
|
2024-01-18 10:24:59 +01:00
|
|
|
|
"ws-session",
|
|
|
|
|
"dialer",
|
|
|
|
|
"muxedupgrade",
|
|
|
|
|
"upgrade",
|
|
|
|
|
"identify"
|
2023-10-07 09:48:12 +02:00
|
|
|
|
};
|
2024-01-18 09:55:07 +01:00
|
|
|
|
var blockExchangeTopics = new[]
|
|
|
|
|
{
|
|
|
|
|
"codex",
|
|
|
|
|
"pendingblocks",
|
|
|
|
|
"peerctxstore",
|
|
|
|
|
"discoveryengine",
|
2024-01-18 10:24:59 +01:00
|
|
|
|
"blockexcengine",
|
|
|
|
|
"blockexcnetwork",
|
|
|
|
|
"blockexcnetworkpeer"
|
2024-01-18 09:55:07 +01:00
|
|
|
|
};
|
2024-03-14 14:29:28 +01:00
|
|
|
|
var contractClockTopics = new[]
|
|
|
|
|
{
|
|
|
|
|
"contracts",
|
|
|
|
|
"clock"
|
|
|
|
|
};
|
2024-05-07 11:04:32 +02:00
|
|
|
|
var jsonSerializeTopics = new[]
|
|
|
|
|
{
|
|
|
|
|
"serde",
|
|
|
|
|
"json",
|
|
|
|
|
"serialization"
|
|
|
|
|
};
|
2023-10-07 09:48:12 +02:00
|
|
|
|
|
|
|
|
|
level = $"{level};" +
|
|
|
|
|
$"{CustomTopics.DiscV5.ToString()!.ToLowerInvariant()}:{string.Join(",", discV5Topics)};" +
|
2024-03-14 14:29:28 +01:00
|
|
|
|
$"{CustomTopics.Libp2p.ToString()!.ToLowerInvariant()}:{string.Join(",", libp2pTopics)};" +
|
2024-05-07 11:04:32 +02:00
|
|
|
|
$"{CustomTopics.ContractClock.ToString().ToLowerInvariant()}:{string.Join(",", contractClockTopics)};" +
|
|
|
|
|
$"{CustomTopics.JsonSerialize.ToString().ToLowerInvariant()}:{string.Join(",", jsonSerializeTopics)}";
|
2024-01-18 09:55:07 +01:00
|
|
|
|
|
|
|
|
|
if (CustomTopics.BlockExchange != null)
|
|
|
|
|
{
|
|
|
|
|
level += $";{CustomTopics.BlockExchange.ToString()!.ToLowerInvariant()}:{string.Join(",", blockExchangeTopics)}";
|
|
|
|
|
}
|
2023-09-21 11:07:27 +02:00
|
|
|
|
}
|
|
|
|
|
return level;
|
|
|
|
|
}
|
2023-04-12 13:53:55 +02:00
|
|
|
|
}
|
2023-10-23 12:33:48 +02:00
|
|
|
|
|
|
|
|
|
public class CodexTestNetConfig
|
|
|
|
|
{
|
|
|
|
|
public int PublicDiscoveryPort { get; set; }
|
|
|
|
|
public int PublicListenPort { get; set; }
|
|
|
|
|
}
|
2023-04-12 13:53:55 +02:00
|
|
|
|
}
|