Esempio n. 1
0
def createThrift(name=None, wallet=None, basedirpath=None, port=None):
    return createAgent(ThriftAgent,
                       name or "Thrift Bank",
                       wallet or buildThriftWallet(),
                       basedirpath,
                       port,
                       clientClass=TestClient)
Esempio n. 2
0
        client = create_client(base_dir_path=None, client_class=TestClient)

    agent = ThriftAgent(name=name or 'Thrift Bank',
                        basedirpath=base_dir_path,
                        client=client,
                        wallet=wallet,
                        port=port,
                        endpointArgs=endpoint_args)

    agent._invites = {
        "77fbf9dc8c8e6acde33de98c6d747b28c": (1, "Alice"),
        "ousezru20ic4yz3j074trcgthwlsnfsef": (2, "Bob")
    }

    return agent

async def bootstrap_thrift(agent):
    pass

if __name__ == "__main__":
    args = RunnableAgent.parser_cmd_args()
    name = 'Thrift Bank'
    port = args.port
    if port is None:
        port = 7777
    with_cli = args.withcli
    agent = create_thrift(name=name, wallet=buildThriftWallet(),
                          base_dir_path=None, port=port)
    RunnableAgent.run_agent(agent, bootstrap=bootstrap_thrift(agent),
                            with_cli=with_cli)
Esempio n. 3
0
def thriftWallet():
    return buildThriftWallet()
Esempio n. 4
0
def thriftWallet():
    return buildThriftWallet()
Esempio n. 5
0
                        wallet=wallet,
                        port=port,
                        endpointArgs=endpoint_args)

    agent._invites = {
        "77fbf9dc8c8e6acde33de98c6d747b28c": (1, "Alice"),
        "ousezru20ic4yz3j074trcgthwlsnfsef": (2, "Bob")
    }

    return agent


async def bootstrap_thrift(agent):
    pass


if __name__ == "__main__":
    args = RunnableAgent.parser_cmd_args()
    name = 'Thrift Bank'
    port = args.port
    if port is None:
        port = 7777
    with_cli = args.withcli
    agent = create_thrift(name=name,
                          wallet=buildThriftWallet(),
                          base_dir_path=None,
                          port=port)
    RunnableAgent.run_agent(agent,
                            bootstrap=bootstrap_thrift(agent),
                            with_cli=with_cli)
Esempio n. 6
0
                date_of_birth='December 28, 1990')
        }

    def getLinkNameByInternalId(self, internalId):
        return self._attrs[internalId]._vals["first_name"]

    async def postProofVerif(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__":
    port = 7777
    TestWalletedAgent.createAndRunAgent(
        "Thrift Bank", agentClass=ThriftAgent, wallet=buildThriftWallet(),
        basedirpath=None, port=port, looper=None, clientClass=TestClient,
        cliAgentCreator=lambda: createThrift(port=port))