コード例 #1
0
 async def _sendReq(self, op, clbk):
     req = Request(identifier=self.wallet.defaultId, operation=op)
     req = self.wallet.prepReq(req)
     self.client.submitReqs(req)
     try:
         resp = await eventually(_ensureReqCompleted,
                                 req.key,
                                 self.client,
                                 clbk,
                                 timeout=20,
                                 retryWait=0.5)
     except NoConsensusYet:
         raise TimeoutError('Request timed out')
     return resp
コード例 #2
0
 async def _sendReq(self, op, clbk):
     req = Request(identifier=self.wallet.defaultId, operation=op)
     req = self.wallet.prepReq(req)
     self.client.submitReqs(req)
     try:
         # TODO: Come up with an explanation, why retryWait had to be
         # increases to 1 from .5 to pass some tests and from 1 to 2 to
         # pass some other tests. The client was not getting a chance to
         # service its stack, we need to find a way to stop this starvation.
         resp = await eventually(_ensureReqCompleted,
                                 req.key, self.client, clbk,
                                 timeout=20, retryWait=2)
     except NoConsensusYet:
         raise TimeoutError('Request timed out')
     return resp
コード例 #3
0
    def requestClaimDef(self, seqNo, signature, sender):
        """
        Used to get a claim def from Sovrin
        :param seqNo: reference number of schema
        :param signature: CL is only supported option currently
        :return: req object
        """
        operation = {
            TXN_TYPE: GET_CLAIM_DEF,
            ORIGIN: sender,
            REF: seqNo,
            SIGNATURE_TYPE: signature
        }

        req = Request(sender, operation=operation)
        return self.prepReq(req)
コード例 #4
0
    def requestSchema(self, nym, name, version, sender):
        """
        Used to get a schema from Sovrin
        :param nym: nym that schema is attached to
        :param name: name of schema
        :param version: version of schema
        :return: req object
        """
        operation = {
            TARGET_NYM: nym,
            TXN_TYPE: GET_SCHEMA,
            DATA: {
                NAME: name,
                VERSION: version
            }
        }

        req = Request(sender, operation=operation)
        return self.prepReq(req)
コード例 #5
0
 def getRequest(self, requestAuthor: Identifier):
     if not self.seqNo:
         return Request(identifier=requestAuthor,
                        operation=self._opForGet())
コード例 #6
0
 def ledgerRequest(self):
     if self.ledgerStore.isWriting and not self.seqNo:
         assert self.origin is not None
         return Request(identifier=self.origin, operation=self._op())
コード例 #7
0
 def ledgerRequest(self):
     if not self.seqNo:
         return Request(identifier=self.trustee, operation=self._op())
コード例 #8
0
 def ledgerRequest(self):
     if not self.seqNo:
         assert self.identifier is not None
         return Request(identifier=self.trustAnchor, operation=self._op())
コード例 #9
0
 def ledgerRequest(self):
     if not self.seqNo:
         assert self.id is not None
         return Request(identifier=self.steward, operation=self._op())