Esempio n. 1
0
def with_configure_gevent():
    """ Switch to the custom gevent configuration that we use when running Raiden.

    Override the dont_exit_pytest fixture for the duration of a test.
    """
    gevent.get_hub().SYSTEM_ERROR = (KeyboardInterrupt, SystemExit, SystemError
                                     )  # default values
    gevent.get_hub().NOT_ERROR = (gevent.GreenletExit, SystemExit)
    configure_gevent()
    yield
    undo_configure_gevent()
    dont_exit_pytest()
Esempio n. 2
0
from raiden.utils import (
    pex,
    privatekey_to_address,
)
from raiden.network.proxies import (
    TokenNetworkRegistry,
    SecretRegistry,
    Discovery,
)
from raiden.exceptions import InvalidSettleTimeout
from raiden.utils.gevent_utils import configure_gevent


log = structlog.get_logger(__name__)

configure_gevent()


class App:  # pylint: disable=too-few-public-methods
    DEFAULT_CONFIG = {
        'host': '',
        'port': INITIAL_PORT,
        'external_ip': '',
        'external_port': INITIAL_PORT,
        'privatekey_hex': '',
        'reveal_timeout': DEFAULT_REVEAL_TIMEOUT,
        'settle_timeout': DEFAULT_SETTLE_TIMEOUT,
        'database_path': '',
        'msg_timeout': 100.0,
        'transport': {
            'retry_interval': DEFAULT_TRANSPORT_RETRY_INTERVAL,
Esempio n. 3
0
    group,
    option,
    option_group,
)
from raiden.utils.echo_node import EchoNode
from raiden.utils.gevent_utils import configure_gevent, RaidenGreenletEvent
from raiden.utils.http import HTTPExecutor
from raiden_contracts.constants import (
    CONTRACT_ENDPOINT_REGISTRY,
    CONTRACT_SECRET_REGISTRY,
    CONTRACT_TOKEN_NETWORK_REGISTRY,
)

log = structlog.get_logger(__name__)

configure_gevent()


def check_synced(blockchain_service: BlockChainService) -> None:
    net_id = blockchain_service.network_id
    try:
        network = constants.ID_TO_NETWORKNAME[net_id]
    except (EthNodeCommunicationError, RequestException):
        print(
            'Could not determine the network the ethereum node is connected.\n'
            'Because of this there is no way to determine the latest\n'
            'block with an oracle, and the events from the ethereum\n'
            'node cannot be trusted. Giving up.\n', )
        sys.exit(1)
    except KeyError:
        print(