11shared_utils = import_module ("../shared_utils/shared_utils.star" )
22postgres = import_module ("github.com/kurtosis-tech/postgres-package/main.star" )
33redis = import_module ("github.com/kurtosis-tech/redis-package/main.star" )
4-
4+ constants = import_module ( "../package_io/constants.star" )
55IMAGE_NAME = "gobitfly/eth2-beaconchain-explorer:latest"
66
77POSTGRES_PORT_ID = "postgres"
@@ -19,8 +19,7 @@ FRONTEND_PORT_NUMBER = 8080
1919LITTLE_BIGTABLE_PORT_ID = "littlebigtable"
2020LITTLE_BIGTABLE_PORT_NUMBER = 9000
2121
22- FULL_BEACONCHAIN_CONFIG_FILENAME = "config.yml"
23-
22+ FULL_BEACONCHAIN_CONFIG_FILENAME = "beaconchain-config.yml"
2423
2524USED_PORTS = {
2625 FRONTEND_PORT_ID : shared_utils .new_port_spec (
@@ -94,6 +93,7 @@ FRONTEND_MAX_MEMORY = 2048
9493def launch_full_beacon (
9594 plan ,
9695 config_template ,
96+ el_cl_data_files_artifact_uuid ,
9797 cl_contexts ,
9898 el_contexts ,
9999 persistent ,
@@ -147,16 +147,14 @@ def launch_full_beacon(
147147 )
148148 redis_url = "{}:{}" .format (redis_output .hostname , redis_output .port_number )
149149
150- cl_url = cl_contexts [0 ].beacon_http_url [7 :] # Remove the "http://"
151- cl_port = cl_contexts [0 ].beacon_http_url .split (":" )[2 ] # Get the port number
152-
153150 template_data = new_config_template_data (
154- cl_url ,
155- cl_port ,
151+ cl_contexts [0 ].ip_addr ,
152+ cl_contexts [0 ].http_port ,
153+ cl_contexts [0 ].client_name ,
156154 el_uri ,
157155 little_bigtable .ip_address ,
158156 LITTLE_BIGTABLE_PORT_NUMBER ,
159- postgres_output .url ,
157+ postgres_output .service . name ,
160158 POSTGRES_PORT_NUMBER ,
161159 redis_url ,
162160 FRONTEND_PORT_NUMBER ,
@@ -171,17 +169,20 @@ def launch_full_beacon(
171169 ] = template_and_data
172170
173171 config_files_artifact_name = plan .render_templates (
174- template_and_data_by_rel_dest_filepath , "config.yml"
172+ template_and_data_by_rel_dest_filepath , "beaconchain- config.yml"
175173 )
176174
175+ files = {
176+ "/app/config/" : config_files_artifact_name ,
177+ constants .GENESIS_DATA_MOUNTPOINT_ON_CLIENTS : el_cl_data_files_artifact_uuid ,
178+ }
179+
177180 # Initialize the db schema
178181 initdbschema = plan .add_service (
179182 name = "beaconchain-schema-initializer" ,
180183 config = ServiceConfig (
181184 image = IMAGE_NAME ,
182- files = {
183- "/app/config/" : config_files_artifact_name ,
184- },
185+ files = files ,
185186 entrypoint = ["tail" , "-f" , "/dev/null" ],
186187 min_cpu = INIT_MIN_CPU ,
187188 max_cpu = INIT_MAX_CPU ,
@@ -195,7 +196,13 @@ def launch_full_beacon(
195196 plan .exec (
196197 service_name = initdbschema .name ,
197198 recipe = ExecRecipe (
198- ["./misc" , "-config" , "/app/config/config.yml" , "-command" , "applyDbSchema" ]
199+ [
200+ "./misc" ,
201+ "-config" ,
202+ "/app/config/beaconchain-config.yml" ,
203+ "-command" ,
204+ "applyDbSchema" ,
205+ ]
199206 ),
200207 )
201208
@@ -207,7 +214,7 @@ def launch_full_beacon(
207214 [
208215 "./misc" ,
209216 "-config" ,
210- "/app/config/config.yml" ,
217+ "/app/config/beaconchain- config.yml" ,
211218 "-command" ,
212219 "initBigtableSchema" ,
213220 ]
@@ -219,13 +226,11 @@ def launch_full_beacon(
219226 name = "beaconchain-indexer" ,
220227 config = ServiceConfig (
221228 image = IMAGE_NAME ,
222- files = {
223- "/app/config/" : config_files_artifact_name ,
224- },
229+ files = files ,
225230 entrypoint = ["./explorer" ],
226231 cmd = [
227232 "-config" ,
228- "/app/config/config.yml" ,
233+ "/app/config/beaconchain- config.yml" ,
229234 ],
230235 env_vars = {
231236 "INDEXER_ENABLED" : "TRUE" ,
@@ -242,13 +247,11 @@ def launch_full_beacon(
242247 name = "beaconchain-eth1indexer" ,
243248 config = ServiceConfig (
244249 image = IMAGE_NAME ,
245- files = {
246- "/app/config/" : config_files_artifact_name ,
247- },
250+ files = files ,
248251 entrypoint = ["./eth1indexer" ],
249252 cmd = [
250253 "-config" ,
251- "/app/config/config.yml" ,
254+ "/app/config/beaconchain- config.yml" ,
252255 "-blocks.concurrency" ,
253256 "1" ,
254257 "-blocks.tracemode" ,
@@ -269,13 +272,11 @@ def launch_full_beacon(
269272 name = "beaconchain-rewardsexporter" ,
270273 config = ServiceConfig (
271274 image = IMAGE_NAME ,
272- files = {
273- "/app/config/" : config_files_artifact_name ,
274- },
275+ files = files ,
275276 entrypoint = ["./rewards-exporter" ],
276277 cmd = [
277278 "-config" ,
278- "/app/config/config.yml" ,
279+ "/app/config/beaconchain- config.yml" ,
279280 ],
280281 min_cpu = REWARDSEXPORTER_MIN_CPU ,
281282 max_cpu = REWARDSEXPORTER_MAX_CPU ,
@@ -289,13 +290,11 @@ def launch_full_beacon(
289290 name = "beaconchain-statistics" ,
290291 config = ServiceConfig (
291292 image = IMAGE_NAME ,
292- files = {
293- "/app/config/" : config_files_artifact_name ,
294- },
293+ files = files ,
295294 entrypoint = ["./statistics" ],
296295 cmd = [
297296 "-config" ,
298- "/app/config/config.yml" ,
297+ "/app/config/beaconchain- config.yml" ,
299298 "-charts.enabled" ,
300299 "-graffiti.enabled" ,
301300 "-validators.enabled" ,
@@ -312,13 +311,11 @@ def launch_full_beacon(
312311 name = "beaconchain-fdu" ,
313312 config = ServiceConfig (
314313 image = IMAGE_NAME ,
315- files = {
316- "/app/config/" : config_files_artifact_name ,
317- },
314+ files = files ,
318315 entrypoint = ["./frontend-data-updater" ],
319316 cmd = [
320317 "-config" ,
321- "/app/config/config.yml" ,
318+ "/app/config/beaconchain- config.yml" ,
322319 ],
323320 min_cpu = FDU_MIN_CPU ,
324321 max_cpu = FDU_MAX_CPU ,
@@ -332,13 +329,11 @@ def launch_full_beacon(
332329 name = "beaconchain-frontend" ,
333330 config = ServiceConfig (
334331 image = IMAGE_NAME ,
335- files = {
336- "/app/config/" : config_files_artifact_name ,
337- },
332+ files = files ,
338333 entrypoint = ["./explorer" ],
339334 cmd = [
340335 "-config" ,
341- "/app/config/config.yml" ,
336+ "/app/config/beaconchain- config.yml" ,
342337 ],
343338 env_vars = {
344339 "FRONTEND_ENABLED" : "TRUE" ,
@@ -360,6 +355,7 @@ def launch_full_beacon(
360355def new_config_template_data (
361356 cl_url ,
362357 cl_port ,
358+ cl_type ,
363359 el_uri ,
364360 lbt_host ,
365361 lbt_port ,
@@ -371,9 +367,13 @@ def new_config_template_data(
371367 return {
372368 "CLNodeHost" : cl_url ,
373369 "CLNodePort" : cl_port ,
370+ "CLNodeType" : cl_type ,
374371 "ELNodeEndpoint" : el_uri ,
375372 "LBTHost" : lbt_host ,
376373 "LBTPort" : lbt_port ,
374+ "DBName" : POSTGRES_DB ,
375+ "DBUser" : POSTGRES_USER ,
376+ "DBPass" : POSTGRES_PASSWORD ,
377377 "DBHost" : db_host ,
378378 "DBPort" : db_port ,
379379 "RedisEndpoint" : redis_url ,
0 commit comments