From 513fb2bb8820c411c82b25f0b0fa98788b74caaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 15 Sep 2022 14:30:30 +0200 Subject: [PATCH] get-geth-api-urls: drop Infura URLs entirely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mainnet merge has happened, so no need for the exception. Signed-off-by: Jakub SokoĊ‚owski --- ansible/roles/get-geth-api-urls/README.md | 10 ++-------- ansible/roles/get-geth-api-urls/defaults/main.yml | 12 ------------ .../roles/get-geth-api-urls/tasks/consul/posix.yml | 4 ++-- .../roles/get-geth-api-urls/tasks/consul/windows.yml | 4 ++-- ansible/roles/get-geth-api-urls/tasks/main.yml | 8 -------- 5 files changed, 6 insertions(+), 32 deletions(-) diff --git a/ansible/roles/get-geth-api-urls/README.md b/ansible/roles/get-geth-api-urls/README.md index 4582c42..17fb2b4 100644 --- a/ansible/roles/get-geth-api-urls/README.md +++ b/ansible/roles/get-geth-api-urls/README.md @@ -6,13 +6,7 @@ This role assembles the list of Web3 Eth1 URLs used by Nimbus Beacon nodes to sy There are only two important configuration keys: ```yaml -geth_node_api_consul_name: 'my-geth-node-rpc' -infura_api_tokens: - - 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - - 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' - - 'cccccccccccccccccccccccccccccccc' +geth_node_api_fleet_name: 'nimbus.geth' +geth_node_api_consul_names: ['my-geth-node-rpc'] ``` -And the more we have the less likely that we hit the Infura threshold. -Infura endpoints are only used for Mainnet. - The Geth node Consul service is expected to have an `url` in metadata. diff --git a/ansible/roles/get-geth-api-urls/defaults/main.yml b/ansible/roles/get-geth-api-urls/defaults/main.yml index 9d14c12..0b44c63 100644 --- a/ansible/roles/get-geth-api-urls/defaults/main.yml +++ b/ansible/roles/get-geth-api-urls/defaults/main.yml @@ -10,16 +10,4 @@ geth_node_api_fleet_name: 'nimbus.geth' geth_node_api_consul_names: - 'geth-{{ eth1_network_name | mandatory }}' -geth_api_addresses: [] -# The more the merrier, since we don't want to hit Infura throttling. -infura_api_tokens: - - '9e2f2cc13f70432f8b87dbe7d51b81db' - - '922cc3c4badf4789b68d895267530a4a' - - '01cde3e0c47a47ff8dcdc52259b3a71c' - - '675db4626923473591cf6418e4dae175' - - '5cae339ba3144f438e8da1db2c25cad4' - -selected_infura_token: '{{ infura_api_tokens[play_hosts.index(inventory_hostname) % (infura_api_tokens|length)] }}' -selected_infura_url: 'wss://{{ eth1_network_name }}.infura.io/ws/v3/{{ selected_infura_token }}' - consul_catalog_url: 'http://localhost:8500/v1/catalog' diff --git a/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml b/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml index 8ae569d..801997d 100644 --- a/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml +++ b/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml @@ -13,8 +13,8 @@ # On Windows json attribute is missing when it's []. - name: Extract Geth websocket IP and port set_fact: - geth_api_addresses: | - {{ (geth_api_addresses + geth_rpc_services.results) + beacon_node_web3_urls_all: | + {{ geth_rpc_services.results | sum(attribute="json", start=[]) | map(attribute="ServiceMeta.url") | list }} diff --git a/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml b/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml index 53dfd7d..b14251b 100644 --- a/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml +++ b/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml @@ -17,8 +17,8 @@ # On Windows json attribute is missing when it's []. - name: Extract Geth websocket IP and port set_fact: - geth_api_addresses: | - {{ (geth_api_addresses + geth_rpc_services.results) + beacon_node_web3_urls_all: | + {{ geth_rpc_services.results | selectattr("json", "defined") | sum(attribute="json", start=[]) | map(attribute="ServiceMeta.url") diff --git a/ansible/roles/get-geth-api-urls/tasks/main.yml b/ansible/roles/get-geth-api-urls/tasks/main.yml index ed9246b..2780732 100644 --- a/ansible/roles/get-geth-api-urls/tasks/main.yml +++ b/ansible/roles/get-geth-api-urls/tasks/main.yml @@ -10,11 +10,3 @@ loop: '{{ geth_node_api_consul_names }}' loop_control: loop_var: 'service_name' - -- name: Extract Goerli Geth WebSocket URL - set_fact: - # Our nodes first (will be used by default) then an Infura node. - # Currently only Mainnet has not had it's merge, so it can use Infura. - beacon_node_web3_urls_all: | - {{ geth_api_addresses + - (eth1_network_name == "mainnet") | ternary([selected_infura_url], []) }}