Exemple #1
0
    def __init__(self,
                 db,
                 ip_address,
                 nat_type,
                 testnet=False,
                 relaying=False):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.testnet = testnet
        self.ws = None
        self.blockchain = None
        self.processors = []
        self.relay_node = None
        self.nat_type = nat_type
        self.vendors = db.vendors.get_vendors()
        self.ban_score = BanScore(self)
        self.factory = self.ConnHandlerFactory(self.processors, nat_type,
                                               self.relay_node, self.ban_score)
        self.log = Logger(system=self)
        self.keep_alive_loop = LoopingCall(self.keep_alive)
        self.keep_alive_loop.start(30, now=False)
        ConnectionMultiplexer.__init__(self,
                                       CryptoConnectionFactory(self.factory),
                                       self.ip_address[0], relaying)
    def __init__(self, ip_address):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.processors = []
        self.factory = self.ConnHandlerFactory(self.processors)
        ConnectionMultiplexer.__init__(self, CryptoConnectionFactory(self.factory), self.ip_address[0])
    def __init__(self, ip_address):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.processors = []
        self.factory = self.ConnHandlerFactory(self.processors)
        ConnectionMultiplexer.__init__(self,
                                       CryptoConnectionFactory(self.factory),
                                       self.ip_address[0])
    def __init__(self, ip_address, testnet=False):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.testnet = testnet
        self.ws = None
        self.blockchain = None
        self.processors = []
        self.factory = self.ConnHandlerFactory(self.processors, self)
        ConnectionMultiplexer.__init__(self, CryptoConnectionFactory(self.factory), self.ip_address[0])
    def __init__(self, ip_address, testnet=False):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.testnet = testnet
        self.ws = None
        self.blockchain = None
        self.processors = []
        self.factory = self.ConnHandlerFactory(self.processors, self)
        ConnectionMultiplexer.__init__(self,
                                       CryptoConnectionFactory(self.factory),
                                       self.ip_address[0])
    def __init__(self, ip_address, nat_type, testnet=False, relaying=False):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.testnet = testnet
        self.ws = None
        self.blockchain = None
        self.processors = []
        self.relay_node = None
        self.nat_type = nat_type
        self.factory = self.ConnHandlerFactory(self.processors, nat_type, self.relay_node)
        self.log = Logger(system=self)
        ConnectionMultiplexer.__init__(self, CryptoConnectionFactory(self.factory), self.ip_address[0], relaying)
    def __init__(self, ip_address, nat_type, testnet=False, relaying=False):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.testnet = testnet
        self.ws = None
        self.blockchain = None
        self.processors = []
        self.relay_node = None
        self.nat_type = nat_type
        self.vendors = Database(testnet).VendorStore().get_vendors()
        self.factory = self.ConnHandlerFactory(self.processors, nat_type, self.relay_node)
        self.log = Logger(system=self)
        ConnectionMultiplexer.__init__(self, CryptoConnectionFactory(self.factory), self.ip_address[0], relaying)
    def __init__(self, db, ip_address, nat_type, testnet=False, relaying=False):
        """
        Initialize the new protocol with the connection handler factory.

        Args:
                ip_address: a `tuple` of the (ip address, port) of ths node.
        """
        self.ip_address = ip_address
        self.testnet = testnet
        self.ws = None
        self.blockchain = None
        self.processors = []
        self.relay_node = None
        self.nat_type = nat_type
        self.vendors = db.vendors.get_vendors()
        self.factory = self.ConnHandlerFactory(self.processors, nat_type, self.relay_node)
        self.log = Logger(system=self)
        self.keep_alive_loop = LoopingCall(self.keep_alive)
        self.keep_alive_loop.start(30 if nat_type == RESTRICTED else 1200, now=False)
        ConnectionMultiplexer.__init__(self, CryptoConnectionFactory(self.factory), self.ip_address[0], relaying)