mirror of
https://github.com/status-im/infra-nimbus.git
synced 2025-01-12 23:04:40 +00:00
get-geth-api-urls: query for OpenEthereum nodes too
https://github.com/status-im/infra-nimbus/issues/80 Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
f82df25498
commit
c8fa895f98
@ -111,7 +111,7 @@
|
||||
|
||||
- name: infra-role-geth
|
||||
src: git@github.com:status-im/infra-role-geth.git
|
||||
version: 3de59d6ae76b69291905d16c264a1d11a5e2e955
|
||||
version: 11cdfe59ff57faaa33ed0b6d98414ece8862b20d
|
||||
scm: git
|
||||
|
||||
- name: infra-role-geth-exporter
|
||||
@ -121,5 +121,5 @@
|
||||
|
||||
- name: infra-role-openethereum
|
||||
src: git@github.com:status-im/infra-role-openethereum.git
|
||||
version: 83996de847c3573c1957d563782921cb24c79971
|
||||
version: 4e8fb26533ae97924dec258e158119aa4d3edf0f
|
||||
scm: git
|
||||
|
@ -6,7 +6,10 @@ eth2_to_eth1_map:
|
||||
|
||||
eth2_network_name: '{{ beacon_node_network | mandatory }}'
|
||||
eth1_network_name: '{{ eth2_to_eth1_map[eth2_network_name] | mandatory }}'
|
||||
geth_node_api_consul_name: 'nimbus-{{ eth1_network_name | mandatory }}-node'
|
||||
geth_node_api_consul_names:
|
||||
- 'geth-{{ eth1_network_name | mandatory }}'
|
||||
- 'openeth-{{ eth1_network_name | mandatory }}'
|
||||
geth_api_addresses: []
|
||||
# The more the merrier, since we don't want to hit Infura throttling.
|
||||
infura_api_tokens:
|
||||
- '9e2f2cc13f70432f8b87dbe7d51b81db'
|
||||
|
@ -6,12 +6,23 @@
|
||||
|
||||
- name: Find available Geth API RPC services
|
||||
uri:
|
||||
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}-rpc?dc={{ item }}'
|
||||
url: '{{ consul_catalog_url }}/service/{{ service_name }}-rpc?dc={{ item }}'
|
||||
with_items: '{{ data_centers.json }}'
|
||||
register: geth_rpc_services
|
||||
|
||||
- name: Find available Geth API WebSocket services
|
||||
uri:
|
||||
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}-ws?dc={{ item }}'
|
||||
url: '{{ consul_catalog_url }}/service/{{ service_name }}-ws?dc={{ item }}'
|
||||
with_items: '{{ data_centers.json }}'
|
||||
register: geth_ws_services
|
||||
|
||||
# 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
|
||||
+ geth_ws_services.results)
|
||||
| sum(attribute="json", start=[])
|
||||
| map(attribute='ServiceMeta.url')
|
||||
| list }}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
- name: Find available Geth API RPC services
|
||||
win_uri:
|
||||
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}-rpc?dc={{ item }}'
|
||||
url: '{{ consul_catalog_url }}/service/{{ service_name }}-rpc?dc={{ item }}'
|
||||
content_type: 'application/json'
|
||||
return_content: true
|
||||
with_items: '{{ data_centers.json }}'
|
||||
@ -16,8 +16,20 @@
|
||||
|
||||
- name: Find available Geth WebSocket services
|
||||
win_uri:
|
||||
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}-ws?dc={{ item }}'
|
||||
url: '{{ consul_catalog_url }}/service/{{ service_name }}-ws?dc={{ item }}'
|
||||
content_type: 'application/json'
|
||||
return_content: true
|
||||
with_items: '{{ data_centers.json }}'
|
||||
register: geth_ws_services
|
||||
|
||||
# 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
|
||||
+ geth_ws_services.results)
|
||||
| selectattr("json", "defined")
|
||||
| sum(attribute="json", start=[])
|
||||
| map(attribute='ServiceMeta.url')
|
||||
| list }}
|
||||
|
@ -1,20 +1,15 @@
|
||||
---
|
||||
- include_tasks: consul/posix.yml
|
||||
when: ansible_system in ['Linux', 'Darwin']
|
||||
loop: '{{ geth_node_api_consul_names }}'
|
||||
loop_control:
|
||||
loop_var: 'service_name'
|
||||
|
||||
- include_tasks: consul/windows.yml
|
||||
when: ansible_system == 'Win32NT'
|
||||
|
||||
# On Windows json attribute is missing when it's [].
|
||||
- name: Extract Geth websocket IP and port
|
||||
set_fact:
|
||||
geth_api_addresses: |
|
||||
{{ (geth_rpc_services.results
|
||||
+ geth_ws_services.results)
|
||||
| selectattr("json", "defined")
|
||||
| sum(attribute="json", start=[])
|
||||
| map(attribute='ServiceMeta.url')
|
||||
| list }}
|
||||
loop: '{{ geth_node_api_consul_names }}'
|
||||
loop_control:
|
||||
loop_var: 'service_name'
|
||||
|
||||
- name: Extract Goerli Geth WebSocket URL
|
||||
set_fact:
|
||||
|
Loading…
x
Reference in New Issue
Block a user