Skip to content

Commit 4e6038b

Browse files
authored
Simplify dependencies wrt chia.server (#19895)
Remove some dependencies in `chia.server`.
1 parent 4dfa474 commit 4e6038b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+154
-114
lines changed

build_scripts/pyinstaller.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ add_binary("chia", f"{ROOT}/chia/cmds/chia.py", COLLECT_ARGS)
173173
add_binary("daemon", f"{ROOT}/chia/daemon/server.py", COLLECT_ARGS)
174174

175175
for server in SERVERS:
176-
add_binary(f"start_{server}", f"{ROOT}/chia/server/start_{server}.py", COLLECT_ARGS)
176+
add_binary(f"start_{server}", f"{ROOT}/chia/{server}/start_{server}.py", COLLECT_ARGS)
177177

178178
add_binary("start_crawler", f"{ROOT}/chia/seeder/start_crawler.py", COLLECT_ARGS)
179179
add_binary("start_seeder", f"{ROOT}/chia/seeder/dns_server.py", COLLECT_ARGS)

chia/_tests/cmds/test_farm_cmd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
from chia._tests.util.time_out_assert import time_out_assert
99
from chia.cmds.farm_funcs import summary
1010
from chia.farmer.farmer import Farmer
11+
from chia.farmer.farmer_service import FarmerService
1112
from chia.harvester.harvester import Harvester
12-
from chia.server.aliases import FarmerService, HarvesterService, WalletService
13+
from chia.harvester.harvester_service import HarvesterService
1314
from chia.simulator.block_tools import BlockTools
1415
from chia.simulator.start_simulator import SimulatorFullNodeService
16+
from chia.wallet.wallet_service import WalletService
1517

1618

1719
@pytest.mark.anyio

chia/_tests/conftest.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,13 @@
5050
from chia._tests.util.spend_sim import CostLogger
5151
from chia._tests.util.time_out_assert import time_out_assert
5252
from chia.farmer.farmer_rpc_client import FarmerRpcClient
53+
from chia.farmer.farmer_service import FarmerService
5354
from chia.full_node.full_node_api import FullNodeAPI
55+
from chia.full_node.full_node_service import FullNodeService
5456
from chia.harvester.harvester_rpc_client import HarvesterRpcClient
57+
from chia.harvester.harvester_service import HarvesterService
58+
from chia.seeder.crawler_service import CrawlerService
5559
from chia.seeder.dns_server import DNSServer
56-
from chia.server.aliases import (
57-
CrawlerService,
58-
FarmerService,
59-
FullNodeService,
60-
HarvesterService,
61-
TimelordService,
62-
WalletService,
63-
)
6460
from chia.server.server import ChiaServer
6561
from chia.simulator.full_node_simulator import FullNodeSimulator
6662
from chia.simulator.setup_services import (
@@ -73,6 +69,7 @@
7369
)
7470
from chia.simulator.start_simulator import SimulatorFullNodeService
7571
from chia.simulator.wallet_tools import WalletTool
72+
from chia.timelord.timelord_service import TimelordService
7673
from chia.types.peer_info import PeerInfo
7774
from chia.util.config import create_default_chia_config, lock_and_load_config
7875
from chia.util.db_wrapper import generate_in_memory_db_uri
@@ -81,6 +78,7 @@
8178
from chia.util.task_timing import start_task_instrumentation, stop_task_instrumentation
8279
from chia.wallet.wallet_node import WalletNode
8380
from chia.wallet.wallet_rpc_client import WalletRpcClient
81+
from chia.wallet.wallet_service import WalletService
8482

8583
# TODO: review how this is now after other imports and before some stdlib imports... :[
8684
# Set spawn after stdlib imports, but before other imports

chia/_tests/core/data_layer/test_data_rpc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from chia.data_layer.data_layer_errors import KeyNotFoundError, OfferIntegrityError
4545
from chia.data_layer.data_layer_rpc_api import DataLayerRpcApi
4646
from chia.data_layer.data_layer_rpc_client import DataLayerRpcClient
47+
from chia.data_layer.data_layer_service import DataLayerService
4748
from chia.data_layer.data_layer_util import (
4849
HashOnlyProof,
4950
OfferStore,
@@ -56,8 +57,7 @@
5657
from chia.data_layer.data_layer_wallet import DataLayerWallet, verify_offer
5758
from chia.data_layer.data_store import DataStore
5859
from chia.data_layer.download_data import get_delta_filename_path, get_full_tree_filename_path
59-
from chia.server.aliases import DataLayerService, WalletService
60-
from chia.server.start_data_layer import create_data_layer_service
60+
from chia.data_layer.start_data_layer import create_data_layer_service
6161
from chia.simulator.block_tools import BlockTools
6262
from chia.simulator.full_node_simulator import FullNodeSimulator
6363
from chia.simulator.simulator_protocol import FarmNewBlockProtocol
@@ -75,6 +75,7 @@
7575
from chia.wallet.wallet_node import WalletNode
7676
from chia.wallet.wallet_request_types import DLLatestSingleton
7777
from chia.wallet.wallet_rpc_api import WalletRpcApi
78+
from chia.wallet.wallet_service import WalletService
7879

7980
pytestmark = pytest.mark.data_layer
8081
nodes = tuple[WalletNode, FullNodeSimulator]

chia/_tests/core/server/test_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
from chia._tests.util.setup_nodes import SimulatorsAndWalletsServices
1515
from chia._tests.util.time_out_assert import time_out_assert
1616
from chia.full_node.full_node_api import FullNodeAPI
17+
from chia.full_node.start_full_node import create_full_node_service
1718
from chia.protocols.full_node_protocol import RejectBlock, RequestBlock, RequestTransaction
1819
from chia.protocols.outbound_message import NodeType, make_msg
1920
from chia.protocols.protocol_message_types import ProtocolMessageTypes
2021
from chia.protocols.shared_protocol import Error, protocol_version
2122
from chia.protocols.wallet_protocol import RejectHeaderRequest
2223
from chia.server.api_protocol import ApiMetadata
2324
from chia.server.server import ChiaServer
24-
from chia.server.start_full_node import create_full_node_service
25-
from chia.server.start_wallet import create_wallet_service
2625
from chia.server.ws_connection import WSChiaConnection, error_response_version
2726
from chia.simulator.block_tools import BlockTools
2827
from chia.types.peer_info import PeerInfo
2928
from chia.util.errors import ApiError, Err
29+
from chia.wallet.start_wallet import create_wallet_service
3030

3131

3232
@dataclass

chia/_tests/core/services/test_services.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ async def test_daemon_terminates(signal_number: signal.Signals, chia_root: ChiaR
8686
@pytest.mark.parametrize(
8787
argnames=["create_service", "module_path", "service_config_name"],
8888
argvalues=[
89-
[DataLayerRpcClient.create_as_context, "chia.server.start_data_layer", "data_layer"],
90-
[FarmerRpcClient.create_as_context, "chia.server.start_farmer", "farmer"],
91-
[FullNodeRpcClient.create_as_context, "chia.server.start_full_node", "full_node"],
92-
[HarvesterRpcClient.create_as_context, "chia.server.start_harvester", "harvester"],
93-
[WalletRpcClient.create_as_context, "chia.server.start_wallet", "wallet"],
94-
[None, "chia.server.start_introducer", "introducer"],
89+
[DataLayerRpcClient.create_as_context, "chia.data_layer.start_data_layer", "data_layer"],
90+
[FarmerRpcClient.create_as_context, "chia.farmer.start_farmer", "farmer"],
91+
[FullNodeRpcClient.create_as_context, "chia.full_node.start_full_node", "full_node"],
92+
[HarvesterRpcClient.create_as_context, "chia.harvester.start_harvester", "harvester"],
93+
[WalletRpcClient.create_as_context, "chia.wallet.start_wallet", "wallet"],
94+
[None, "chia.introducer.start_introducer", "introducer"],
9595
# TODO: fails... make it not do that
9696
# [None, "chia.seeder.start_crawler", "crawler"],
97-
[None, "chia.server.start_timelord", "timelord"],
97+
[None, "chia.timelord.start_timelord", "timelord"],
9898
pytest.param(
9999
None,
100100
"chia.timelord.timelord_launcher",

chia/_tests/core/test_crawler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from chia.protocols.outbound_message import make_msg
1717
from chia.protocols.protocol_message_types import ProtocolMessageTypes
1818
from chia.protocols.wallet_protocol import RequestChildren
19+
from chia.seeder.crawler_service import CrawlerService
1920
from chia.seeder.peer_record import PeerRecord, PeerReliability
20-
from chia.server.aliases import CrawlerService
2121
from chia.types.peer_info import PeerInfo
2222

2323

chia/_tests/farmer_harvester/test_farmer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
from chia._tests.util.misc import DataCase, Marks, datacases
2222
from chia.consensus.default_constants import DEFAULT_CONSTANTS
2323
from chia.farmer.farmer import UPDATE_POOL_FARMER_INFO_INTERVAL, Farmer, increment_pool_stats, strip_old_entries
24+
from chia.farmer.farmer_service import FarmerService
25+
from chia.harvester.harvester_service import HarvesterService
2426
from chia.pools.pool_config import PoolWalletConfig
2527
from chia.protocols import farmer_protocol, harvester_protocol
2628
from chia.protocols.harvester_protocol import NewProofOfSpace, RespondSignatures
2729
from chia.protocols.pool_protocol import PoolErrorCode
28-
from chia.server.aliases import FarmerService, HarvesterService
2930
from chia.server.ws_connection import WSChiaConnection
3031
from chia.simulator.block_tools import BlockTools
3132
from chia.types.blockchain_format.proof_of_space import (

chia/_tests/farmer_harvester/test_farmer_harvester.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
from chia._tests.util.time_out_assert import time_out_assert
1616
from chia.cmds.cmds_util import get_any_service_client
1717
from chia.farmer.farmer import Farmer
18+
from chia.farmer.farmer_service import FarmerService
1819
from chia.harvester.harvester_rpc_client import HarvesterRpcClient
20+
from chia.harvester.harvester_service import HarvesterService
1921
from chia.plotting.util import PlotsRefreshParameter
2022
from chia.protocols import farmer_protocol, harvester_protocol
2123
from chia.protocols.outbound_message import NodeType, make_msg
2224
from chia.protocols.protocol_message_types import ProtocolMessageTypes
23-
from chia.server.aliases import FarmerService, HarvesterService
2425
from chia.simulator.block_tools import BlockTools
2526
from chia.types.peer_info import UnresolvedPeerInfo
2627
from chia.util.config import load_config

chia/_tests/farmer_harvester/test_filter_prefix_bits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from chia.farmer.farmer_api import FarmerAPI
1717
from chia.farmer.farmer_rpc_client import FarmerRpcClient
1818
from chia.harvester.harvester_rpc_client import HarvesterRpcClient
19+
from chia.harvester.harvester_service import HarvesterService
1920
from chia.protocols import farmer_protocol
20-
from chia.server.aliases import HarvesterService
2121
from chia.simulator.block_tools import create_block_tools_async, test_constants
2222
from chia.types.blockchain_format.proof_of_space import get_plot_id, passes_plot_filter
2323
from chia.util.keychain import Keychain

0 commit comments

Comments
 (0)