Skip to content

Commit

Permalink
feat: add execution client urls to dora config (#588)
Browse files Browse the repository at this point in the history
upcoming version of dora uses execution layer clients to crawl the
deposit contract log.
This PR adds the execution client urls to the dora config.
  • Loading branch information
pk910 authored May 6, 2024
1 parent aabc942 commit 2a20d5a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/dora/dora_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def launch_dora(
global_node_selectors,
):
all_cl_client_info = []
all_el_client_info = []
for index, participant in enumerate(participant_contexts):
full_name, cl_client, _, _ = shared_utils.get_client_names(
full_name, cl_client, el_client, _ = shared_utils.get_client_names(
participant, index, participant_contexts, participant_configs
)
all_cl_client_info.append(
Expand All @@ -47,9 +48,18 @@ def launch_dora(
full_name,
)
)
all_el_client_info.append(
new_el_client_info(
"http://{0}:{1}".format(
el_client.ip_addr,
el_client.rpc_port_num,
),
full_name,
)
)

template_data = new_config_template_data(
network_params.network, HTTP_PORT_NUMBER, all_cl_client_info
network_params.network, HTTP_PORT_NUMBER, all_cl_client_info, all_el_client_info
)

template_and_data = shared_utils.new_template_and_data(
Expand Down Expand Up @@ -105,11 +115,12 @@ def get_config(
)


def new_config_template_data(network, listen_port_num, cl_client_info):
def new_config_template_data(network, listen_port_num, cl_client_info, el_client_info):
return {
"Network": network,
"ListenPortNum": listen_port_num,
"CLClientInfo": cl_client_info,
"ELClientInfo": el_client_info,
"PublicNetwork": True if network in constants.PUBLIC_NETWORKS else False,
}

Expand All @@ -119,3 +130,10 @@ def new_cl_client_info(beacon_http_url, full_name):
"Beacon_HTTP_URL": beacon_http_url,
"FullName": full_name,
}


def new_el_client_info(execution_http_url, full_name):
return {
"Execution_HTTP_URL": execution_http_url,
"FullName": full_name,
}
9 changes: 9 additions & 0 deletions static_files/dora-config/config.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ beaconapi:
redisCacheAddr: ""
redisCachePrefix: ""

executionapi:
endpoints:
{{ range $clClient := .ELClientInfo }}
- url: "{{ $clClient.Execution_HTTP_URL }}"
name: "{{ $clClient.FullName }}"
archive: true
{{- end }}
depositLogBatchSize: 1000

# indexer keeps track of the latest epochs in memory.
indexer:
# max number of epochs to keep in memory
Expand Down

0 comments on commit 2a20d5a

Please sign in to comment.