mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-05 10:05:00 -05:00
* Add crawler RPC server * Generate private keypair for crawler * Bring over cleanup changes from the last closed PR * Update the crawler RPC information to be its own subsection within seeder * Add sleep before crawling to let the daemon connection get set up * Wait for the actual callback to not be None, instead of just a random sleep interval * Rework crawler/dns seeder to use the daemon + normal chia start process rather than the old system intended for the standalone repo * Update configure testnet to work with seeder config * Add back the crawler/seeder options from the standalone version * Remove the check for none/sleep. Not needed when this is started by the daemon * Add real data to the get_peer_counts endpoint * Lint * Fix calls to configure from init * Turns out we still might sometimes move too quick before daemon/state changed callback is ready * Add peer counts in the state_changed callback method * Add a setting for peer_connect_timeout in the seeder: section so we can control it just for crawler * start_seeder * Pass config/root_path to the DNSServer so it can also use the configured crawler DB Path * change in () instead of if/or * Remove unnecessary return
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
from typing import KeysView, Generator
|
|
|
|
SERVICES_FOR_GROUP = {
|
|
"all": "chia_harvester chia_timelord_launcher chia_timelord chia_farmer chia_full_node chia_wallet".split(),
|
|
"node": "chia_full_node".split(),
|
|
"harvester": "chia_harvester".split(),
|
|
"farmer": "chia_harvester chia_farmer chia_full_node chia_wallet".split(),
|
|
"farmer-no-wallet": "chia_harvester chia_farmer chia_full_node".split(),
|
|
"farmer-only": "chia_farmer".split(),
|
|
"timelord": "chia_timelord_launcher chia_timelord chia_full_node".split(),
|
|
"timelord-only": "chia_timelord".split(),
|
|
"timelord-launcher-only": "chia_timelord_launcher".split(),
|
|
"wallet": "chia_wallet".split(),
|
|
"introducer": "chia_introducer".split(),
|
|
"simulator": "chia_full_node_simulator".split(),
|
|
"crawler": "chia_crawler".split(),
|
|
"seeder": "chia_crawler chia_seeder".split(),
|
|
"seeder-only": "chia_seeder".split(),
|
|
}
|
|
|
|
|
|
def all_groups() -> KeysView[str]:
|
|
return SERVICES_FOR_GROUP.keys()
|
|
|
|
|
|
def services_for_groups(groups) -> Generator[str, None, None]:
|
|
for group in groups:
|
|
for service in SERVICES_FOR_GROUP[group]:
|
|
yield service
|
|
|
|
|
|
def validate_service(service: str) -> bool:
|
|
return any(service in _ for _ in SERVICES_FOR_GROUP.values())
|