Files
chia-blockchain/chia/cmds/start.py
Kyle AltendorfandGitHub 9a0b5728c5 use a class for the chia cli context data (#18919)
* use a class for the chia cli context data

* actually assign to the context properly...

* handle the not-present case

* catch up

* tidy

* more

* stuff

* ...

* more real

* expected address prefix
2024-12-19 10:44:48 -07:00

25 lines
1001 B
Python

from __future__ import annotations
import click
from chia.cmds.cmd_classes import ChiaCliContext
from chia.util.config import load_config
from chia.util.service_groups import all_groups
@click.command("start", help="Start service groups")
@click.option("-r", "--restart", is_flag=True, type=bool, help="Restart running services")
@click.option("-s", "--skip-keyring", is_flag=True, type=bool, help="Skip to unlock keyring")
@click.argument("group", type=click.Choice(list(all_groups())), nargs=-1, required=True)
@click.pass_context
def start_cmd(ctx: click.Context, restart: bool, skip_keyring: bool, group: tuple[str, ...]) -> None:
import asyncio
from chia.cmds.beta_funcs import warn_if_beta_enabled
from chia.cmds.start_funcs import async_start
root_path = ChiaCliContext.set_default(ctx).root_path
config = load_config(root_path, "config.yaml")
warn_if_beta_enabled(config)
asyncio.run(async_start(root_path, config, group, restart, skip_keyring=skip_keyring))