@@ -58,7 +58,7 @@ class SideDagProcessTerminated:
58
58
pass
59
59
60
60
61
- class SideDag (RunNode ):
61
+ class SideDagRunNode (RunNode ):
62
62
env_vars_prefix = 'hathor_side_dag_'
63
63
64
64
@@ -88,18 +88,23 @@ def main(capture_stdout: bool) -> None:
88
88
In this example, Hathor testnet logs would be disabled, while side-dag logs would be outputted to stdout as json.
89
89
"""
90
90
from hathor .cli .util import process_logging_options , setup_logging
91
- hathor_node_argv , side_dag_argv = _process_argv (sys .argv [1 :])
91
+ hathor_node_argv , side_dag_argv = _partition_argv (sys .argv [1 :])
92
92
conn1 , conn2 = Pipe ()
93
93
hathor_node_process = _start_hathor_node_process (hathor_node_argv , capture_stdout = capture_stdout , conn = conn1 )
94
94
95
- debug , logging_output , sentry = process_logging_options (side_dag_argv )
96
- setup_logging (debug = debug , capture_stdout = capture_stdout , logging_output = logging_output , sentry = sentry )
95
+ log_options = process_logging_options (side_dag_argv )
96
+ setup_logging (
97
+ debug = log_options .debug ,
98
+ capture_stdout = capture_stdout ,
99
+ logging_output = log_options .logging_output ,
100
+ sentry = log_options .sentry ,
101
+ )
97
102
logger .info ('starting nodes' , hathor_node_pid = hathor_node_process .pid , side_dag_pid = os .getpid ())
98
103
99
104
_run_side_dag_node (side_dag_argv , hathor_node_process = hathor_node_process , conn = conn2 )
100
105
101
106
102
- def _process_argv (argv : list [str ]) -> tuple [list [str ], list [str ]]:
107
+ def _partition_argv (argv : list [str ]) -> tuple [list [str ], list [str ]]:
103
108
"""Partition arguments into hathor node args and side-dag args, based on the `--side-dag` prefix."""
104
109
hathor_node_argv : list [str ] = []
105
110
side_dag_argv : list [str ] = []
@@ -148,7 +153,7 @@ def _run_side_dag_node(argv: list[str], *, hathor_node_process: Process, conn: '
148
153
logger .info ('starting side-dag node...' )
149
154
150
155
try :
151
- side_dag = SideDag (argv = argv )
156
+ side_dag = SideDagRunNode (argv = argv )
152
157
except (BaseException , Exception ):
153
158
logger .critical ('terminating hathor node...' )
154
159
conn .send (SideDagProcessTerminated ())
@@ -185,8 +190,13 @@ def _run_hathor_node(argv: list[str], run_node_cmd: type[RunNode], capture_stdou
185
190
# We don't terminate via SIGINT directly, instead the side-dag process will terminate us.
186
191
signal .signal (signal .SIGINT , lambda _ , __ : None )
187
192
try :
188
- debug , logging_output , sentry = process_logging_options (argv )
189
- setup_logging (debug = debug , capture_stdout = capture_stdout , logging_output = logging_output , sentry = sentry )
193
+ log_options = process_logging_options (argv )
194
+ setup_logging (
195
+ debug = log_options .debug ,
196
+ capture_stdout = capture_stdout ,
197
+ logging_output = log_options .logging_output ,
198
+ sentry = log_options .sentry ,
199
+ )
190
200
hathor_node = run_node_cmd (argv = argv )
191
201
except (BaseException , Exception ):
192
202
conn .send (HathorProcessInitFail (traceback .format_exc ()))
0 commit comments