Separate config option for storage space to sell.
This commit is contained in:
parent
4b6c8a9191
commit
6a5cde2b91
@ -52,7 +52,7 @@ namespace CodexNetDeployer
|
|||||||
Console.Write("Tokens minted\t");
|
Console.Write("Tokens minted\t");
|
||||||
|
|
||||||
var response = marketAccess.MakeStorageAvailable(
|
var response = marketAccess.MakeStorageAvailable(
|
||||||
totalSpace: (config.StorageQuota!.Value - 1).MB(),
|
totalSpace: config.StorageSell!.Value.MB(),
|
||||||
minPriceForTotalSpace: config.MinPrice.TestTokens(),
|
minPriceForTotalSpace: config.MinPrice.TestTokens(),
|
||||||
maxCollateral: config.MaxCollateral.TestTokens(),
|
maxCollateral: config.MaxCollateral.TestTokens(),
|
||||||
maxDuration: TimeSpan.FromSeconds(config.MaxDuration));
|
maxDuration: TimeSpan.FromSeconds(config.MaxDuration));
|
||||||
|
@ -28,9 +28,12 @@ namespace CodexNetDeployer
|
|||||||
[Uniform("validators", "v", "VALIDATORS", true, "Number of Codex nodes that will be validating.")]
|
[Uniform("validators", "v", "VALIDATORS", true, "Number of Codex nodes that will be validating.")]
|
||||||
public int? NumberOfValidators { get; set; }
|
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; }
|
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]")]
|
[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;
|
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}).");
|
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;
|
return errors;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user