def run_daemon_cmd(ctx: click.Context, wait_for_unlock: bool) -> None: import asyncio from chia.daemon.server import async_run_daemon from chia.util.keychain import Keychain wait_for_unlock = wait_for_unlock and Keychain.is_keyring_locked() asyncio.get_event_loop().run_until_complete(async_run_daemon(ctx.obj["root_path"], wait_for_unlock=wait_for_unlock))
async def keyring_status(self) -> Dict[str, Any]: passphrase_support_enabled: bool = supports_keyring_passphrase() user_passphrase_is_set: bool = not using_default_passphrase() locked: bool = Keychain.is_keyring_locked() needs_migration: bool = Keychain.needs_migration() response: Dict[str, Any] = { "success": True, "is_keyring_locked": locked, "passphrase_support_enabled": passphrase_support_enabled, "user_passphrase_is_set": user_passphrase_is_set, "needs_migration": needs_migration, } return response
async def is_keyring_locked(self) -> Dict[str, Any]: locked: bool = Keychain.is_keyring_locked() response: Dict[str, Any] = {"success": True, "is_keyring_locked": locked} return response
def main(argv) -> int: from chia.util.default_root import DEFAULT_ROOT_PATH from chia.util.keychain import Keychain wait_for_unlock = "--wait-for-unlock" in argv and Keychain.is_keyring_locked() return run_daemon(DEFAULT_ROOT_PATH, wait_for_unlock)