generated from ethpandaops/template-devnets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:ethpandaops/mekong-devnets
- Loading branch information
Showing
7 changed files
with
281 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# role: ethpandaops.general.hive | ||
hive_container_www_image: "docker.ethquokkaops.io/dh/library/nginx:1.27.3-alpine" | ||
hive_container_www_env: | ||
VIRTUAL_PORT: "80" | ||
VIRTUAL_HOST: "hive.{{ network_subdomain }}" | ||
LETSENCRYPT_HOST: "hive.{{ network_subdomain }}" | ||
|
||
hive_repo_address: "https://github.com/danceratopz/hive.git" | ||
hive_repo_version: "prague-devnet-4" | ||
|
||
hive_simulations_client_config: | ||
- client: go-ethereum | ||
nametag: prague-devnet-4 | ||
dockerfile: git | ||
build_args: | ||
github: lightclient/go-ethereum | ||
tag: prague-devnet-4 | ||
- client: nethermind | ||
nametag: prague-devnet-4 | ||
dockerfile: git | ||
build_args: | ||
github: NethermindEth/nethermind | ||
tag: pectra_devnet_4 | ||
- client: reth | ||
nametag: prague-devnet-4 | ||
dockerfile: git | ||
build_args: | ||
github: paradigmxyz/reth | ||
tag: onbjerg/devnet-4 | ||
- client: besu | ||
nametag: prague-devnet-4 | ||
dockerfile: git | ||
build_args: | ||
github: hyperledger/besu | ||
tag: pectra-devnet-4 | ||
- client: ethereumjs | ||
nametag: prague-devnet-4 | ||
build_args: | ||
github: ethereumjs/ethereumjs-monorepo | ||
tag: 7702-devnet-4-plus-t8ntool | ||
- client: erigon | ||
nametag: prague-devnet-4 | ||
dockerfile: git | ||
build_args: | ||
github: erigontech/erigon | ||
tag: pectra_e2 | ||
|
||
hive_simulations_tests: | ||
# Consume Engine | ||
- simulator: ethereum/eest/consume-engine | ||
clients: | ||
- besu | ||
- erigon | ||
- ethereumjs | ||
- go-ethereum | ||
- nethermind | ||
- nimbus-el | ||
- reth | ||
extra_flags: | ||
- --client.checktimelimit=60s | ||
- --sim.parallelism=4 | ||
#- --sim.timelimit=2h | ||
|
||
# Consume RLP | ||
- simulator: ethereum/eest/consume-rlp | ||
clients: | ||
- besu | ||
- erigon | ||
- ethereumjs | ||
- go-ethereum | ||
- nethermind | ||
- nimbus-el | ||
- reth | ||
extra_flags: | ||
- --client.checktimelimit=60s | ||
- --sim.parallelism=4 | ||
#- --sim.timelimit=2h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[all:vars] | ||
ethereum_network_name=mekong-devnet-0 | ||
|
||
[hive] | ||
mekong-devnet-0-hive-001 ansible_host=104.248.203.255 cloud=digitalocean cloud_region=ams3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[all:vars] | ||
ethereum_network_name=${ethereum_network_name} | ||
|
||
[hive] | ||
${hostname} ansible_host=${ipv4} cloud=${cloud} cloud_region=${region} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
//////////////////////////////////////////////////////////////////////////////////////// | ||
// TERRAFORM PROVIDERS & BACKEND | ||
//////////////////////////////////////////////////////////////////////////////////////// | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "~> 2.28" | ||
} | ||
cloudflare = { | ||
source = "cloudflare/cloudflare" | ||
version = "~> 3.0" | ||
} | ||
} | ||
} | ||
|
||
terraform { | ||
backend "s3" { | ||
skip_credentials_validation = true | ||
skip_metadata_api_check = true | ||
endpoints = { s3 = "https://fra1.digitaloceanspaces.com" } | ||
skip_requesting_account_id = true | ||
skip_s3_checksum = true | ||
region = "us-east-1" | ||
bucket = "merge-testnets" | ||
key = "infrastructure/mekong-devnet-0/hive/terraform.tfstate" | ||
} | ||
} | ||
|
||
provider "digitalocean" { | ||
http_retry_max = 20 | ||
} | ||
|
||
provider "cloudflare" { | ||
api_token = var.cloudflare_api_token | ||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////// | ||
// VARIABLES | ||
//////////////////////////////////////////////////////////////////////////////////////// | ||
variable "cloudflare_api_token" { | ||
type = string | ||
sensitive = true | ||
description = "Cloudflare API Token" | ||
} | ||
|
||
variable "ethereum_network" { | ||
type = string | ||
default = "mekong-devnet-0" | ||
} | ||
|
||
variable "digitalocean_project_name" { | ||
type = string | ||
default = "Public Testnets" | ||
} | ||
|
||
variable "digitalocean_ssh_key_name" { | ||
type = string | ||
default = "shared-devops-eth2" | ||
} | ||
|
||
variable "digitalocean_region" { | ||
type = string | ||
default = "ams3" | ||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////// | ||
// DIGITALOCEAN RESOURCES | ||
//////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
data "digitalocean_project" "main" { | ||
name = var.digitalocean_project_name | ||
} | ||
|
||
data "digitalocean_ssh_key" "main" { | ||
name = var.digitalocean_ssh_key_name | ||
} | ||
|
||
resource "digitalocean_droplet" "main" { | ||
name = "${var.ethereum_network}-hive-001" | ||
region = var.digitalocean_region | ||
ssh_keys = [data.digitalocean_ssh_key.main.fingerprint] | ||
image = "debian-12-x64" | ||
size = "c2-8vcpu-16gb" | ||
resize_disk = true | ||
monitoring = true | ||
backups = false | ||
ipv6 = true | ||
tags = [ | ||
"Hive:${var.ethereum_network}" | ||
] | ||
} | ||
|
||
resource "digitalocean_project_resources" "droplets" { | ||
project = data.digitalocean_project.main.id | ||
resources = [digitalocean_droplet.main.urn] | ||
} | ||
|
||
resource "digitalocean_firewall" "main" { | ||
name = "${var.ethereum_network}-hive" | ||
// Tags are used to select which droplets should | ||
// be assigned to this firewall. | ||
tags = [ | ||
"Hive:${var.ethereum_network}" | ||
] | ||
|
||
// SSH | ||
inbound_rule { | ||
protocol = "tcp" | ||
port_range = "22" | ||
source_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
|
||
// Nginx / Web | ||
inbound_rule { | ||
protocol = "tcp" | ||
port_range = "80" | ||
source_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
|
||
inbound_rule { | ||
protocol = "tcp" | ||
port_range = "443" | ||
source_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
|
||
// Allow all outbound traffic | ||
outbound_rule { | ||
protocol = "tcp" | ||
port_range = "1-65535" | ||
destination_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
outbound_rule { | ||
protocol = "udp" | ||
port_range = "1-65535" | ||
destination_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
outbound_rule { | ||
protocol = "icmp" | ||
destination_addresses = ["0.0.0.0/0", "::/0"] | ||
} | ||
depends_on = [digitalocean_project_resources.droplets] | ||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////// | ||
// DNS NAMES | ||
//////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
data "cloudflare_zone" "default" { | ||
name = "ethpandaops.io" | ||
} | ||
|
||
resource "cloudflare_record" "server_record_v4" { | ||
zone_id = data.cloudflare_zone.default.id | ||
name = "hive.${var.ethereum_network}" | ||
type = "A" | ||
value = digitalocean_droplet.main.ipv4_address | ||
proxied = false | ||
ttl = 120 | ||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////// | ||
// GENERATED FILES AND OUTPUTS | ||
//////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
resource "local_file" "ansible_inventory" { | ||
depends_on = [digitalocean_droplet.main] | ||
content = templatefile("ansible_inventory.tmpl", | ||
{ | ||
ethereum_network_name = "${var.ethereum_network}" | ||
hostname = "${digitalocean_droplet.main.name}" | ||
ipv4 = "${digitalocean_droplet.main.ipv4_address}" | ||
cloud = "digitalocean" | ||
region = "${var.digitalocean_region}" | ||
} | ||
) | ||
filename = "../../../ansible/inventories/devnet-0/hive_inventory.ini" | ||
} |