mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
downsize devnet rpc (#724)
Co-authored-by: Name <benjamin202410@gmail.com>
This commit is contained in:
parent
a3bd485bd6
commit
338fb86bcd
6 changed files with 7 additions and 48 deletions
|
|
@ -2,7 +2,6 @@ terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
aws = {
|
aws = {
|
||||||
source = "hashicorp/aws"
|
source = "hashicorp/aws"
|
||||||
version = "~> 5.13.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
aws = {
|
aws = {
|
||||||
source = "hashicorp/aws"
|
source = "hashicorp/aws"
|
||||||
version = "~> 5.13.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# Bucket need to be created first. If first time run terraform init, need to comment out the below section
|
|
||||||
terraform {
|
terraform {
|
||||||
backend "s3" {
|
backend "s3" {
|
||||||
bucket = "tf-xinfin-bucket" // This name need to be updated to be the same as local.s3BucketName. We can't use variable here.
|
bucket = "tf-xinfin-bucket" // This name need to be updated to be the same as local.s3BucketName. We can't use variable here.
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,6 @@ variable docker_tag {
|
||||||
}
|
}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
/**
|
|
||||||
Load the nodes data from s3
|
|
||||||
Below is the the format the config needs to follow:
|
|
||||||
{{Name of the node, in a pattern of 'xdc'+ number. i.e xdc50}}: {
|
|
||||||
pk: {{Value of the node private key}},
|
|
||||||
... any other configuration we want to pass.
|
|
||||||
}
|
|
||||||
Note: No `n` is allowed in the node name
|
|
||||||
**/
|
|
||||||
predefinedNodesConfig = jsondecode(data.aws_s3_object.devnet_xdc_node_config.body)
|
predefinedNodesConfig = jsondecode(data.aws_s3_object.devnet_xdc_node_config.body)
|
||||||
envs = { for tuple in regexall("(.*)=(.*)", file(".env")) : tuple[0] => tuple[1] }
|
envs = { for tuple in regexall("(.*)=(.*)", file(".env")) : tuple[0] => tuple[1] }
|
||||||
logLevel = local.envs["log_level"]
|
logLevel = local.envs["log_level"]
|
||||||
|
|
@ -37,12 +28,12 @@ locals {
|
||||||
]
|
]
|
||||||
|
|
||||||
keyNames = {
|
keyNames = {
|
||||||
for r in local.regions :
|
for r in local.regions :
|
||||||
r.name => [for i in range(r.start, r.end+1) : "xdc${i}"]
|
r.name => [for i in range(r.start, r.end+1) : "xdc${i}"]
|
||||||
}
|
}
|
||||||
|
|
||||||
devnetNodeKeys = {
|
devnetNodeKeys = {
|
||||||
for r in local.regions :
|
for r in local.regions :
|
||||||
r.name => { for i in local.keyNames[r.name]: i => local.predefinedNodesConfig[i] }
|
r.name => { for i in local.keyNames[r.name]: i => local.predefinedNodesConfig[i] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ provider "aws" {
|
||||||
region = "us-east-1"
|
region = "us-east-1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# WARNING: APSE-1 will only be used to host rpc node
|
|
||||||
# Workaround to avoid conflicts with existing ecs cluster in existing regions
|
|
||||||
provider "aws" {
|
provider "aws" {
|
||||||
alias = "ap-southeast-1"
|
alias = "ap-southeast-1"
|
||||||
region = "ap-southeast-1"
|
region = "ap-southeast-1"
|
||||||
|
|
@ -25,9 +23,9 @@ module "devnet_rpc" {
|
||||||
vpc_id = local.vpc_id
|
vpc_id = local.vpc_id
|
||||||
aws_subnet_id = local.aws_subnet_id
|
aws_subnet_id = local.aws_subnet_id
|
||||||
ami_id = local.ami_id
|
ami_id = local.ami_id
|
||||||
instance_type = "t3.xlarge"
|
instance_type = "t3.large"
|
||||||
ssh_key_name = local.ssh_key_name
|
ssh_key_name = local.ssh_key_name
|
||||||
rpc_image = local.rpc_image
|
rpc_image = local.rpc_image
|
||||||
volume_size = 1500
|
volume_size = 1500
|
||||||
|
|
||||||
providers = {
|
providers = {
|
||||||
|
|
@ -43,7 +41,7 @@ module "testnet_rpc" {
|
||||||
ami_id = local.ami_id
|
ami_id = local.ami_id
|
||||||
instance_type = "t3.large"
|
instance_type = "t3.large"
|
||||||
ssh_key_name = local.ssh_key_name
|
ssh_key_name = local.ssh_key_name
|
||||||
rpc_image = local.rpc_image
|
rpc_image = local.rpc_image
|
||||||
volume_size = 1500
|
volume_size = 1500
|
||||||
|
|
||||||
providers = {
|
providers = {
|
||||||
|
|
@ -59,7 +57,7 @@ module "mainnet_rpc" {
|
||||||
ami_id = local.ami_id
|
ami_id = local.ami_id
|
||||||
instance_type = "t3.large"
|
instance_type = "t3.large"
|
||||||
ssh_key_name = local.ssh_key_name
|
ssh_key_name = local.ssh_key_name
|
||||||
rpc_image = local.rpc_image
|
rpc_image = local.rpc_image
|
||||||
volume_size = 3000
|
volume_size = 3000
|
||||||
|
|
||||||
providers = {
|
providers = {
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,14 @@
|
||||||
locals {
|
locals {
|
||||||
/**
|
|
||||||
Load the nodes data from s3
|
|
||||||
Below is the the format the config needs to follow:
|
|
||||||
{{Name of the node, in a pattern of 'xdc'+ number. i.e xdc50}}: {
|
|
||||||
pk: {{Value of the node private key}},
|
|
||||||
... any other configuration we want to pass.
|
|
||||||
}
|
|
||||||
Note: No `n` is allowed in the node name
|
|
||||||
**/
|
|
||||||
predefinedNodesConfig = jsondecode(data.aws_s3_object.xdc_node_config.body)
|
predefinedNodesConfig = jsondecode(data.aws_s3_object.xdc_node_config.body)
|
||||||
envs = { for tuple in regexall("(.*)=(.*)", file(".env")) : tuple[0] => tuple[1] }
|
envs = { for tuple in regexall("(.*)=(.*)", file(".env")) : tuple[0] => tuple[1] }
|
||||||
logLevel = local.envs["log_level"]
|
logLevel = local.envs["log_level"]
|
||||||
|
|
||||||
# regions = [
|
|
||||||
# {
|
|
||||||
# "name": "us-east-2", // Ohio
|
|
||||||
# "start": local.envs["us_east_2_start"],
|
|
||||||
# "end": local.envs["us_east_2_end"],
|
|
||||||
# }
|
|
||||||
# ]
|
|
||||||
|
|
||||||
# keyNames = {
|
|
||||||
# for r in local.regions :
|
|
||||||
# r.name => [for i in range(r.start, r.end+1) : "xdc${i}"]
|
|
||||||
# }
|
|
||||||
|
|
||||||
# nodeKeys = {
|
|
||||||
# for r in local.regions :
|
|
||||||
# r.name => { for i in local.keyNames[r.name]: i => local.predefinedNodesConfig[i] }
|
|
||||||
# }
|
|
||||||
|
|
||||||
rpcDevnetNodeKeys = { "devnet-rpc1": local.predefinedNodesConfig["devnet-rpc1"]} // we hardcode the rpc to a single node for now
|
rpcDevnetNodeKeys = { "devnet-rpc1": local.predefinedNodesConfig["devnet-rpc1"]} // we hardcode the rpc to a single node for now
|
||||||
rpcTestnetNodeKeys = { "testnet-rpc1": local.predefinedNodesConfig["testnet-rpc1"]} // we hardcode the rpc to a single node for now
|
rpcTestnetNodeKeys = { "testnet-rpc1": local.predefinedNodesConfig["testnet-rpc1"]} // we hardcode the rpc to a single node for now
|
||||||
rpcMainnetNodeKeys = { "mainnet-rpc1": local.predefinedNodesConfig["mainnet-rpc1"]} // we hardcode the rpc to a single node for now
|
rpcMainnetNodeKeys = { "mainnet-rpc1": local.predefinedNodesConfig["mainnet-rpc1"]} // we hardcode the rpc to a single node for now
|
||||||
}
|
}
|
||||||
|
|
||||||
locals { //ec2_rpc values
|
locals {
|
||||||
ami_id = "ami-097c4e1feeea169e5"
|
ami_id = "ami-097c4e1feeea169e5"
|
||||||
rpc_image = "xinfinorg/xdposchain:v2.2.0-beta1"
|
rpc_image = "xinfinorg/xdposchain:v2.2.0-beta1"
|
||||||
vpc_id = "vpc-20a06846"
|
vpc_id = "vpc-20a06846"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue