Ejemplo n.º 1
0
def main() -> None:
    # Use a temp keychain which will be deleted when it exits scope
    with TempKeyring() as keychain:
        # If launched with -D, we should connect to the keychain via the daemon instead
        # of using a local keychain
        if "-D" in sys.argv:
            keychain = None
            sys.argv.remove(
                "-D"
            )  # Remove -D to avoid conflicting with load_config_cli's argparse usage
        config = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml",
                                 SERVICE_NAME)
        config["database_path"] = config["simulator_database_path"]
        config["peer_db_path"] = config["simulator_peer_db_path"]
        config["introducer_peer"]["host"] = "127.0.0.1"
        config["introducer_peer"]["port"] = 58555
        config["selected_network"] = "testnet0"
        config["simulation"] = True
        kwargs = service_kwargs_for_full_node_simulator(
            DEFAULT_ROOT_PATH,
            config,
            create_block_tools(test_constants,
                               root_path=DEFAULT_ROOT_PATH,
                               keychain=keychain),
        )
        return run_service(**kwargs)
Ejemplo n.º 2
0
def main():
    config = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml", "seeder")
    overrides = config["network_overrides"]["constants"][
        config["selected_network"]]
    updated_constants = DEFAULT_CONSTANTS.replace_str_to_bytes(**overrides)
    kwargs = service_kwargs_for_full_node_crawler(DEFAULT_ROOT_PATH, config,
                                                  updated_constants)
    return run_service(**kwargs)
Ejemplo n.º 3
0
def main() -> None:
    config = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml", SERVICE_NAME)
    config["database_path"] = config["simulator_database_path"]
    config["peer_db_path"] = config["simulator_peer_db_path"]
    config["introducer_peer"]["host"] = "127.0.0.1"
    config["introducer_peer"]["port"] = 58555
    config["selected_network"] = "testnet0"
    config["simulation"] = True
    kwargs = service_kwargs_for_full_node_simulator(
        DEFAULT_ROOT_PATH,
        config,
        BlockTools(test_constants),
    )
    return run_service(**kwargs)
Ejemplo n.º 4
0
def main() -> None:
    config = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml", SERVICE_NAME)
    # This is simulator
    local_test = config["testing"]
    if local_test is True:
        constants = test_constants
        current = config["database_path"]
        config["database_path"] = f"{current}_simulation"
        config["selected_network"] = "testnet0"
    else:
        constants = DEFAULT_CONSTANTS
    keychain = Keychain(testing=False)
    kwargs = service_kwargs_for_wallet(DEFAULT_ROOT_PATH, config, constants, keychain)
    return run_service(**kwargs)
Ejemplo n.º 5
0
def main() -> None:
    config = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml", SERVICE_NAME)
    config_pool = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml", "pool")
    kwargs = service_kwargs_for_farmer(DEFAULT_ROOT_PATH, config, config_pool,
                                       DEFAULT_CONSTANTS)
    return run_service(**kwargs)
Ejemplo n.º 6
0
def main() -> None:
    config = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml", SERVICE_NAME)
    kwargs = service_kwargs_for_timelord(DEFAULT_ROOT_PATH, config, DEFAULT_CONSTANTS)
    return run_service(**kwargs)
Ejemplo n.º 7
0
def main() -> None:
    config = load_config_cli(DEFAULT_ROOT_PATH, "config.yaml", SERVICE_NAME)
    kwargs = service_kwargs_for_introducer(DEFAULT_ROOT_PATH, config)
    return run_service(**kwargs)