fabric-samples/balance-transfer/config.js
Bret Harrison bb3ac84e6e [FAB-5363] fabric-samples update balance
Update balance transfer sample to use the
connection profile and node 8.

Change-Id: I17c74c6cb23ebe55a8f2bba735d41525ae9e5ab1
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
Signed-off-by: ratnakar <asara.ratnakar@gmail.com>
2017-10-31 16:00:14 -04:00

18 lines
832 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, 'app', '../artifacts',file));
hfc.setConfigSetting('Org1-connection-profile-path',path.join(__dirname, 'app', '../artifacts','org1.yaml'));
hfc.setConfigSetting('Org2-connection-profile-path',path.join(__dirname, 'app', '../artifacts','org2.yaml'));
// some other settings the application might need to know
hfc.addConfigFile(path.join(__dirname, 'config.json'));