From 458652e7f8496e4575409292ac74f02d63f237cf Mon Sep 17 00:00:00 2001 From: Alexis Pentori Date: Fri, 29 Sep 2023 17:48:02 +0200 Subject: [PATCH] sepolia: Exposing ERA files Signed-off-by: Alexis Pentori --- README.md | 1 + ansible/era.yml | 1 + ansible/group_vars/nimbus.sepolia.yml | 8 ++++++ .../linux-01.ih-eu-mda1.nimbus.sepolia.yml | 26 +++++++++++++++++++ ansible/sepolia.yml | 7 ++--- sepolia.tf | 9 +++++++ 6 files changed, 49 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2afab7b..fc7b44c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ There are also archives of ERA files: |----------------------------------|--------------------------------------| | https://mainnet.era.nimbus.team/ | `linux-03.ih-eu-mda1.nimbus.mainnet` | | https://prater.era.nimbus.team/ | `linux-01.ih-eu-mda1.nimbus.prater` | +| https://sepolia.era.nimbus.team/ | `linux-01.ih-eu-mda1.sepolia.prater` | # Dashboards diff --git a/ansible/era.yml b/ansible/era.yml index df8be50..41899b1 100644 --- a/ansible/era.yml +++ b/ansible/era.yml @@ -14,6 +14,7 @@ hosts: - linux-03.ih-eu-mda1.nimbus.mainnet - linux-01.ih-eu-mda1.nimbus.prater + - linux-01.ih-eu-mda1.nimbus.sepolia vars: open_ports_default_comment: 'Nginx' open_ports_default_chain: 'SERVICES' diff --git a/ansible/group_vars/nimbus.sepolia.yml b/ansible/group_vars/nimbus.sepolia.yml index a234ee5..07d09ad 100644 --- a/ansible/group_vars/nimbus.sepolia.yml +++ b/ansible/group_vars/nimbus.sepolia.yml @@ -26,6 +26,7 @@ geth_websocket_port: '{{ 9546 + idx|int + 11 }}' # Beacon Nodes beacon_node_service_name: 'beacon-node-{{ beacon_node_network }}-{{ beacon_node_repo_branch }}-{{ "%02d"|format(idx|int+1) }}' beacon_node_network: 'sepolia' +beacon_node_era_dir_path: '{{ nimbus_era_files_timer_path }}' beacon_node_repo_branch: '{{ node.get("branch", "unstable") }}' beacon_node_build_nim_flags: '-d:noSignalHandler {{ node.get("nim_flags", "") }}' beacon_node_extra_flags: '{{ node.extra_flags if node.extra_flags is defined else [] }}' @@ -76,6 +77,13 @@ validator_client_dist_validators_enabled: '{{ node.start is defined and node.end validator_client_dist_validators_start: '{{ (not node.validator_client) | ternary(0, node.start) | mandatory }}' validator_client_dist_validators_end: '{{ (not node.validator_client) | ternary(0, node.end) | mandatory }}' +# ERA files geneartion. +nimbus_era_files_timer_enabled: '{{ (nodes_layout[hostname]|length) > 1 }}' +nimbus_era_files_timer_path: '/data/era' +nimbus_era_files_network: '{{ beacon_node_network }}' +nimbus_era_files_db_path: '/data/beacon-node-{{ beacon_node_network }}-unstable-01/data/db' +nimbus_era_files_nclidb_path: '/data/beacon-node-{{ beacon_node_network }}-unstable-01/repo/build/ncli_db' + # Open Ports open_ports_default_chain: 'VPN' open_ports_list: diff --git a/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.sepolia.yml b/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.sepolia.yml index 10dfaf0..3de8e9d 100644 --- a/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.sepolia.yml +++ b/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.sepolia.yml @@ -6,3 +6,29 @@ beacon_node_rest_address: '0.0.0.0' redirect_ports: # beacon-node-sepolia-unstable-01 - { src: 80, dst: 9311, comment: 'Test Beacon API (80->9311/tcp)' } + +# Era files hosting +era_files_domain: 'sepolia.era.nimbus.team' +era_files_path: '/data/era' + +# CloudFlare Origin certificates +origin_certs: + - domain: 'nimbus.team' + crt: '{{lookup("bitwarden", "CloudFlare/nimbus.team", file="origin.crt")}}' + key: '{{lookup("bitwarden", "CloudFlare/nimbus.team", file="origin.key")}}' + +nginx_sites: + era_files: + - listen 80 default_server + - listen 443 ssl + + - server_name {{ era_files_domain }} + + - ssl_certificate /certs/nimbus.team/origin.crt + - ssl_certificate_key /certs/nimbus.team/origin.key + + - location / { + root {{ era_files_path }}; + autoindex on; + autoindex_format html; + } diff --git a/ansible/sepolia.yml b/ansible/sepolia.yml index 556371e..62ad375 100644 --- a/ansible/sepolia.yml +++ b/ansible/sepolia.yml @@ -15,9 +15,10 @@ hosts: - nimbus-sepolia-linux roles: - - { role: open-ports, tags: [ open-ports ] } - - { role: smart-metrics, tags: [ smart-metrics ] } - - { role: redirect-ports, tags: [ redirect-ports ] } + - { role: open-ports, tags: [ open-ports ] } + - { role: smart-metrics, tags: [ smart-metrics ] } + - { role: redirect-ports, tags: [ redirect-ports ] } + - { role: nimbus-era-files, tags: [ nimbus-era-files ] } tasks: - include_role: name=infra-role-geth with_items: '{{ nodes_layout[hostname] }}' diff --git a/sepolia.tf b/sepolia.tf index e460307..366b14b 100644 --- a/sepolia.tf +++ b/sepolia.tf @@ -22,3 +22,12 @@ resource "cloudflare_record" "unstable_sepolia_beacon_api" { type = "A" proxied = false } + +/* ERA Files hosting */ +resource "cloudflare_record" "era_sepolia" { + zone_id = local.zones["nimbus.team"] + name = "sepolia.era" + value = module.nimbus_nodes_sepolia_innova.public_ips[0] + type = "A" + proxied = true +}