(self, protocol)
Returns a Deferred which fires with 'self' after at least one
        descriptor has been uploaded. Errback if no descriptor upload
        succeeds.
Returns a Deferred which fires with 'self' after at least one
        descriptor has been uploaded. Errback if no descriptor upload
        succeeds.
Returns a Deferred which fires with self after at least one descriptor has been uploaded . Errback if no descriptor upload succeeds .
def add_to_tor(self, protocol):
        '''
        Returns a Deferred which fires with 'self' after at least one
        descriptor has been uploaded. Errback if no descriptor upload
        succeeds.
        '''

        upload_d = _await_descriptor_upload(protocol, self, progress=None, await_all_uploads=False)

        # _add_ephemeral_service takes a TorConfig but we don't have
        # that here ..  and also we're just keeping this for
        # backwards-compatability anyway so instead of trying to
        # re-use that helper I'm leaving this original code here. So
        # this is what it supports and that's that:
        ports = ' '.join(map(lambda x: 'Port=' + x.strip(), self._ports))
        cmd = 'ADD_ONION %s %s' % (self._key_blob, ports)
        ans = yield protocol.queue_command(cmd)
        ans = find_keywords(ans.split('\n'))
        self.hostname = ans['ServiceID'] + '.onion'
        if self._key_blob.startswith('NEW:'):
            self.private_key = ans['PrivateKey']
        else:
            self.private_key = self._key_blob

        log.msg('Created hidden-service at', self.hostname)

        log.msg("Created '{}', waiting for descriptor uploads.".format(self.hostname))
        yield upload_d
def add_to_tor ( self , protocol ) : upload_d = _await_descriptor_upload ( protocol , self , progress = None , await_all_uploads = False ) # _add_ephemeral_service takes a TorConfig but we don't have # that here ..  and also we're just keeping this for # backwards-compatability anyway so instead of trying to # re-use that helper I'm leaving this original code here. So # this is what it supports and that's that: ports = ' ' . join ( map ( lambda x : 'Port=' + x . strip ( ) , self . _ports ) ) cmd = 'ADD_ONION %s %s' % ( self . _key_blob , ports ) ans = yield protocol . queue_command ( cmd ) ans = find_keywords ( ans . split ( '\n' ) ) self . hostname = ans [ 'ServiceID' ] + '.onion' if self . _key_blob . startswith ( 'NEW:' ) : self . private_key = ans [ 'PrivateKey' ] else : self . private_key = self . _key_blob log . msg ( 'Created hidden-service at' , self . hostname ) log . msg ( "Created '{}', waiting for descriptor uploads." . format ( self . hostname ) ) yield upload_d