예제 #1
0
    def run():
        bulldog = bulldogAgent
        bulldogWallet.pendSyncRequests()
        prepared = bulldogWallet.preparePending()
        bulldog.client.submitReqs(*prepared)

        runAgent(bulldog, emptyLooper)

        return bulldog, bulldogWallet
예제 #2
0
def thriftIsRunning(emptyLooper, tdirWithPoolTxns, thriftWallet, thriftAgent,
                    thriftAdded):
    thrift = thriftAgent
    thriftWallet.pendSyncRequests()
    prepared = thriftWallet.preparePending()
    thrift.client.submitReqs(*prepared)

    runAgent(thrift, emptyLooper)

    return thrift, thriftWallet
예제 #3
0
def acmeIsRunning(emptyLooper, tdirWithPoolTxns, acmeWallet, acmeAgent,
                  acmeAdded):
    acme = acmeAgent
    acmeWallet.pendSyncRequests()
    prepared = acmeWallet.preparePending()
    acme.client.submitReqs(*prepared)

    runAgent(acme, emptyLooper)

    return acme, acmeWallet
예제 #4
0
def faberIsRunning(emptyLooper, tdirWithPoolTxns, faberWallet, faberAgent,
                   faberAdded):
    faber = faberAgent
    faberWallet.pendSyncRequests()
    prepared = faberWallet.preparePending()
    faber.client.submitReqs(*prepared)

    runAgent(faber, emptyLooper)

    return faber, faberWallet
예제 #5
0
def runFaber(name=None,
             wallet=None,
             basedirpath=None,
             port=None,
             startRunning=True,
             bootstrap=True):

    return runAgent(FaberAgent, name or "Faber College", wallet, basedirpath,
                    port, startRunning, bootstrap)
예제 #6
0
            VERSION: claimDef.version,
            "claimDefSeqNo": claimDef.seqId
        }]

    async def addClaimDefsToWallet(self):
        claimDefJobCert = await self.issuer.genClaimDef(
            self._claimDefJobCertKey.name,
            self._claimDefJobCertKey.version,
            self._attrDefJobCert.attribNames(),
            'CL')
        claimDefJobCertId = ID(claimDefKey=claimDefJobCert.getKey(),
                               claimDefId=claimDefJobCert.seqId)
        p_prime, q_prime = primes["prime1"]
        await self.issuer.genKeys(claimDefJobCertId, p_prime=p_prime,
                                  q_prime=q_prime)
        await self.issuer.issueAccumulator(claimDefId=claimDefJobCertId, iA='110', L=5)

    async def bootstrap(self):
        await self.addClaimDefsToWallet()


def createAcme(name=None, wallet=None, basedirpath=None, port=None):
    return createAgent(AcmeAgent, name or "Acme Corp",
                       wallet or buildAcmeWallet(),
                       basedirpath, port, clientClass=TestClient)


if __name__ == "__main__":
    acme = createAcme(port=6666)
    runAgent(acme)
예제 #7
0
def runAcme(name=None, wallet=None, basedirpath=None, port=None,
            startRunning=True, bootstrap=True):

    return runAgent(AcmeAgent, name or "Acme Corp", wallet, basedirpath,
             port, startRunning, bootstrap)
예제 #8
0
파일: thrift.py 프로젝트: ottodevs/sovrin
    def isClaimAvailable(self, link, claimName):
        return True

    def getAvailableClaimList(self):
        return []

    def _addAtrribute(self, claimDefKey, proverId, link):
        pass

    async def postClaimVerif(self, claimName, link, frm):
        if claimName == "Loan-Application-Basic":
            self.notifyToRemoteCaller(EVENT_NOTIFY_MSG,
                                      "    Loan eligibility criteria satisfied,"
                                      " please send another claim "
                                      "'Loan-Application-KYC'\n",
                                      self.wallet.defaultId, frm)

    async def bootstrap(self):
        pass


def createThrift(name=None, wallet=None, basedirpath=None, port=None):
    return createAgent(ThriftAgent, name or "Thrift Bank",
                       wallet or buildThriftWallet(),
                       basedirpath, port, clientClass=TestClient)


if __name__ == "__main__":
    thrift = createThrift(port=7777)
    runAgent(thrift)
예제 #9
0
    async def addClaimDefsToWallet(self):
        claimDef = await self.issuer.genClaimDef(self._claimDefKey.name,
                                                 self._claimDefKey.version,
                                                 self._attrDef.attribNames(),
                                                 'CL')
        claimDefId = ID(claimDefKey=claimDef.getKey(),
                        claimDefId=claimDef.seqId)
        p_prime, q_prime = primes["prime2"]
        await self.issuer.genKeys(claimDefId, p_prime=p_prime, q_prime=q_prime)
        await self.issuer.issueAccumulator(claimDefId=claimDefId,
                                           iA='110',
                                           L=5)
        await self.initAvailableClaimList()

    async def bootstrap(self):
        await self.addClaimDefsToWallet()


def createFaber(name=None, wallet=None, basedirpath=None, port=None):
    return createAgent(FaberAgent,
                       name or "Faber College",
                       wallet or buildFaberWallet(),
                       basedirpath,
                       port,
                       clientClass=TestClient)


if __name__ == "__main__":
    faber = createFaber(port=5555)
    runAgent(faber)
예제 #10
0
파일: bulldog.py 프로젝트: ottodevs/sovrin
    async def addClaimDefsToWallet(self):
        claimDef = await self.issuer.genClaimDef(self._claimDefKey.name,
                                                 self._claimDefKey.version,
                                                 self._attrDef.attribNames(),
                                                 'CL')
        claimDefId = ID(claimDefKey=claimDef.getKey(),
                        claimDefId=claimDef.seqId)
        p_prime, q_prime = primes["prime2"]
        await self.issuer.genKeys(claimDefId, p_prime=p_prime, q_prime=q_prime)
        await self.issuer.issueAccumulator(claimDefId=claimDefId,
                                           iA='110',
                                           L=5)
        await self.initAvailableClaimList()

    async def bootstrap(self):
        await self.addClaimDefsToWallet()


def createBulldog(name=None, wallet=None, basedirpath=None, port=None):
    return createAgent(BulldogAgent,
                       name or "Bulldog",
                       wallet or buildBulldogWallet(),
                       basedirpath,
                       port,
                       clientClass=TestClient)


if __name__ == "__main__":
    bulldog = createBulldog(port=8787)
    runAgent(bulldog)