Пример #1
0
 def __init__(
     self,
     rest_host: str,
     rest_port: int,
     routes: 'ProxyRESTRoutes' = None,
 ) -> None:
     self.rest_interface = InterfaceInfo(host=rest_host, port=rest_port)
     if routes:  # if is me
         self.rest_app = routes.rest_app
         self.db_filepath = routes.db_filepath
     else:
         self.rest_app = constants.PUBLIC_ONLY
Пример #2
0
    def __init__(self,
                 rest_host: str,
                 rest_port: int,
                 hosting_power=None,
                 rest_app=None,
                 datastore=None,
                 ) -> None:

        self.rest_interface = InterfaceInfo(host=rest_host, port=rest_port)
        if rest_app:  # if is me
            self.rest_app = rest_app
            self.datastore = datastore
        else:
            self.rest_app = constants.PUBLIC_ONLY

        self.__hosting_power = hosting_power
Пример #3
0
    def __init__(self,
                 host=None,
                 port=None,
                 db_name=None,
                 tls_private_key=None,
                 tls_curve=None,
                 *args,
                 **kwargs):
        self.rest_interface = InterfaceInfo(host=host, port=port)

        self.db_name = db_name
        self._rest_app = None
        tls_hosting_keypair = HostingKeypair(
            common_name=self.checksum_public_address,
            private_key=tls_private_key,
            curve=tls_curve)
        tls_hosting_power = TLSHostingPower(keypair=tls_hosting_keypair)
        self._crypto_power.consume_power_up(tls_hosting_power)
 def rest_interface(self):
     return InterfaceInfo(host=MOCK_IP_ADDRESS, port=MOCK_PORT)