How to use the fabric-common.Utils.getConfig function in fabric-common

To help you get started, we’ve selected a few fabric-common 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 / fabric-sdk-node / fabric-ca-client / lib / FabricCAServices.js View on Github external
*/

'use strict';

const {Utils: utils, BaseClient} = require('fabric-common');

const FabricCAClient = require('./FabricCAClient');

const {normalizeX509} = BaseClient;
const util = require('util');
const parseURL = require('./helper').parseURL;
const path = require('path');
const checkRegistrar = require('./helper').checkRegistrar;
const getSubjectCommonName = require('./helper').getSubjectCommonName;
const config = utils.getConfig();
const logger = utils.getLogger('FabricCAClientService.js');

// setup the location of the default config shipped with code
const default_config = path.resolve(__dirname, '../config/default.json');
config.reorderFileStores(default_config, true); // make sure this one is under the fabric-client

/**
 * @typedef {Object} TLSOptions
 * @property {string[]} trustedRoots Array of PEM-encoded trusted root certificates
 * @property {boolean} [verify=true] Determines whether or not to verify the server certificate when using TLS
 */

/**
 * This is an implementation of the member service client which communicates with the Fabric CA server.
 * @class
 * @extends BaseClient
github hyperledger / fabric-sdk-node / fabric-client / lib / Client.js View on Github external
const Package = require('./Package.js');
const Peer = require('./Peer.js');
const ChannelEventHub = require('./ChannelEventHub');
const Orderer = require('./Orderer.js');
const TransactionID = require('./TransactionID.js');
const crypto = require('crypto');

const util = require('util');
const fs = require('fs-extra');
const path = require('path');
const yaml = require('js-yaml');
const Constants = require('./Constants.js');

const fabprotos = require('fabric-protos');

const config = sdkUtils.getConfig();
// setup the location of the default config shipped with code
const default_config = path.resolve(__dirname, '../config/default.json');
config.reorderFileStores(default_config); // make sure this default has precedences
// set default SSL ciphers for gRPC
process.env.GRPC_SSL_CIPHER_SUITES = sdkUtils.getConfigSetting('grpc-ssl-cipher-suites');

const logger = sdkUtils.getLogger('Client.js');

/**
 * A client instance provides the main API surface to interact with a network of
 * peers and orderers. An application using the SDK may need to interact with
 * multiple networks, each through a separate instance of the Client.
 * <br><br>
 * An important aspect of the current design of the Client class is that it is <b>stateful</b>.
 * An instance must be configured with a <code>userContext</code> before it can be used to talk to the fabric
 * backend. A userContext is an instance of the {@link User} class, which encapsulates the ability to sign
github hyperledger / fabric-sdk-node / fabric-ca-client / lib / FabricCAClient.js View on Github external
/**
 * SPDX-License-Identifier: Apache-2.0
 */

const {Utils: utils} = require('fabric-common');
const config = utils.getConfig();
const logger = utils.getLogger('FabricCAClient.js');
const http = require('http');
const https = require('https');
const util = require('util');
const IdentityService = require('./IdentityService');
const AffiliationService = require('./AffiliationService');
const CertificateService = require('./CertificateService');

/**
 * Client for communciating with the Fabric CA APIs
 *
 * @class
 */
const FabricCAClient = class {

	/**