Demo entry 6799512

js

   

Submitted by anonymous on May 20, 2019 at 13:12
Language: JavaScript. Code size: 727 Bytes.

var hfc = require('fabric-client');
hfc.setLogger(logger);
var ORGS = hfc.getConfigSetting('network-config');
for (let key in ORGS) {
	if (key.indexOf('org') === 0) {
		let client = new hfc();
		let cryptoSuite = hfc.newCryptoSuite();
		cryptoSuite.setCryptoKeyStore(hfc.newCryptoKeyStore({path: getKeyStoreForOrg(ORGS[key].name)}));
		client.setCryptoSuite(cryptoSuite);
		let channel = client.newChannel(hfc.getConfigSetting('channelName'));
		channel.addOrderer(newOrderer(client));
		clients[key] = client;
		channels[key] = channel;
		setupPeers(channel, key, client);

		let caUrl = ORGS[key].ca;
		caClients[key] = new copService(caUrl, null /*defautl TLS opts*/, '' /* default CA */, cryptoSuite);
	}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).