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.BlockMI != Configuration.TenMinutes) s.WithBlockMaintenanceInterval(TimeSpan.FromSeconds(config.BlockMI));
if (config.BlockMN != 1000) s.WithBlockMaintenanceNumber(config.BlockMN);
if (config.IsPublicTestNet)
{
s.AsPublicTestNet(CreatePublicTestNetConfig(i));
}
});
var debugInfo = codexNode.GetDebugInfo();
@ -93,6 +98,19 @@ namespace CodexNetDeployer
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)
{
if (i == 0) return "BOOTSTRAP";

View File

@ -55,7 +55,7 @@ namespace CodexNetDeployer
var ci = entryPoint.CreateInterface();
Log("Deploying Geth instance...");
var gethDeployment = ci.DeployGeth(s => s.IsMiner().WithName("geth"));
var gethDeployment = DeployGeth(ci);
var gethNode = ci.WrapGethDeployment(gethDeployment);
Log("Geth started. Deploying Codex contracts...");
@ -98,6 +98,16 @@ namespace CodexNetDeployer
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)
{
if (!config.MetricsScraper) return null;