Wires up block-maintenance number of blocks param

This commit is contained in:
benbierens 2023-08-14 16:37:31 +02:00
parent c0b7d3a747
commit 86bae93e98
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
4 changed files with 13 additions and 0 deletions

View File

@ -55,6 +55,10 @@ namespace DistTestCore.Codex
{
AddEnvVar("CODEX_BLOCK_MI", Convert.ToInt32(config.BlockMaintenanceInterval.Value.TotalSeconds).ToString());
}
if (config.BlockMaintenanceNumber != null)
{
AddEnvVar("CODEX_BLOCK_MN", config.BlockMaintenanceNumber.ToString()!);
}
if (config.MetricsMode != Metrics.MetricsMode.None)
{
AddEnvVar("CODEX_METRICS", "true");

View File

@ -20,5 +20,6 @@ namespace DistTestCore.Codex
public string? BootstrapSpr { get; set; }
public int? BlockTTL { get; set; }
public TimeSpan? BlockMaintenanceInterval { get; set; }
public int? BlockMaintenanceNumber { get; set; }
}
}

View File

@ -12,6 +12,7 @@ namespace DistTestCore
ICodexSetup WithStorageQuota(ByteSize storageQuota);
ICodexSetup WithBlockTTL(TimeSpan duration);
ICodexSetup WithBlockMaintenanceInterval(TimeSpan duration);
ICodexSetup WithBlockMaintenanceNumber(int numberOfBlocks);
ICodexSetup EnableMetrics();
ICodexSetup EnableMarketplace(TestToken initialBalance);
ICodexSetup EnableMarketplace(TestToken initialBalance, Ether initialEther);
@ -64,6 +65,12 @@ namespace DistTestCore
return this;
}
public ICodexSetup WithBlockMaintenanceNumber(int numberOfBlocks)
{
BlockMaintenanceNumber = numberOfBlocks;
return this;
}
public ICodexSetup EnableMetrics()
{
MetricsMode = Metrics.MetricsMode.Record;

View File

@ -68,6 +68,7 @@ namespace Tests.BasicTests
.EnableMarketplace(100000.TestTokens(), 0.Eth(), isValidator: true)
.WithBlockTTL(TimeSpan.FromMinutes(2))
.WithBlockMaintenanceInterval(TimeSpan.FromMinutes(3))
.WithBlockMaintenanceNumber(10000)
.WithStorageQuota(3.GB()));
var nodes = group.Cast<OnlineCodexNode>().ToArray();