-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbesu.py
More file actions
56 lines (53 loc) · 1.8 KB
/
besu.py
File metadata and controls
56 lines (53 loc) · 1.8 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
from expb.clients.client_config import (
CLIENT_ENGINE_PORT,
CLIENT_METRICS_PORT,
CLIENT_P2P_PORT,
CLIENT_RPC_PORT,
CLIENTS_DATA_DIR,
CLIENTS_JWT_SECRET_FILE,
ClientConfig,
)
from expb.configs.networks import Network
class BesuConfig(ClientConfig):
def __init__(self):
super().__init__(
name="besu",
default_image="hyperledger/besu:develop",
default_command=[
f"--data-path={CLIENTS_DATA_DIR}",
"--p2p-host=0.0.0.0",
f"--p2p-port={CLIENT_P2P_PORT}",
"--rpc-http-enabled",
"--rpc-http-host=0.0.0.0",
f"--rpc-http-port={CLIENT_RPC_PORT}",
"--rpc-http-cors-origins='*'",
"--host-allowlist='*'",
f"--engine-jwt-secret={CLIENTS_JWT_SECRET_FILE}",
f"--engine-rpc-port={CLIENT_ENGINE_PORT}",
"--engine-host-allowlist='*'",
"--metrics-enabled",
"--metrics-host=0.0.0.0",
f"--metrics-port={CLIENT_METRICS_PORT}",
"--rpc-http-api=ADMIN,DEBUG,ETH,MINER,NET,TRACE,TXPOOL,WEB3",
"--sync-mode=FULL",
"--version-compatibility-protection=false",
# Disable peering
"--max-peers=0",
"--discovery-enabled=false",
],
prometheus_metrics_path="/metrics",
)
def get_command(
self,
instance: str,
network: Network,
extra_flags: list[str] = [],
) -> list[str]:
command = []
if network == Network.MAINNET:
command.extend(
[
"--network=mainnet",
]
)
return self.default_command + command + extra_flags