Commit 5c9ee67e authored by Gyanendra Mishra's avatar Gyanendra Mishra

remove beacon specifics from teku & nimbus

parent 8b57488d
...@@ -75,5 +75,5 @@ This is the Startosis version of the popular [eth2-merge-kurtosis-module](https: ...@@ -75,5 +75,5 @@ This is the Startosis version of the popular [eth2-merge-kurtosis-module](https:
- [x] cl_rest_client/api_response_objects.go DESCOPED as facts will do this - [x] cl_rest_client/api_response_objects.go DESCOPED as facts will do this
- [x] cl_rest_client/el_rest_client - DESCOPED as facts will do this - [x] cl_rest_client/el_rest_client - DESCOPED as facts will do this
- [x] cl_node_metrics_info - pure POJO NO BLOCKERS - [x] cl_node_metrics_info - pure POJO NO BLOCKERS
- [ ] get render templates to have the magic strings subsituted with real values - [x] get render templates to have the magic strings subsituted with real values
- [ ] confirm that the 0x30000038 value in `static_files/genesis-generation-config/cl/config.yaml.tmpl` is correct - this makes prysm work - [ ] confirm that the 0x30000038 value in `static_files/genesis-generation-config/cl/config.yaml.tmpl` is correct - this makes prysm work
\ No newline at end of file
...@@ -63,8 +63,8 @@ NIMBUS_LOG_LEVELS = { ...@@ -63,8 +63,8 @@ NIMBUS_LOG_LEVELS = {
module_io.GlobalClientLogLevel.trace: "TRACE", module_io.GlobalClientLogLevel.trace: "TRACE",
} }
BEACON_ENR_FACT_NAME = "beacon-enr-fact" ENR_FACT_NAME = "enr-fact"
BEACON_HEALTH_FACT_NAME = "beacon-health-fact" HEALTH_FACT_NAME = "health-fact"
def launch( def launch(
...@@ -84,33 +84,28 @@ def launch( ...@@ -84,33 +84,28 @@ def launch(
extra_params = [param for param in extra_beacon_params] + [param for param in extra_validator_params] extra_params = [param for param in extra_beacon_params] + [param for param in extra_validator_params]
beacon_service_config = get_beacon_service_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params) service_config = get_service_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params)
beacon_service = add_service(service_id, beacon_service_config) nimbus_service = add_service(service_id, service_config)
beacon_http_port = beacon_service.ports[HTTP_PORT_ID]
# TODO the Golang code checks whether its 200, 206 or 503, maybe add that # TODO the Golang code checks whether its 200, 206 or 503, maybe add that
define_fact(service_id = service_id, fact_name = BEACON_HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = HTTP_PORT_ID)) define_fact(service_id = service_id, fact_name = HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = HTTP_PORT_ID))
wait(service_id = service_id, fact_name = BEACON_HEALTH_FACT_NAME) wait(service_id = service_id, fact_name = HEALTH_FACT_NAME)
define_fact(service_id = service_id, fact_name = BEACON_ENR_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/identity", field_extractor = ".data.enr", content_type = "application/json", port_id = HTTP_PORT_ID))
beacon_node_enr = wait(service_id = service_id, fact_name = BEACON_ENR_FACT_NAME)
beacon_metrics_port = beacon_service.ports[METRICS_PORT_ID] define_fact(service_id = service_id, fact_name = ENR_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/identity", field_extractor = ".data.enr", content_type = "application/json", port_id = HTTP_PORT_ID))
beacon_metrics_url = "{0}:{1}".format(beacon_service.ip_address, beacon_metrics_port.number) node_enr = wait(service_id = service_id, fact_name = ENR_FACT_NAME)
beacon_node_metrics_info = new_cl_node_metrics_info(service_id, METRICS_PATH, beacon_metrics_url) metrics_port = nimbus_service.ports[METRICS_PORT_ID]
nodes_metrics_info = [beacon_node_metrics_info] metrics_url = "{0}:{1}".format(nimbus_service.ip_address, metrics_port.number)
nimbus_node_metrics_info = new_cl_node_metrics_info(service_id, METRICS_PATH, metrics_url)
nodes_metrics_info = [nimbus_node_metrics_info]
# Launch validator node
beacon_http_url = "http://{0}:{1}".format(beacon_service.ip_address, beacon_http_port.number)
result = new_cl_client_context( result = new_cl_client_context(
"nimbus", "nimbus",
beacon_node_enr, node_enr,
beacon_service.ip_address, nimbus_service.ip_address,
HTTP_PORT_NUM, HTTP_PORT_NUM,
nodes_metrics_info, nodes_metrics_info,
service_id, service_id,
...@@ -119,7 +114,7 @@ def launch( ...@@ -119,7 +114,7 @@ def launch(
return result return result
def get_beacon_service_config( def get_service_config(
genesis_data, genesis_data,
image, image,
boot_cl_client_ctx, boot_cl_client_ctx,
......
...@@ -72,8 +72,8 @@ TEKU_LOG_LEVELS = { ...@@ -72,8 +72,8 @@ TEKU_LOG_LEVELS = {
} }
BEACON_ENR_FACT_NAME = "beacon-enr-fact" ENR_FACT_NAME = "enr-fact"
BEACON_HEALTH_FACT_NAME = "beacon-health-fact" HEALTH_FACT_NAME = "health-fact"
def launch( def launch(
...@@ -93,37 +93,35 @@ def launch( ...@@ -93,37 +93,35 @@ def launch(
extra_params = [param for param in extra_beacon_params] + [param for param in extra_validator_params] extra_params = [param for param in extra_beacon_params] + [param for param in extra_validator_params]
beacon_service_config = get_beacon_service_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params) service_config = get_service_config(launcher.cl_genesis_data, image, bootnode_context, el_client_context, mev_boost_context, log_level, node_keystore_files, extra_params)
beacon_service = add_service(service_id, beacon_service_config) teku_service = add_service(service_id, service_config)
beacon_http_port = beacon_service.ports[HTTP_PORT_ID]
# TODO the Golang code checks whether its 200, 206 or 503, maybe add that # TODO the Golang code checks whether its 200, 206 or 503, maybe add that
define_fact(service_id = service_id, fact_name = BEACON_HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = HTTP_PORT_ID)) define_fact(service_id = service_id, fact_name = HEALTH_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/health", content_type = "application/json", port_id = HTTP_PORT_ID))
wait(service_id = service_id, fact_name = BEACON_HEALTH_FACT_NAME) wait(service_id = service_id, fact_name = HEALTH_FACT_NAME)
define_fact(service_id = service_id, fact_name = BEACON_ENR_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/identity", field_extractor = ".data.enr", content_type = "application/json", port_id = HTTP_PORT_ID)) define_fact(service_id = service_id, fact_name = ENR_FACT_NAME, fact_recipe = struct(method= "GET", endpoint = "/eth/v1/node/identity", field_extractor = ".data.enr", content_type = "application/json", port_id = HTTP_PORT_ID))
beacon_node_enr = wait(service_id = service_id, fact_name = BEACON_ENR_FACT_NAME) node_enr = wait(service_id = service_id, fact_name = ENR_FACT_NAME)
beacon_metrics_port = beacon_service.ports[METRICS_PORT_ID] teku_metrics_port = teku_service.ports[METRICS_PORT_ID]
beacon_metrics_url = "{0}:{1}".format(beacon_service.ip_address, beacon_metrics_port.number) teku_metrics_url = "{0}:{1}".format(teku_service.ip_address, teku_metrics_port.number)
beacon_node_metrics_info = new_cl_node_metrics_info(service_id, METRICS_PATH, beacon_metrics_url) teku_node_metrics_info = new_cl_node_metrics_info(service_id, METRICS_PATH, teku_metrics_url)
nodes_metrics_info = [beacon_node_metrics_info] nodes_metrics_info = [teku_node_metrics_info]
result = new_cl_client_context( result = new_cl_client_context(
"teku", "teku",
beacon_node_enr, node_enr,
beacon_service.ip_address, teku_service.ip_address,
HTTP_PORT_NUM, HTTP_PORT_NUM,
nodes_metrics_info, nodes_metrics_info,
service_id service_id
) )
return result return result
def get_beacon_service_config( def get_service_config(
genesis_data, genesis_data,
image, image,
boot_cl_client_ctx, boot_cl_client_ctx,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment