How to use the @hyperledger/caliper-core.ConfigUtil.get function in @hyperledger/caliper-core

To help you get started, we’ve selected a few @hyperledger/caliper-core 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 / fabric.js View on Github external
this.clientIndex = 0;
        this.txIndex = -1;
        this.randomTargetPeerCache = new Map();
        this.channelEventSourcesCache = new Map();
        this.randomTargetOrdererCache = new Map();
        this.wallet = undefined;
        this.userContracts = new Map();

        // this value is hardcoded, if it's used, that means that the provided timeouts are not sufficient
        this.configSmallestTimeout = 1000;

        this.configSleepAfterCreateChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.CreateChannel, 5000);
        this.configSleepAfterJoinChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.JoinChannel, 3000);
        this.configSleepAfterInstantiateChaincode = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.InstantiateChaincode, 5000);
        this.configVerifyProposalResponse = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ProposalResponse, true);
        this.configVerifyReadWriteSets = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ReadWriteSets, true);
        this.configLatencyThreshold = ConfigUtil.get(ConfigUtil.keys.Fabric.LatencyThreshold, 1.0);
        this.configOverwriteGopath = ConfigUtil.get(ConfigUtil.keys.Fabric.OverwriteGopath, true);
        this.configChaincodeInstantiateTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiate, 300000);
        this.configChaincodeInstantiateEventTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiateEvent, 300000);
        this.configDefaultTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.InvokeOrQuery, 60000);
        this.configClientBasedLoadBalancing = ConfigUtil.get(ConfigUtil.keys.Fabric.LoadBalancing, 'client') === 'client';
        this.configCountQueryAsLoad = ConfigUtil.get(ConfigUtil.keys.Fabric.CountQueryAsLoad, true);
        this.configUseGateway = ConfigUtil.get(ConfigUtil.keys.Fabric.Gateway, false);
        this.configLocalHost = ConfigUtil.get(ConfigUtil.keys.Fabric.GatewayLocalHost, true);
        this.configDiscovery = ConfigUtil.get(ConfigUtil.keys.Fabric.Discovery, false);

        ConfigValidator.validateNetwork(this.network, CaliperUtils.getFlowOptions(),
            this.configDiscovery, this.configUseGateway);

        this.networkUtil = new FabricNetwork(this.network, workspace_root);
        this.fileWalletPath = this.networkUtil.getFileWalletPath();
github hyperledger / caliper / packages / caliper-fabric / lib / fabric.js View on Github external
this.txIndex = -1;
        this.randomTargetPeerCache = new Map();
        this.channelEventSourcesCache = new Map();
        this.randomTargetOrdererCache = new Map();
        this.wallet = undefined;
        this.userContracts = new Map();

        // this value is hardcoded, if it's used, that means that the provided timeouts are not sufficient
        this.configSmallestTimeout = 1000;

        this.configSleepAfterCreateChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.CreateChannel, 5000);
        this.configSleepAfterJoinChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.JoinChannel, 3000);
        this.configSleepAfterInstantiateChaincode = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.InstantiateChaincode, 5000);
        this.configVerifyProposalResponse = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ProposalResponse, true);
        this.configVerifyReadWriteSets = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ReadWriteSets, true);
        this.configLatencyThreshold = ConfigUtil.get(ConfigUtil.keys.Fabric.LatencyThreshold, 1.0);
        this.configOverwriteGopath = ConfigUtil.get(ConfigUtil.keys.Fabric.OverwriteGopath, true);
        this.configChaincodeInstantiateTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiate, 300000);
        this.configChaincodeInstantiateEventTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiateEvent, 300000);
        this.configDefaultTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.InvokeOrQuery, 60000);
        this.configClientBasedLoadBalancing = ConfigUtil.get(ConfigUtil.keys.Fabric.LoadBalancing, 'client') === 'client';
        this.configCountQueryAsLoad = ConfigUtil.get(ConfigUtil.keys.Fabric.CountQueryAsLoad, true);
        this.configUseGateway = ConfigUtil.get(ConfigUtil.keys.Fabric.Gateway, false);
        this.configLocalHost = ConfigUtil.get(ConfigUtil.keys.Fabric.GatewayLocalHost, true);
        this.configDiscovery = ConfigUtil.get(ConfigUtil.keys.Fabric.Discovery, false);

        ConfigValidator.validateNetwork(this.network, CaliperUtils.getFlowOptions(),
            this.configDiscovery, this.configUseGateway);

        this.networkUtil = new FabricNetwork(this.network, workspace_root);
        this.fileWalletPath = this.networkUtil.getFileWalletPath();
        this.defaultInvoker = Array.from(this.networkUtil.getClients())[0];
github hyperledger / caliper / packages / caliper-fabric / lib / fabric.js View on Github external
this.registrarProfiles = new Map();
        this.eventSources = [];
        this.clientIndex = 0;
        this.txIndex = -1;
        this.randomTargetPeerCache = new Map();
        this.channelEventSourcesCache = new Map();
        this.randomTargetOrdererCache = new Map();
        this.wallet = undefined;
        this.userContracts = new Map();

        // this value is hardcoded, if it's used, that means that the provided timeouts are not sufficient
        this.configSmallestTimeout = 1000;

        this.configSleepAfterCreateChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.CreateChannel, 5000);
        this.configSleepAfterJoinChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.JoinChannel, 3000);
        this.configSleepAfterInstantiateChaincode = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.InstantiateChaincode, 5000);
        this.configVerifyProposalResponse = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ProposalResponse, true);
        this.configVerifyReadWriteSets = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ReadWriteSets, true);
        this.configLatencyThreshold = ConfigUtil.get(ConfigUtil.keys.Fabric.LatencyThreshold, 1.0);
        this.configOverwriteGopath = ConfigUtil.get(ConfigUtil.keys.Fabric.OverwriteGopath, true);
        this.configChaincodeInstantiateTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiate, 300000);
        this.configChaincodeInstantiateEventTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiateEvent, 300000);
        this.configDefaultTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.InvokeOrQuery, 60000);
        this.configClientBasedLoadBalancing = ConfigUtil.get(ConfigUtil.keys.Fabric.LoadBalancing, 'client') === 'client';
        this.configCountQueryAsLoad = ConfigUtil.get(ConfigUtil.keys.Fabric.CountQueryAsLoad, true);
        this.configUseGateway = ConfigUtil.get(ConfigUtil.keys.Fabric.Gateway, false);
        this.configLocalHost = ConfigUtil.get(ConfigUtil.keys.Fabric.GatewayLocalHost, true);
        this.configDiscovery = ConfigUtil.get(ConfigUtil.keys.Fabric.Discovery, false);

        ConfigValidator.validateNetwork(this.network, CaliperUtils.getFlowOptions(),
            this.configDiscovery, this.configUseGateway);
github hyperledger / caliper / packages / caliper-fabric / lib / fabric.js View on Github external
this.channelEventSourcesCache = new Map();
        this.randomTargetOrdererCache = new Map();
        this.wallet = undefined;
        this.userContracts = new Map();

        // this value is hardcoded, if it's used, that means that the provided timeouts are not sufficient
        this.configSmallestTimeout = 1000;

        this.configSleepAfterCreateChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.CreateChannel, 5000);
        this.configSleepAfterJoinChannel = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.JoinChannel, 3000);
        this.configSleepAfterInstantiateChaincode = ConfigUtil.get(ConfigUtil.keys.Fabric.SleepAfter.InstantiateChaincode, 5000);
        this.configVerifyProposalResponse = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ProposalResponse, true);
        this.configVerifyReadWriteSets = ConfigUtil.get(ConfigUtil.keys.Fabric.Verify.ReadWriteSets, true);
        this.configLatencyThreshold = ConfigUtil.get(ConfigUtil.keys.Fabric.LatencyThreshold, 1.0);
        this.configOverwriteGopath = ConfigUtil.get(ConfigUtil.keys.Fabric.OverwriteGopath, true);
        this.configChaincodeInstantiateTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiate, 300000);
        this.configChaincodeInstantiateEventTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.ChaincodeInstantiateEvent, 300000);
        this.configDefaultTimeout = ConfigUtil.get(ConfigUtil.keys.Fabric.Timeout.InvokeOrQuery, 60000);
        this.configClientBasedLoadBalancing = ConfigUtil.get(ConfigUtil.keys.Fabric.LoadBalancing, 'client') === 'client';
        this.configCountQueryAsLoad = ConfigUtil.get(ConfigUtil.keys.Fabric.CountQueryAsLoad, true);
        this.configUseGateway = ConfigUtil.get(ConfigUtil.keys.Fabric.Gateway, false);
        this.configLocalHost = ConfigUtil.get(ConfigUtil.keys.Fabric.GatewayLocalHost, true);
        this.configDiscovery = ConfigUtil.get(ConfigUtil.keys.Fabric.Discovery, false);

        ConfigValidator.validateNetwork(this.network, CaliperUtils.getFlowOptions(),
            this.configDiscovery, this.configUseGateway);

        this.networkUtil = new FabricNetwork(this.network, workspace_root);
        this.fileWalletPath = this.networkUtil.getFileWalletPath();
        this.defaultInvoker = Array.from(this.networkUtil.getClients())[0];

        // NOTE: regardless of the version of the Fabric backend, the SDK must be at least v1.1.0 in order to
github hyperledger / caliper / packages / caliper-fabric / lib / fabric.js View on Github external
async _createChannels() {
        let channels = this.networkUtil.getChannels();
        let channelCreated = false;

        for (let channel of channels) {
            let channelObject = this.networkUtil.getNetworkObject().channels[channel];

            if (CaliperUtils.checkProperty(channelObject, 'created') && channelObject.created) {
                logger.info(`Channel '${channel}' is configured as created, skipping creation`);
                continue;
            }

            if (ConfigUtil.get(ConfigUtil.keys.Fabric.SkipCreateChannelPrefix + channel, false)) {
                logger.info(`Creation of Channel '${channel}' is configured to skip`);
                continue;
            }

            channelCreated = true;

            let configUpdate;
            if (CaliperUtils.checkProperty(channelObject, 'configBinary')) {
                logger.info(`Channel '${channel}' definiton being retrieved from file`);
                configUpdate = this._getChannelConfigFromFile(channelObject, channel);
            }
            else {
                logger.info(`Channel '${channel}' definiton being generated from description`);
                const channelTx = this._createChannelTxEnvelope(channelObject.definition, channel);
                const payload = common.Payload.decode(channelTx.getPayload().toBuffer());
                const configtx = common.ConfigUpdateEnvelope.decode(payload.getData().toBuffer());
github hyperledger / caliper / packages / caliper-cli / lib / bind / bind.js View on Github external
static async handler(argv) {
        let sut = ConfigUtil.get(ConfigUtil.keys.Bind.Sut, undefined);
        let sdk = ConfigUtil.get(ConfigUtil.keys.Bind.Sdk, undefined);
        let cwd = ConfigUtil.get(ConfigUtil.keys.Bind.Cwd, undefined);
        let userArgs = ConfigUtil.get(ConfigUtil.keys.Bind.Args, undefined);

        let bindOptions = CaliperUtils.parseYaml(path.join(__dirname, './config.yaml'));

        let sutList = Object.keys(bindOptions.sut);
        if (!sut) {
            let msg = `SUT name is not specified. Available SUTs: ${sutList.join(' | ')}`;
            logger.error(msg);
            throw new Error(msg);
        }

        if (!sutList.includes(sut)) {
            let msg = `Unknown SUT name "${sut}". Available SUTs: ${sutList.join(' | ')}`;
            logger.error(msg);
            throw new Error(msg);