Ejemplo n.º 1
0
    def __init__(self):
        WALLET_SEED = os.environ.get('INDY_WALLET_SEED')
        if not WALLET_SEED or len(WALLET_SEED) is not 32:
            raise Exception(
                'INDY_WALLET_SEED must be set and be 32 characters long.')

        self.__logger = logging.getLogger(__name__)

        config = hyperledger_indy.config()
        self.pool = NodePool('the-org-book-verifier',
                             config['genesis_txn_path'])
        wallet_name = 'TheOrgBook_Verifier_Wallet'

        verifier_type = 'virtual'
        verifier_config = {'freshness_time': 0}
        verifier_creds = {'key': ''}

        self.__logger.debug("Verifier __init__>>> {} {} {}".format(
            verifier_type, verifier_config, verifier_creds))

        verifier_wallet = Wallet(self.pool, WALLET_SEED, wallet_name,
                                 verifier_type, verifier_config,
                                 verifier_creds)

        self.__logger.debug("Verifier __init__>>> {} {} {}".format(
            verifier_type, verifier_config, verifier_creds))

        self.instance = VonVerifier(
            # self.pool,
            verifier_wallet)
Ejemplo n.º 2
0
    def __init__(self):
        config = hyperledger_indy.config()
        self.pool = NodePool('the-org-book-holder', config['genesis_txn_path'])

        self.instance = VonHolderProver(
            self.pool,
            Wallet(self.pool.name, WALLET_SEED, 'TheOrgBook Holder Wallet'))
Ejemplo n.º 3
0
    def __init__(self):
        config = hyperledger_indy.config()
        self.pool = NodePool('the-org-book-holder', config['genesis_txn_path'])

        self.instance = VonHolderProver(self.pool,
                                        'the_org_book_holder_000000000000',
                                        'TheOrgBook Holder Wallet', None,
                                        '127.0.0.1', 9703, 'api/v0')
Ejemplo n.º 4
0
    def __init__(self, legal_entity_id: str = None):
        WALLET_SEED = os.environ.get('INDY_WALLET_SEED')
        if not WALLET_SEED or len(WALLET_SEED) is not 32:
            raise Exception(
                'INDY_WALLET_SEED must be set and be 32 characters long.')

        self.__logger = logging.getLogger(__name__)

        config = hyperledger_indy.config()
        thread_id = threading.get_ident()
        self.pool = NodePool('the-org-book-holder-' + str(thread_id),
                             config['genesis_txn_path'])
        wallet_name = 'TheOrgBook_Holder_Wallet' + '$$' + str(thread_id)

        holder_type = os.environ.get('INDY_WALLET_TYPE')
        if holder_type == 'remote':
            # wallet_name = wallet_name + "$$" + str(thread_id)
            holder_url = os.environ.get('INDY_WALLET_URL')
            holder_config = {
                'endpoint': holder_url,
                'ping': 'schema/',
                'auth': 'api-token-auth/',
                'keyval': 'keyval/',
                'freshness_time': 0
            }
            holder_creds = {
                'auth_token': apps.get_remote_wallet_token(),
                'virtual_wallet': legal_entity_id
            }
            self.__logger.debug('Using remote Cfg: {} Creds: {}'.format(
                holder_config, holder_creds))
        else:
            # TODO force to virtual for now
            holder_type = 'virtual'
            holder_config = {'freshness_time': 0}
            holder_creds = {'key': '', 'virtual_wallet': legal_entity_id}
            self.__logger.debug('Using virtual Cfg: {} Creds: {}'.format(
                holder_config, holder_creds))

        self.__logger.debug("Holder __init__>>> {} {} {}".format(
            holder_type, holder_config, holder_creds))

        holder_wallet = Wallet(self.pool, WALLET_SEED, wallet_name,
                               holder_type, holder_config, holder_creds)

        self.__logger.debug("Holder __init__>>> {} {} {}".format(
            holder_type, holder_config, holder_creds))

        self.instance = VonHolderProver(
            # self.pool,
            holder_wallet)