mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Crypto materal is cleared after every re-start of a new network Change-Id: I01c919109401428de1252695930f42e73eb3f795 Signed-off-by: ratnakar <asara.ratnakar@gmail.com>
18 lines
805 B
JavaScript
18 lines
805 B
JavaScript
var util = require('util');
|
|
var path = require('path');
|
|
var hfc = require('fabric-client');
|
|
|
|
var file = 'network-config%s.yaml';
|
|
|
|
var env = process.env.TARGET_NETWORK;
|
|
if (env)
|
|
file = util.format(file, '-' + env);
|
|
else
|
|
file = util.format(file, '');
|
|
// indicate to the application where the setup file is located so it able
|
|
// to have the hfc load it to initalize the fabric client instance
|
|
hfc.setConfigSetting('network-connection-profile-path',path.join(__dirname, 'artifacts' ,file));
|
|
hfc.setConfigSetting('Org1-connection-profile-path',path.join(__dirname, 'artifacts', 'org1.yaml'));
|
|
hfc.setConfigSetting('Org2-connection-profile-path',path.join(__dirname, 'artifacts', 'org2.yaml'));
|
|
// some other settings the application might need to know
|
|
hfc.addConfigFile(path.join(__dirname, 'config.json'));
|