diff --git a/Tools/CodexNetDeployer/Configuration.cs b/Tools/CodexNetDeployer/Configuration.cs index 4592756..3d24e0b 100644 --- a/Tools/CodexNetDeployer/Configuration.cs +++ b/Tools/CodexNetDeployer/Configuration.cs @@ -80,6 +80,18 @@ namespace CodexNetDeployer [Uniform("check-connect", "cc", "CHECKCONNECT", false, "If true, deployer check ensure peer-connectivity between all deployed nodes after deployment. Default is false.")] public bool CheckPeerConnection { get; set; } = false; + [Uniform("public-testnet", "ptn", "PUBLICTESTNET", false, "If true, deployment is created for public exposure. Default is false.")] + public bool IsPublicTestNet { get; set; } = false; + + [Uniform("public-ip", "pip", "PUBLICIP", false, "Required if public-testnet is true. Public IP used by nodes for network annoucements.")] + public string PublicIP { get; set; } = string.Empty; + + [Uniform("public-discports", "pdps", "PUBLICDISCPORTS", false, "Required if public-testnet is true. Comma-separated port numbers used for discovery. Number must match number of nodes.")] + public string PublicDiscPorts { get; set; } = string.Empty; + + [Uniform("public-listenports", "plps", "PUBLICLISTENPORTS", false, "Required if public-testnet is true. Comma-separated port numbers used for listening. Number must match number of nodes.")] + public string PublicListenPorts { get; set; } = string.Empty; + public List Validate() { var errors = new List(); @@ -100,6 +112,13 @@ namespace CodexNetDeployer errors.Add("StorageSell cannot be greater than or equal to StorageQuota."); } + if (IsPublicTestNet) + { + if (string.IsNullOrEmpty(PublicIP)) errors.Add("Public IP required when deploying public testnet."); + if (PublicDiscPorts.Split(",").Length != NumberOfCodexNodes) errors.Add("Number of public discovery-ports provided does not match number of codex nodes."); + if (PublicListenPorts.Split(",").Length != NumberOfCodexNodes) errors.Add("Number of public listen-ports provided does not match number of codex nodes."); + } + return errors; } diff --git a/Tools/CodexNetDeployer/deploy-public-testnet.sh b/Tools/CodexNetDeployer/deploy-public-testnet.sh new file mode 100644 index 0000000..fd93214 --- /dev/null +++ b/Tools/CodexNetDeployer/deploy-public-testnet.sh @@ -0,0 +1,24 @@ +dotnet run \ + --deploy-name=codex-public-testnet \ + --kube-config=/opt/kubeconfig.yaml \ + --kube-namespace=codex-public-testnet \ + --deploy-file=codex-public-testnet-deployment.json \ + --nodes=3 \ + --validators=1 \ + --log-level=Trace \ + --storage-quota=2048 \ + --storage-sell=1024 \ + --min-price=1024 \ + --max-collateral=1024 \ + --max-duration=3600000 \ + --block-ttl=180 \ + --block-mi=120 \ + --block-mn=10000 \ + --metrics-endpoints=1 \ + --metrics-scraper=0 \ + --check-connect=1 \ +\ + --public-testnet=1 \ + --public-ip=1.2.3.4 \ + --public-discports=20010,20020,20030 \ + --public-listenports=20011,20021,20031