Commit 8d58d8e3 authored by Gyanendra Mishra's avatar Gyanendra Mishra

this works against victors last commit

parent 58b41687
...@@ -5,12 +5,14 @@ load("github.com/kurtosis-tech/eth2-module/src/static_files/static_files.star", ...@@ -5,12 +5,14 @@ load("github.com/kurtosis-tech/eth2-module/src/static_files/static_files.star",
load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_data_generator/genesis_constants/genesis_constants.star", "PRE_FUNDED_ACCOUNTS") load("github.com/kurtosis-tech/eth2-module/src/participant_network/prelaunch_data_generator/genesis_constants/genesis_constants.star", "PRE_FUNDED_ACCOUNTS")
load("github.com/kurtosis-tech/eth2-module/src/transaction_spammer/transaction_spammer.star", "launch_transaction_spammer") load("github.com/kurtosis-tech/eth2-module/src/transaction_spammer/transaction_spammer.star", "launch_transaction_spammer")
load("github.com/kurtosis-tech/eth2-module/src/forkmon/forkmon_launcher.star", "launch_forkmon")
module_io = import_types("github.com/kurtosis-tech/eth2-module/types.proto") module_io = import_types("github.com/kurtosis-tech/eth2-module/types.proto")
def main(input_args): def main(input_args):
input_args_with_right_defaults = module_io.ModuleInput(parse_input(input_args)) input_args_with_right_defaults = module_io.ModuleInput(parse_input(input_args))
num_participants = len(input_args_with_right_defaults.participants) num_participants = len(input_args_with_right_defaults.participants)
network_params = input_args_with_right_defaults.network_params
grafana_datasource_config_template = read_file(GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH) grafana_datasource_config_template = read_file(GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH)
grafana_dashboards_config_template = read_file(GRAFANA_DASHBOARD_PROVIDERS_CONFIG_TEMPLATE_FILEPATH) grafana_dashboards_config_template = read_file(GRAFANA_DASHBOARD_PROVIDERS_CONFIG_TEMPLATE_FILEPATH)
...@@ -18,8 +20,8 @@ def main(input_args): ...@@ -18,8 +20,8 @@ def main(input_args):
print("Read the prometheus, grafana templates") print("Read the prometheus, grafana templates")
print("Launching participant network with {0} participants and the following network params {1}".format(num_participants, input_args_with_right_defaults.network_params)) print("Launching participant network with {0} participants and the following network params {1}".format(num_participants, network_params))
all_participants, cl_gensis_timestamp = launch_participant_network(input_args_with_right_defaults.participants, input_args_with_right_defaults.network_params, input_args_with_right_defaults.global_client_log_level) all_participants, cl_gensis_timestamp = launch_participant_network(input_args_with_right_defaults.participants, network_params, input_args_with_right_defaults.global_client_log_level)
print(all_participants) print(all_participants)
print(cl_gensis_timestamp) print(cl_gensis_timestamp)
...@@ -41,6 +43,11 @@ def main(input_args): ...@@ -41,6 +43,11 @@ def main(input_args):
# We need a way to do time.sleep # We need a way to do time.sleep
# TODO add code that waits for CL genesis # TODO add code that waits for CL genesis
print("Launching forkmon")
forkmon_config_template = read_file(FORKMON_CONFIG_TEMPLATE_FILEPATH)
launch_forkmon(forkmon_config_template, all_cl_client_contexts, cl_gensis_timestamp, network_params.seconds_per_slot, network_params.slots_per_epoch)
print("Succesfully launched forkmon")
grafana_info = module_io.GrafanaInfo( grafana_info = module_io.GrafanaInfo(
dashboard_path = "dummy_path", dashboard_path = "dummy_path",
......
...@@ -5,7 +5,7 @@ SERVICE_ID = "forkmon" ...@@ -5,7 +5,7 @@ SERVICE_ID = "forkmon"
IMAGE_NAME = "ralexstokes/ethereum_consensus_monitor:latest" IMAGE_NAME = "ralexstokes/ethereum_consensus_monitor:latest"
HTTP_PORT_ID = "http" HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER = uint16(80) HTTP_PORT_NUMBER = 80
HTTP_PROTOCOL = "TCP" HTTP_PROTOCOL = "TCP"
FORKMON_CONFIG_FILENAME = "forkmon-config.toml" FORKMON_CONFIG_FILENAME = "forkmon-config.toml"
...@@ -51,12 +51,12 @@ def get_service_config(config_files_artifact_uuid): ...@@ -51,12 +51,12 @@ def get_service_config(config_files_artifact_uuid):
used_ports = USED_PORTS, used_ports = USED_PORTS,
files_artifact_mount_dirpaths = { files_artifact_mount_dirpaths = {
config_files_artifact_uuid: FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE, config_files_artifact_uuid: FORKMON_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
} },
cmd_args = ["--config-path", config_file_path] cmd_args = ["/usr/src/ethereum_consensus_monitor", "--config-path", config_file_path]
) )
def new_config_template_data(): def new_config_template_data(listen_port_num, cl_client_info, seconds_per_slot, slots_per_epoch, genesis_unix_timestamp):
return { return {
"ListenPortNum": listen_port_num, "ListenPortNum": listen_port_num,
"CLClientInfo": cl_client_info, "CLClientInfo": cl_client_info,
......
...@@ -158,7 +158,7 @@ def launch_participant_network(participants, network_params, global_log_level): ...@@ -158,7 +158,7 @@ def launch_participant_network(participants, network_params, global_log_level):
cl_client_context = launch_method(cl_launcher, cl_service_id, participant.cl_client_image, participant.cl_client_log_level, global_log_level, boot_cl_client_ctx, cl_client_context = launch_method(cl_launcher, cl_service_id, participant.cl_client_image, participant.cl_client_log_level, global_log_level, boot_cl_client_ctx,
el_client_context, mev_boost_context, new_cl_node_validator_keystores, participant.beacon_extra_params, participant.validator_extra_params) el_client_context, mev_boost_context, new_cl_node_validator_keystores, participant.beacon_extra_params, participant.validator_extra_params)
all_cl_client_contexts.append(el_client_context) all_cl_client_contexts.append(cl_client_context)
all_participants = [] all_participants = []
......
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