Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions nodes/anchor/node.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
constants = import_module("../../utils/constants.star")
utils = import_module("../../utils/utils.star")

ANCHOR_METRICS_PORT_NAME = "metrics"
ANCHOR_METRICS_PORT = 5164

# Start anchor nodes: first node starts alone (to get ENR), remaining start in parallel
def start(plan, num_nodes, cl_url, el_rpc, el_ws, key_pems, config, image):
IP_PLACEHOLDER = "KURTOSIS_IP_ADDR_PLACEHOLDER"
Expand All @@ -15,8 +18,19 @@ def start(plan, num_nodes, cl_url, el_rpc, el_ws, key_pems, config, image):
"--logfile-max-number", "0", "--debug-level", "debug",
# mitigation of https://github.com/sigp/anchor/issues/765
"--subscribe-all-subnets",
# Prometheus metrics; anchor defaults the listen address to 127.0.0.1, which is unreachable
# from outside the container, so bind 0.0.0.0 for the published port to work.
"--metrics", "--metrics-address", "0.0.0.0", "--metrics-port", str(ANCHOR_METRICS_PORT),
]

metrics_ports = {
ANCHOR_METRICS_PORT_NAME: PortSpec(
number=ANCHOR_METRICS_PORT,
transport_protocol="TCP",
application_protocol="http",
),
}

plan.add_service(
name="anchor-node-0",
description="Starting Anchor bootnode (node 0)",
Expand All @@ -25,6 +39,7 @@ def start(plan, num_nodes, cl_url, el_rpc, el_ws, key_pems, config, image):
entrypoint=["anchor"],
cmd=command_arr,
files=files,
ports=metrics_ports,
private_ip_address_placeholder=IP_PLACEHOLDER,
ready_conditions=ReadyCondition(
recipe=ExecRecipe(
Expand Down Expand Up @@ -54,6 +69,7 @@ def start(plan, num_nodes, cl_url, el_rpc, el_ws, key_pems, config, image):
entrypoint=["anchor"],
cmd=command_arr_with_boot,
files=files,
ports=metrics_ports,
private_ip_address_placeholder=IP_PLACEHOLDER,
)
plan.add_services(remaining_configs, description="Starting {} remaining Anchor nodes in parallel".format(num_nodes - 1))
Expand Down