get-geth-api-urls: use HTTP RPC API for unstable only

Current support for HTTP RPC API is not stable enough.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-12-03 19:40:52 +01:00
parent 0c1169cee3
commit 5dae92080a
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
8 changed files with 46 additions and 10 deletions

View File

@ -23,6 +23,13 @@ beacon_node_threads: '{{ (node.branch == "testing") | ternary(4, 1) }}'
beacon_node_dist_validators_enabled: false
# Bootnodes should subscribe to all subnets
beacon_node_subscribe_all: true
# HTTP RPC support is unstable
beacon_node_web3_urls: |
{{ beacon_node_web3_urls_all
| reject("match",
((node.branch == "unstable")
| ternary("^ws://", "^http://"))
) }}
# Split by hostname for more central location
nodes_layout:

View File

@ -25,6 +25,13 @@ beacon_node_dist_validators_start: '{{ node.start | mandatory }}'
beacon_node_dist_validators_end: '{{ node.end | mandatory }}'
# Windows service user
beacon_node_service_user_pass: '{{lookup("bitwarden", "nimbus/windows", field="password")}}'
# HTTP RPC support is unstable
beacon_node_web3_urls: |
{{ beacon_node_web3_urls_all
| reject("match",
((node.branch == "unstable")
| ternary("^ws://", "^http://"))
) }}
# Split by hostname for more central location
nodes_layout:

View File

@ -19,6 +19,13 @@ beacon_node_build_frequency: '{{ node.build_frequency }}'
beacon_node_dist_validators_enabled: '{{ node.start is defined and node.end is defined }}'
beacon_node_dist_validators_start: '{{ node.start | mandatory }}'
beacon_node_dist_validators_end: '{{ node.end | mandatory }}'
# HTTP RPC support is unstable
beacon_node_web3_urls: |
{{ beacon_node_web3_urls_all
| reject("match",
((node.branch == "unstable")
| ternary("^ws://", "^http://"))
) }}
# Split by hostname and branch for more central location.
nodes_layout:

View File

@ -46,17 +46,17 @@
- name: infra-role-beacon-node-linux
src: git@github.com:status-im/infra-role-beacon-node-linux.git
version: 2050efc83aec03947910d6c8987151889f31bbec
version: 79ece2904e9293290afe6753e0ebf57799d2e073
scm: git
- name: infra-role-beacon-node-windows
src: git@github.com:status-im/infra-role-beacon-node-windows.git
version: f7b873b15ee540ced872fa9587d7a8ae7b49283f
version: dfa53d2bde956a05f4ccdd196ee0ae2312a133b6
scm: git
- name: infra-role-beacon-node-macos
src: git@github.com:status-im/infra-role-beacon-node-macos.git
version: 34dff283aeb6d327a88ce524626c64b87094a7d6
version: 520721920500413e7b4e665abed3e358f6d45414
scm: git
- name: infra-role-nimbus-eth1

View File

@ -6,7 +6,7 @@ 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-rpc'
geth_node_api_consul_name: 'nimbus-{{ eth1_network_name | mandatory }}-node'
# The more the merrier, since we don't want to hit Infura throttling.
infura_api_tokens:
- '9e2f2cc13f70432f8b87dbe7d51b81db'

View File

@ -4,8 +4,14 @@
url: '{{ consul_catalog_url }}/datacenters'
register: data_centers
- name: Find available geth websocket services
- name: Find available Geth API RPC services
uri:
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}?dc={{ item }}'
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_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 }}'
with_items: '{{ data_centers.json }}'
register: geth_ws_services

View File

@ -6,9 +6,17 @@
return_content: true
register: data_centers
- name: Find available geth websocket services
- name: Find available Geth API RPC services
win_uri:
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}?dc={{ item }}'
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}-rpc?dc={{ item }}'
content_type: 'application/json'
return_content: true
with_items: '{{ data_centers.json }}'
register: geth_rpc_services
- name: Find available Geth WebSocket services
win_uri:
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}-ws?dc={{ item }}'
content_type: 'application/json'
return_content: true
with_items: '{{ data_centers.json }}'

View File

@ -9,7 +9,8 @@
- name: Extract Geth websocket IP and port
set_fact:
geth_api_addresses: |
{{ geth_ws_services.results
{{ (geth_rpc_services.results
+ geth_ws_services.results)
| selectattr("json", "defined")
| sum(attribute="json", start=[])
| map(attribute='ServiceMeta.url')
@ -18,4 +19,4 @@
- name: Extract Goerli Geth WebSocket URL
set_fact:
# our nodes first (will be used by default) then an infura node
beacon_node_web3_urls: "{{ geth_api_addresses + [ selected_infura_url ] }}"
beacon_node_web3_urls_all: "{{ geth_api_addresses + [ selected_infura_url ] }}"