Skip to content

Commit

Permalink
feat: add multiple endpoint support for lightbeaconchain expolorer (#151
Browse files Browse the repository at this point in the history
)
  • Loading branch information
barnabasbusa authored Aug 25, 2023
1 parent b0079cf commit 68572cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/light_beaconchain/light_beaconchain_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ def launch_light_beacon(
cl_client_contexts,
):

cl_client_info = []
cl_client_info.append(new_cl_client_info(cl_client_contexts[0].ip_addr, cl_client_contexts[0].http_port_num, cl_client_contexts[0].beacon_service_name))
all_cl_client_info = []
for index, client in enumerate(cl_client_contexts):
all_cl_client_info.append(new_cl_client_info(client.ip_addr, client.http_port_num, client.beacon_service_name))

template_data = new_config_template_data(HTTP_PORT_NUMBER, cl_client_info)
template_data = new_config_template_data(HTTP_PORT_NUMBER, all_cl_client_info)

template_and_data = shared_utils.new_template_and_data(config_template, template_data)
template_and_data_by_rel_dest_filepath = {}
Expand Down
5 changes: 4 additions & 1 deletion static_files/light-beaconchain-config/config.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ frontend:

beaconapi:
# CL Client RPC
endpoints:
{{ range $clClient := .CLClientInfo }}
endpoint: "http://{{ $clClient.IPAddr }}:{{ $clClient.PortNum }}"
- url: "http://{{ $clClient.IPAddr }}:{{ $clClient.PortNum }}"
name: "{{ $clClient.Name }}"
archive: true
{{- end }}
# local cache for page models
localCacheSize: 100 # 100MB
Expand Down

0 comments on commit 68572cd

Please sign in to comment.