diff --git a/README.md b/README.md index 96ecf0c7e..b8c2b400d 100644 --- a/README.md +++ b/README.md @@ -637,11 +637,14 @@ additional_services: # Configuration place for blockscout explorer - https://github.com/blockscout/blockscout blockscout_params: # blockscout docker image to use - # Defaults to blockscout/blockscout:6.8.0 - image: "blockscout/blockscout:6.8.0" + # Defaults to blockscout/blockscout:latest + image: "blockscout/blockscout:latest" # blockscout smart contract verifier image to use - # Defaults to ghcr.io/blockscout/smart-contract-verifier:v1.9.0 - verif_image: "ghcr.io/blockscout/smart-contract-verifier:v1.9.0" + # Defaults to ghcr.io/blockscout/smart-contract-verifier:latest + verif_image: "ghcr.io/blockscout/smart-contract-verifier:latest" + # Frontend image + # Defaults to ghcr.io/blockscout/frontend:latest + frontend_image: "ghcr.io/blockscout/frontend:latest" # Configuration place for dora the explorer - https://github.com/ethpandaops/dora dora_params: diff --git a/main.star b/main.star index 4cc031012..416de521f 100644 --- a/main.star +++ b/main.star @@ -508,7 +508,6 @@ def run(plan, args={}): plan.print("Successfully launched beacon metrics gazer") elif additional_service == "blockscout": plan.print("Launching blockscout") - blockscout_params = args_with_right_defaults.blockscout_params blockscout_sc_verif_url = blockscout.launch_blockscout( plan, all_el_contexts, @@ -517,7 +516,8 @@ def run(plan, args={}): args_with_right_defaults.port_publisher, index, args_with_right_defaults.docker_cache_params, - blockscout_params, + args_with_right_defaults.blockscout_params, + network_params, ) plan.print("Successfully launched blockscout") elif additional_service == "dora": diff --git a/src/blockscout/blockscout_launcher.star b/src/blockscout/blockscout_launcher.star index a417d488c..bdd030091 100644 --- a/src/blockscout/blockscout_launcher.star +++ b/src/blockscout/blockscout_launcher.star @@ -5,10 +5,10 @@ postgres = import_module("github.com/kurtosis-tech/postgres-package/main.star") POSTGRES_IMAGE = "library/postgres:alpine" SERVICE_NAME_BLOCKSCOUT = "blockscout" - +SERVICE_NAME_FRONTEND = "blockscout-frontend" HTTP_PORT_NUMBER = 4000 HTTP_PORT_NUMBER_VERIF = 8050 - +HTTP_PORT_NUMBER_FRONTEND = 3000 BLOCKSCOUT_MIN_CPU = 100 BLOCKSCOUT_MAX_CPU = 1000 BLOCKSCOUT_MIN_MEMORY = 1024 @@ -35,6 +35,14 @@ VERIF_USED_PORTS = { ) } +FRONTEND_USED_PORTS = { + constants.HTTP_PORT_ID: shared_utils.new_port_spec( + HTTP_PORT_NUMBER_FRONTEND, + shared_utils.TCP_PROTOCOL, + shared_utils.HTTP_APPLICATION_PROTOCOL, + ) +} + def launch_blockscout( plan, @@ -45,6 +53,7 @@ def launch_blockscout( additional_service_index, docker_cache_params, blockscout_params, + network_params, ): postgres_output = postgres.run( plan, @@ -93,6 +102,16 @@ def launch_blockscout( blockscout_service.hostname, blockscout_service.ports["http"].number ) + config_frontend = get_config_frontend( + plan, + el_client_rpc_url, + docker_cache_params, + blockscout_params, + network_params, + global_node_selectors, + blockscout_service, + ) + plan.add_service(SERVICE_NAME_FRONTEND, config_frontend) return blockscout_url @@ -110,11 +129,10 @@ def get_config_verif( 0, ) - IMAGE_NAME_BLOCKSCOUT_VERIF = blockscout_params.verif_image return ServiceConfig( image=shared_utils.docker_cache_image_calc( docker_cache_params, - IMAGE_NAME_BLOCKSCOUT_VERIF, + blockscout_params.verif_image, ), ports=VERIF_USED_PORTS, public_ports=public_ports, @@ -158,12 +176,10 @@ def get_config_backend( 1, ) - IMAGE_NAME_BLOCKSCOUT = blockscout_params.image - return ServiceConfig( image=shared_utils.docker_cache_image_calc( docker_cache_params, - IMAGE_NAME_BLOCKSCOUT, + blockscout_params.image, ), ports=USED_PORTS, public_ports=public_ports, @@ -197,3 +213,44 @@ def get_config_backend( max_memory=BLOCKSCOUT_MAX_MEMORY, node_selectors=node_selectors, ) + + +def get_config_frontend( + plan, + el_client_rpc_url, + docker_cache_params, + blockscout_params, + network_params, + node_selectors, + blockscout_service, +): + return ServiceConfig( + image=shared_utils.docker_cache_image_calc( + docker_cache_params, + blockscout_params.frontend_image, + ), + ports=FRONTEND_USED_PORTS, + env_vars={ + "NEXT_PUBLIC_API_PROTOCOL": "http", + "NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL": "ws", + "NEXT_PUBLIC_NETWORK_NAME": "Kurtosis", + "NEXT_PUBLIC_NETWORK_ID": network_params.network_id, + "NEXT_PUBLIC_NETWORK_RPC_URL": el_client_rpc_url, + "NEXT_PUBLIC_APP_HOST": "0.0.0.0", + "NEXT_PUBLIC_API_HOST": blockscout_service.ip_address + + ":" + + str(blockscout_service.ports["http"].number), + "NEXT_PUBLIC_AD_BANNER_PROVIDER": "none", + "NEXT_PUBLIC_AD_TEXT_PROVIDER": "none", + "NEXT_PUBLIC_IS_TESTNET": "true", + "NEXT_PUBLIC_GAS_TRACKER_ENABLED": "true", + "NEXT_PUBLIC_HAS_BEACON_CHAIN": "true", + "NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE": "validation", + "NEXT_PUBLIC_NETWORK_ICON": "https://ethpandaops.io/logo.png", + }, + min_cpu=BLOCKSCOUT_MIN_CPU, + max_cpu=BLOCKSCOUT_MAX_CPU, + min_memory=BLOCKSCOUT_MIN_MEMORY, + max_memory=BLOCKSCOUT_MAX_MEMORY, + node_selectors=node_selectors, + ) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index d130003e3..388b9f13c 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -364,6 +364,7 @@ def input_parser(plan, input_args): blockscout_params=struct( image=result["blockscout_params"]["image"], verif_image=result["blockscout_params"]["verif_image"], + frontend_image=result["blockscout_params"]["frontend_image"], ), dora_params=struct( image=result["dora_params"]["image"], @@ -1011,8 +1012,9 @@ def default_participant(): def get_default_blockscout_params(): return { - "image": "blockscout/blockscout:6.8.0", - "verif_image": "ghcr.io/blockscout/smart-contract-verifier:v1.9.0", + "image": "blockscout/blockscout:latest", + "verif_image": "ghcr.io/blockscout/smart-contract-verifier:latest", + "frontend_image": "ghcr.io/blockscout/frontend:latest", } diff --git a/src/package_io/sanity_check.star b/src/package_io/sanity_check.star index 88db6133f..dfbfd9447 100644 --- a/src/package_io/sanity_check.star +++ b/src/package_io/sanity_check.star @@ -174,6 +174,7 @@ SUBCATEGORY_PARAMS = { "blockscout_params": [ "image", "verif_image", + "frontend_image", ], "dora_params": [ "image",