-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathgeth.py
More file actions
59 lines (56 loc) · 1.81 KB
/
geth.py
File metadata and controls
59 lines (56 loc) · 1.81 KB
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
from expb.clients.client_config import (
CLIENT_ENGINE_PORT,
CLIENT_METRICS_PORT,
CLIENT_P2P_PORT,
CLIENT_RPC_PORT,
CLIENT_RPC_WS_PORT,
CLIENTS_DATA_DIR,
CLIENTS_JWT_SECRET_FILE,
ClientConfig,
)
from expb.configs.networks import Network
class GethConfig(ClientConfig):
def __init__(self):
super().__init__(
name="geth",
default_image="ethereum/client-go:latest",
default_command=[
f"--datadir={CLIENTS_DATA_DIR}",
f"--port={CLIENT_P2P_PORT}",
"--http",
"--http.addr=0.0.0.0",
f"--http.port={CLIENT_RPC_PORT}",
"--http.vhosts=*",
"--http.api=eth,net,web3,debug,admin",
"--authrpc.addr=0.0.0.0",
f"--authrpc.port={CLIENT_ENGINE_PORT}",
"--authrpc.vhosts=*",
f"--authrpc.jwtsecret={CLIENTS_JWT_SECRET_FILE}",
"--metrics",
f"--metrics.port={CLIENT_METRICS_PORT}",
"--metrics.addr=0.0.0.0",
"--ws",
"--ws.addr=0.0.0.0",
f"--ws.port={CLIENT_RPC_WS_PORT}",
"--ws.api=eth,web3,net,debug,admin",
# Disable peering
"--nodiscover",
"--maxpeers=0",
],
prometheus_metrics_path="/debug/metrics/prometheus",
)
def get_command(
self,
instance: str,
network: Network,
extra_flags: list[str] = [],
) -> list[str]:
command = []
if network == Network.MAINNET:
command.extend(
[
"--mainnet",
"--syncmode=full",
]
)
return self.default_command + command + extra_flags