diff --git a/build_scripts/pyinstaller.spec b/build_scripts/pyinstaller.spec index ae18dbb48357..ef84234d2b39 100644 --- a/build_scripts/pyinstaller.spec +++ b/build_scripts/pyinstaller.spec @@ -33,6 +33,7 @@ SERVERS = [ "farmer", "introducer", "timelord", + "solver" ] if THIS_IS_WINDOWS: diff --git a/chia/solver/start_solver.py b/chia/solver/start_solver.py index 4f34225fd586..19e1dd505bea 100644 --- a/chia/solver/start_solver.py +++ b/chia/solver/start_solver.py @@ -19,6 +19,7 @@ from chia.solver.solver_api import SolverAPI from chia.solver.solver_rpc_api import SolverRpcApi from chia.solver.solver_service import SolverService +from chia.ssl.create_ssl import create_all_ssl from chia.util.chia_logging import initialize_service_logging from chia.util.config import load_config, load_config_cli from chia.util.default_root import resolve_root_path @@ -70,8 +71,9 @@ def create_solver_service( ) -async def async_main(service_config: dict[str, Any], root_path: pathlib.Path) -> int: +async def async_main(root_path: pathlib.Path) -> int: config = load_config(root_path, "config.yaml", fill_missing_services=True) + service_config = load_config_cli(root_path, "config.yaml", SERVICE_NAME, fill_missing_services=True) config[SERVICE_NAME] = service_config network_id = service_config["selected_network"] overrides = service_config["network_overrides"]["constants"][network_id] @@ -79,6 +81,14 @@ async def async_main(service_config: dict[str, Any], root_path: pathlib.Path) -> updated_constants = replace_str_to_bytes(DEFAULT_CONSTANTS, **overrides) initialize_service_logging(service_name=SERVICE_NAME, config=config, root_path=root_path) + # Ensure SSL certificates are created if they aren't already there + create_all_ssl( + root_path=root_path, + private_node_names=[SERVICE_NAME], + public_node_names=[SERVICE_NAME], + overwrite=False, + ) + service = create_solver_service(root_path, config, updated_constants) async with SignalHandlers.manage() as signal_handlers: await service.setup_process_global_state(signal_handlers=signal_handlers) @@ -94,8 +104,7 @@ def main() -> int: with maybe_manage_task_instrumentation( enable=os.environ.get(f"CHIA_INSTRUMENT_{SERVICE_NAME.upper()}") is not None ): - service_config = load_config_cli(root_path, "config.yaml", SERVICE_NAME) - return async_run(coro=async_main(service_config, root_path=root_path)) + return async_run(coro=async_main(root_path=root_path)) if __name__ == "__main__":