How to use the fabric-network.X509WalletMixin function in fabric-network

To help you get started, we’ve selected a few fabric-network examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / caliper / packages / caliper-fabric / lib / e2eUtils.js View on Github external
function init(config_path, root_path) {
    const config = CaliperUtils.parseYaml(config_path);
    networkRoot = root_path;
    ORGS = config.fabric.network;
    isLegacy = (config.info.Version.startsWith('1.0') || config.info.Version.startsWith('1.1'));
    if(!isLegacy){
        Gateway = require('fabric-network').Gateway;
        InMemoryWallet = require('fabric-network').InMemoryWallet;
        X509WalletMixin = require('fabric-network').X509WalletMixin;
    }
}
github hyperledger / caliper / packages / caliper-fabric / lib / fabric.js View on Github external
async _addToWallet(org, certificate, key, name) {
        const walletId = FabricNetworkAPI.X509WalletMixin.createIdentity(this.networkUtil.getMspIdOfOrganization(org), certificate, key);
        await this.wallet.import(name, walletId);
        logger.info(`Identity ${name} created and imported to wallet`);
    }