Wires up deployer config

This commit is contained in:
benbierens 2023-10-23 13:08:49 +02:00
parent 4280f910ae
commit 020865f5c0
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 29 additions and 1 deletions

View File

@ -49,6 +49,11 @@ namespace CodexNetDeployer
if (config.BlockTTL != Configuration.SecondsIn1Day) s.WithBlockTTL(TimeSpan.FromSeconds(config.BlockTTL)); if (config.BlockTTL != Configuration.SecondsIn1Day) s.WithBlockTTL(TimeSpan.FromSeconds(config.BlockTTL));
if (config.BlockMI != Configuration.TenMinutes) s.WithBlockMaintenanceInterval(TimeSpan.FromSeconds(config.BlockMI)); if (config.BlockMI != Configuration.TenMinutes) s.WithBlockMaintenanceInterval(TimeSpan.FromSeconds(config.BlockMI));
if (config.BlockMN != 1000) s.WithBlockMaintenanceNumber(config.BlockMN); if (config.BlockMN != 1000) s.WithBlockMaintenanceNumber(config.BlockMN);
if (config.IsPublicTestNet)
{
s.AsPublicTestNet(CreatePublicTestNetConfig(i));
}
}); });
var debugInfo = codexNode.GetDebugInfo(); var debugInfo = codexNode.GetDebugInfo();
@ -93,6 +98,19 @@ namespace CodexNetDeployer
return null; return null;
} }
private CodexTestNetConfig CreatePublicTestNetConfig(int i)
{
var discPort = config.PublicDiscPorts.Split(",")[i];
var listenPort = config.PublicListenPorts.Split(",")[i];
return new CodexTestNetConfig
{
PublicNatIP = config.PublicIP,
PublicDiscoveryPort = Convert.ToInt32(discPort),
PublicListenPort = Convert.ToInt32(listenPort)
};
}
private string GetCodexContainerName(int i) private string GetCodexContainerName(int i)
{ {
if (i == 0) return "BOOTSTRAP"; if (i == 0) return "BOOTSTRAP";

View File

@ -55,7 +55,7 @@ namespace CodexNetDeployer
var ci = entryPoint.CreateInterface(); var ci = entryPoint.CreateInterface();
Log("Deploying Geth instance..."); Log("Deploying Geth instance...");
var gethDeployment = ci.DeployGeth(s => s.IsMiner().WithName("geth")); var gethDeployment = DeployGeth(ci);
var gethNode = ci.WrapGethDeployment(gethDeployment); var gethNode = ci.WrapGethDeployment(gethDeployment);
Log("Geth started. Deploying Codex contracts..."); Log("Geth started. Deploying Codex contracts...");
@ -98,6 +98,16 @@ namespace CodexNetDeployer
return result; return result;
} }
private GethDeployment DeployGeth(CoreInterface ci)
{
return ci.DeployGeth(s =>
{
s.IsMiner();
s.WithName("geth");
if (config.IsPublicTestNet) s.AsPublicTestNet();
});
}
private RunningContainer? StartMetricsService(CoreInterface ci, List<CodexNodeStartResult> startResults) private RunningContainer? StartMetricsService(CoreInterface ci, List<CodexNodeStartResult> startResults)
{ {
if (!config.MetricsScraper) return null; if (!config.MetricsScraper) return null;