예제 #1
0
def request_collector(ms_address, ms_database, get_private_key):
    with patch("request_collector.server.MatrixListener"):
        rc = RequestCollector(private_key=get_private_key(ms_address), state_db=ms_database)
        rc.start()
        yield rc
        rc.stop()
        rc.join()
예제 #2
0
def request_collector(
    server_private_key,
    ms_database,
    web3,
    monitoring_service_contract,
    token_network_registry_contract,
    send_funds,
    contracts_manager: ContractManager,
):
    with patch('request_collector.server.MatrixListener'):
        rc = RequestCollector(private_key=server_private_key,
                              state_db=ms_database)
        rc.start()
        yield rc
        rc.stop()
        rc.join()
예제 #3
0
def main(
    monitoring_channel: str,
    matrix_homeserver: str,
    matrix_username: str,
    matrix_password: str,
    state_db: str,
    log_level: str,
    log_config: TextIO,
):
    """Console script for request_collector.

    Logging can be quickly set by specifying a global log level or in a
    detailed way by using a log configuration file. See
    https://docs.python.org/3.7/library/logging.config.html#logging-config-dictschema
    for a detailed description of the format.
    """
    assert log_config is None
    setup_logging(log_level, log_config)

    log.info("Starting Raiden Monitoring Request Collector")

    transport = MatrixTransport(
        matrix_homeserver,
        matrix_username,
        matrix_password,
        monitoring_channel,
    )

    database = StateDBSqlite(state_db)

    service = None
    try:
        service = RequestCollector(
            state_db=database,
            transport=transport,
        )

        service.run()
    except (KeyboardInterrupt, SystemExit):
        print('Exiting...')
    finally:
        log.info('Stopping Pathfinding Service...')
        if service:
            service.stop()

    return 0
예제 #4
0
def request_collector(
    server_private_key,
    blockchain,
    dummy_transport,
    state_db_sqlite,
    web3,
    monitoring_service_contract,
    token_network_registry_contract,
    send_funds,
    contracts_manager: ContractManager,
):
    rc = RequestCollector(
        state_db=state_db_sqlite,
        transport=dummy_transport,
    )
    rc.start()
    yield rc
    rc.stop()