-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path__init__.py
More file actions
58 lines (50 loc) · 1.47 KB
/
__init__.py
File metadata and controls
58 lines (50 loc) · 1.47 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
from enum import Enum
from expb.clients.besu import BesuConfig
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_DIR,
CLIENTS_JWT_SECRET_FILE,
ClientConfig,
)
from expb.clients.erigon import ErigonConfig
from expb.clients.ethrex import EthrexConfig
from expb.clients.geth import GethConfig
from expb.clients.nethermind import NethermindConfig
from expb.clients.nimbusel import NimbusELConfig
from expb.clients.reth import RethConfig
class Client(Enum):
NETHERMIND = NethermindConfig()
BESU = BesuConfig()
RETH = RethConfig()
GETH = GethConfig()
ERIGON = ErigonConfig()
ETHREX = EthrexConfig()
NIMBUSEL = NimbusELConfig()
@classmethod
def from_name(cls, name: str) -> "Client":
name_lower = name.lower()
for client in cls:
client_name_lower = client.value.name.lower()
if client_name_lower == name_lower:
return client
raise ValueError(f"Invalid client name: {name}.")
@classmethod
def all_client_names(cls) -> list[str]:
return [client.value.name for client in cls]
__all__ = [
"Client",
"ClientConfig",
"CLIENTS_DATA_DIR",
"CLIENTS_JWT_SECRET_DIR",
"CLIENTS_JWT_SECRET_FILE",
"CLIENT_RPC_PORT",
"CLIENT_RPC_WS_PORT",
"CLIENT_ENGINE_PORT",
"CLIENT_METRICS_PORT",
"CLIENT_P2P_PORT",
]