Skip to content

Commit

Permalink
Mainnet testnet infra changes (#340)
Browse files Browse the repository at this point in the history
* create child module for mainnet

* create tfvars example

* add provisioner scripts

* changes to provisioner scripts

* delete autoid bootstrap node script since will make reusable

* rename to use one domain bootstrap node

* change domain labels

change label name

* change LE directory path for certificate

* rename files to indexer nodes

* add root module for mainnet network primitives

* dns changes

* testnet network-primitives changes to labels

* change provisioners to reuse the same domain compose scripts

* create separate domain node provisioners and fix labels

* hetzner module refactor

* disable comments on resources

* Change hetzner module name (#341)

* change module name to ovh

* rename hetzner to ovh
  • Loading branch information
DaMandal0rian committed Sep 19, 2024
1 parent 6b8e739 commit e07cf6b
Show file tree
Hide file tree
Showing 44 changed files with 3,460 additions and 461 deletions.
9 changes: 9 additions & 0 deletions resources/mainnet/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
cloud {
organization = "subspace-sre"

workspaces {
name = "mainnet"
}
}
}
20 changes: 20 additions & 0 deletions resources/mainnet/common.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
variable "nr_api_key" {
description = "New relic API Key"
type = string
}

variable "cloudflare_email" {
type = string
description = "cloudflare email address"
}

variable "cloudflare_api_token" {
type = string
description = "cloudflare api token"
}

variable "netdata_token" {
type = string
sensitive = true

}
170 changes: 170 additions & 0 deletions resources/mainnet/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
module "gemini-3h" {
source = "../../templates/terraform/mainnet-primitives"
path_to_scripts = "../../templates/terraform/mainnet-primitives/scripts"
path_to_configs = "../../templates/terraform/mainnet-primitives/configs"
network_name = var.network_name

bootstrap-node-config = {
instance-type = var.instance_type["bootstrap"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["bootstrap"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-sep-03"
reserved-only = false
prune = false
genesis-hash = "0c121c75f4ef450f40619e1fca9d1e8e7fbabc42c895bc4790801e85d5a91c34"
dsn-listen-port = 30533
node-dsn-port = 30433
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

bootstrap-node-evm-config = {
instance-type = var.instance_type["evm_bootstrap"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["evm_bootstrap"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-sep-03"
reserved-only = false
prune = false
genesis-hash = "0c121c75f4ef450f40619e1fca9d1e8e7fbabc42c895bc4790801e85d5a91c34"
dsn-listen-port = 30533
node-dsn-port = 30433
operator-port = 30334
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

bootstrap-node-autoid-config = {
instance-type = var.instance_type["autoid_bootstrap"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["autoid_bootstrap"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-sep-03"
reserved-only = false
prune = false
genesis-hash = "0c121c75f4ef450f40619e1fca9d1e8e7fbabc42c895bc4790801e85d5a91c34"
dsn-listen-port = 30533
node-dsn-port = 30433
operator-port = 30334
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

rpc-indexer-node-config = {
instance-type = var.instance_type["rpc-indexer"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["rpc-indexer"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-jul-16"
domain-prefix = "rpc-indexer"
reserved-only = false
prune = false
node-dsn-port = 30433
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

nova-indexer-node-config = {
instance-type = var.instance_type["nova-indexer"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["nova-indexer"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-jul-16"
domain-prefix = "nova-indexer"
reserved-only = false
prune = false
node-dsn-port = 30433
enable-domains = true
domain-id = var.domain_id
domain-labels = var.domain_labels
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

rpc-node-config = {
instance-type = var.instance_type["rpc"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["rpc"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-sep-03"
domain-prefix = "rpc"
reserved-only = false
prune = false
node-dsn-port = 30433
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

evm-node-config = {
instance-type = var.instance_type["domain"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["domain"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-sep-03"
domain-prefix = "nova"
reserved-only = false
prune = false
node-dsn-port = 30433
enable-domains = true
domain-id = var.domain_id
domain-labels = var.domain_labels
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

autoid-node-config = {
instance-type = var.instance_type["autoid"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["autoid"]
docker-org = "subspace"
docker-tag = "gemini-3h-2024-may-06"
domain-prefix = ["autoid"]
reserved-only = false
prune = false
node-dsn-port = 30434
enable-domains = true
domain-id = var.domain_id
domain-labels = var.domain_labels
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type
}

farmer-node-config = {
instance-type = var.instance_type["farmer"]
deployment-version = 0
regions = var.aws_region
instance-count = var.instance_count["farmer"]
docker-org = "autonomys"
docker-tag = "gemini-3h-2024-sep-03"
reserved-only = false
prune = false
plot-size = "100G"
reward-address = var.farmer_reward_address
force-block-production = true
node-dsn-port = 30433
disk-volume-size = var.disk_volume_size
disk-volume-type = var.disk_volume_type

}

cloudflare_api_token = var.cloudflare_api_token
cloudflare_email = var.cloudflare_email
nr_api_key = var.nr_api_key
access_key = var.access_key
secret_key = var.secret_key
vpc_id = var.vpc_id
instance_type = var.instance_type
vpc_cidr_block = var.vpc_cidr_block
public_subnet_cidrs = var.public_subnet_cidrs
pot_external_entropy = var.pot_external_entropy

}
51 changes: 51 additions & 0 deletions resources/mainnet/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//output
output "rpc-indexer-node-ipv4-addresses" {
value = module.mainnet.rpc-indexer_node_public_ip
description = "RPC indexer node IPv4 Addresses"
}

output "nova-indexer-node-ipv4-addresses" {
value = module.mainnet.nova-indexer_node_public_ip
description = "Nova indexer node IPv4 Addresses"
}

output "farmer-node-ipv4-addresses" {
value = module.mainnet.farmer_node_public_ip
description = "Farmer node IPv4 Addresses"
}

output "bootstrap-node-ipv4-addresses" {
value = module.mainnet.bootstrap_node_public_ip
description = "Bootstrap node IPv4 Addresses"
}

output "bootstrap-node-evm-ipv4-addresses" {
value = module.mainnet.bootstrap_node_evm_public_ip
description = "EVM Bootstrap node IPv4 Addresses"
}

output "bootstrap-node-autoid-ipv4-addresses" {
value = module.mainnet.bootstrap_node_autoid_public_ip
description = "AutoID Bootstrap node IPv4 Addresses"
}

output "evm-node-ipv4-addresses" {
value = module.mainnet.domain_node_public_ip
description = "Domain node IPv4 Addresses"
}

output "autoid-node-ipv4-addresses" {
value = module.mainnet.autoid_node_public_ip
description = "AutoID node IPv4 Addresses"
}

output "rpc-node-ipv4-addresses" {
value = module.mainnet.rpc_node_public_ip
description = "RPC node IPv4 Addresses"
}

output "pot_external_entropy" {
value = var.pot_external_entropy
description = "Pot external entropy"

}
17 changes: 17 additions & 0 deletions resources/mainnet/terrafrom.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# AWS access key used to create infrastructure
access_key = ""
# AWS secret key used to create AWS infrastructure
secret_key = ""
vpc_id = "mainnet-vpc"
vpc_cidr_block = "172.37.0.0/16"
public_subnet_cidrs = ["172.37.1.0/24"]
aws_key_name = "deployer"
ssh_user = "ubuntu"
disk_volume_size = 200
private_key_path = "~/.ssh/deployer.pem"
aws_region = ["us-east-1"]
azs = "us-east-1b"
cloudflare_email = ""
cloudflare_api_token = ""
nr_api_key = ""
farmer_reward_address = ""
120 changes: 120 additions & 0 deletions resources/mainnet/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
variable "network_name" {
description = "Network name"
type = string
default = "mainnet"

}
variable "farmer_reward_address" {
description = "Farmer's reward address"
type = string
}

//todo change this to a map
variable "domain_id" {
description = "Domain ID"
type = list(number)
default = [0, 1]
}

//todo change this to a map
variable "domain_labels" {
description = "Tag of the domain to run"
type = list(string)
default = ["nova, "autoid"]
}
variable "instance_type" {
type = map(string)
default = {
bootstrap = "c7a.2xlarge"
rpc = "m6a.2xlarge"
domain = "m6a.2xlarge"
rpc-indexer = "c7a.2xlarge"
nova-indexer = "c7a.2xlarge"
farmer = "c7a.2xlarge"
evm_bootstrap = "c7a.xlarge"
autoid_bootstrap = "c7a.xlarge"
}
}
variable "vpc_id" {
default = "mainnet-vpc"
type = string
}
variable "vpc_cidr_block" {
type = string
}
variable "azs" {
type = string
description = "Availability Zones"
default = "us-east-1b"
}
variable "instance_count" {
type = map(number)
default = {
bootstrap = 2
rpc = 2
domain = 0
autoid = 0
rpc-indexer = 1
nova-indexer = 0
farmer = 0
evm_bootstrap = 1
autoid_bootstrap = 0
}
}
variable "aws_region" {
description = "aws region"
type = list(string)
default = ["us-east-1"]
}
variable "public_subnet_cidrs" {
type = list(string)
description = "Public Subnet CIDR values"
default = ["172.35.1.0/24"]
}
variable "disk_volume_size" {
type = number
}
variable "disk_volume_type" {
type = string
default = "gp3"
}
variable "secret_key" {
type = string
sensitive = true
}
variable "access_key" {
type = string
sensitive = true
}
variable "aws_key_name" {
default = "deployer"
type = string
}
variable "ssh_user" {
default = "ubuntu"
type = string
}
variable "private_key_path" {
type = string
default = "~/.ssh/deployer.pem"
}
variable "pot_external_entropy" {
description = "External entropy, used initially when PoT chain starts to derive the first seed"
type = string
default = "test"
}
File renamed without changes.
Loading

0 comments on commit e07cf6b

Please sign in to comment.