-
Notifications
You must be signed in to change notification settings - Fork 0
/
teku.star
110 lines (96 loc) · 2.69 KB
/
teku.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
version = "0.0.1"
name = "teku"
chains = ["mainnet", "goerli", "sepolia"]
config = {
"execution_node": {
"type": "string",
"required": True,
"description": "Endpoint of the execution node",
},
"use_checkpoint": {
"type": "bool",
"description": "Whether to use checkpoint initial sync",
},
"archive": {
"type": "bool",
"description": "Enables archival node mode",
"default": False,
},
}
babel = {
"image": "ghcr.io/umbracle/babel",
"tag": "v0.0.1",
"args": [
"--plugin",
"ethereum_cl",
"server",
"url=http://0.0.0.0:5052",
],
}
verbosity_levels = {
"all": "ALL",
"debug": "DEBUG",
"info": "INFO",
"warn": "WARN",
"error": "ERROR",
"silent": "OFF",
}
def generate(obj):
t = {
"image": "consensys/teku",
"tag": "23.3.0",
"args": [
"--data-base-path",
"/data",
"--ee-endpoint",
"http://" + obj["execution_node"] + ":8551",
"--ee-jwt-secret-file",
"/var/lib/jwtsecret/jwt.hex",
"--metrics-host-allowlist",
"*",
"--metrics-port",
"8008",
"--metrics-interface",
"0.0.0.0",
"--rest-api-enabled",
"--rest-api-host-allowlist",
"*",
"--rest-api-interface",
"0.0.0.0",
"--rest-api-port",
"5052",
"--log-destination",
"CONSOLE",
"--logging",
verbosity_levels[obj["log_level"]],
],
"data": {
"/var/lib/jwtsecret/jwt.hex": "04592280e1778419b7aa954d43871cb2cfb2ebda754fb735e8adeb293a88f9bf"
},
"volumes": {"data": {"path": "/data"}},
}
if obj["use_checkpoint"]:
t["args"].extend(
[
"--initial-state",
getBeaconCheckpoint(obj["chain"])
+ "/eth/v2/debug/beacon/states/finalized",
]
)
if obj["archive"]:
t["args"].extend(["--data-storage-mode", "prune"])
else:
t["args"].extend(["--data-storage-mode", "archive"])
if obj["chain"] != "mainnet":
t["args"].extend(["--network", obj["chain"]])
if obj["metrics"]:
t["args"].extend(["--metrics-enabled"])
t["telemetry"] = {"port": 8008, "path": "metrics"}
return {"node": t, "babel": babel}
def getBeaconCheckpoint(chain):
if chain == "mainnet":
return "https://beaconstate.info"
elif chain == "goerli":
return "https://goerli.beaconstate.info"
elif chain == "sepolia":
return "https://sepolia.beaconstate.info"