Separate config option for storage space to sell.

This commit is contained in:
benbierens 2023-06-29 11:05:58 +02:00
parent 4b6c8a9191
commit 6a5cde2b91
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 9 additions and 2 deletions

View File

@ -52,7 +52,7 @@ namespace CodexNetDeployer
Console.Write("Tokens minted\t");
var response = marketAccess.MakeStorageAvailable(
totalSpace: (config.StorageQuota!.Value - 1).MB(),
totalSpace: config.StorageSell!.Value.MB(),
minPriceForTotalSpace: config.MinPrice.TestTokens(),
maxCollateral: config.MaxCollateral.TestTokens(),
maxDuration: TimeSpan.FromSeconds(config.MaxDuration));

View File

@ -28,9 +28,12 @@ namespace CodexNetDeployer
[Uniform("validators", "v", "VALIDATORS", true, "Number of Codex nodes that will be validating.")]
public int? NumberOfValidators { get; set; }
[Uniform("storage-quota", "s", "STORAGEQUOTA", true, "Storage quota in megabytes used by each Codex node.")]
[Uniform("storage-quota", "sq", "STORAGEQUOTA", true, "Storage quota in megabytes used by each Codex node.")]
public int? StorageQuota { get; set; }
[Uniform("storage-sell", "ss", "STORAGESELL", true, "Number of megabytes of storage quota to make available for selling.")]
public int? StorageSell { get; set; }
[Uniform("log-level", "l", "LOGLEVEL", true, "Log level used by each Codex node. [Trace, Debug*, Info, Warn, Error]")]
public CodexLogLevel CodexLogLevel { get; set; } = CodexLogLevel.Debug;
@ -60,6 +63,10 @@ namespace CodexNetDeployer
{
errors.Add($"{nameof(NumberOfValidators)} ({NumberOfValidators}) may not be greater than {nameof(NumberOfCodexNodes)} ({NumberOfCodexNodes}).");
}
if (StorageSell.HasValue && StorageQuota.HasValue && StorageSell.Value >= StorageQuota.Value)
{
errors.Add("StorageSell cannot be greater than or equal to StorageQuota.");
}
return errors;
}