forked from 0xPolygon/kurtosis-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcdk_node.star
51 lines (46 loc) · 1.47 KB
/
cdk_node.star
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
data_availability_package = import_module("./data_availability.star")
NODE_COMPONENTS = struct(
sequence_sender="sequence-sender",
aggregator="aggregator",
)
def create_cdk_node_service_config(
args,
config_artifact,
genesis_artifact,
keystore_artifact,
):
cdk_node_name = "cdk-node" + args["deployment_suffix"]
cdk_node_service_config = ServiceConfig(
image=args["cdk_node_image"],
ports={
"aggregator": PortSpec(
args["zkevm_aggregator_port"], application_protocol="grpc"
),
},
files={
"/etc/cdk": Directory(
artifact_names=[
config_artifact,
genesis_artifact,
keystore_artifact.aggregator,
keystore_artifact.sequencer,
],
),
"/data": Directory(
artifact_names=[],
),
},
entrypoint=["sh", "-c"],
# Sleep for 20 seconds in order to wait for datastream server getting ready
# TODO: find a better way instead of waiting
cmd=[
"sleep 20 && cdk-node run "
+ "-cfg=/etc/cdk/cdk-node-config.toml "
+ "-custom-network-file=/etc/cdk/genesis.json "
+ "-components="
+ NODE_COMPONENTS.sequence_sender
+ ","
+ NODE_COMPONENTS.aggregator,
],
)
return {cdk_node_name: cdk_node_service_config}