mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-21 00:55:10 +00:00
FAB-11518
Fixed typo in instatiate-chaincode.js and removed unused imports from other JavaScript files in balance-transfer/app Change-Id: If9695c4f51e9c0835230b2c7f969cbf4aa132675 Signed-off-by: Clyde DCruz <clydecroix@gmail.com>
This commit is contained in:
parent
5930dfc06a
commit
bfdc0b6e7a
7 changed files with 4 additions and 30 deletions
|
|
@ -13,7 +13,6 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
var util = require('util');
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,19 +20,9 @@ logger.setLevel('DEBUG');
|
||||||
|
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var copService = require('fabric-ca-client');
|
|
||||||
|
|
||||||
var hfc = require('fabric-client');
|
var hfc = require('fabric-client');
|
||||||
hfc.setLogger(logger);
|
hfc.setLogger(logger);
|
||||||
var ORGS = hfc.getConfigSetting('network-config');
|
|
||||||
|
|
||||||
var clients = {};
|
|
||||||
var channels = {};
|
|
||||||
var caClients = {};
|
|
||||||
|
|
||||||
var sleep = async function (sleep_time_ms) {
|
|
||||||
return new Promise(resolve => setTimeout(resolve, sleep_time_ms));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getClientForOrg (userorg, username) {
|
async function getClientForOrg (userorg, username) {
|
||||||
logger.debug('getClientForOrg - ****** START %s %s', userorg, username)
|
logger.debug('getClientForOrg - ****** START %s %s', userorg, username)
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
var path = require('path');
|
|
||||||
var fs = require('fs');
|
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var config = require('../config.json');
|
|
||||||
var helper = require('./helper.js');
|
var helper = require('./helper.js');
|
||||||
var logger = helper.getLogger('install-chaincode');
|
var logger = helper.getLogger('install-chaincode');
|
||||||
var tx_id = null;
|
|
||||||
|
|
||||||
var installChaincode = async function(peers, chaincodeName, chaincodePath,
|
var installChaincode = async function(peers, chaincodeName, chaincodePath,
|
||||||
chaincodeVersion, chaincodeType, username, org_name) {
|
chaincodeVersion, chaincodeType, username, org_name) {
|
||||||
|
|
@ -76,7 +72,7 @@ var installChaincode = async function(peers, chaincodeName, chaincodePath,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!error_message) {
|
if (!error_message) {
|
||||||
let message = util.format('Successfully install chaincode');
|
let message = util.format('Successfully installed chaincode');
|
||||||
logger.info(message);
|
logger.info(message);
|
||||||
// build a response to send back to the REST caller
|
// build a response to send back to the REST caller
|
||||||
let response = {
|
let response = {
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
var path = require('path');
|
|
||||||
var fs = require('fs');
|
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var hfc = require('fabric-client');
|
|
||||||
var helper = require('./helper.js');
|
var helper = require('./helper.js');
|
||||||
var logger = helper.getLogger('instantiate-chaincode');
|
var logger = helper.getLogger('instantiate-chaincode');
|
||||||
|
|
||||||
|
|
@ -117,7 +114,7 @@ var instantiateChaincode = async function(peers, channelName, chaincodeName, cha
|
||||||
clearTimeout(event_timeout);
|
clearTimeout(event_timeout);
|
||||||
|
|
||||||
if (code !== 'VALID') {
|
if (code !== 'VALID') {
|
||||||
let message = until.format('The chaincode instantiate transaction was invalid, code:%s',code);
|
let message = util.format('The chaincode instantiate transaction was invalid, code:%s',code);
|
||||||
logger.error(message);
|
logger.error(message);
|
||||||
reject(new Error(message));
|
reject(new Error(message));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -187,7 +184,7 @@ var instantiateChaincode = async function(peers, channelName, chaincodeName, cha
|
||||||
|
|
||||||
if (!error_message) {
|
if (!error_message) {
|
||||||
let message = util.format(
|
let message = util.format(
|
||||||
'Successfully instantiate chaingcode in organization %s to the channel \'%s\'',
|
'Successfully instantiate chaincode in organization %s to the channel \'%s\'',
|
||||||
org_name, channelName);
|
org_name, channelName);
|
||||||
logger.info(message);
|
logger.info(message);
|
||||||
// build a response to send back to the REST caller
|
// build a response to send back to the REST caller
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
var path = require('path');
|
|
||||||
var fs = require('fs');
|
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var hfc = require('fabric-client');
|
|
||||||
var helper = require('./helper.js');
|
var helper = require('./helper.js');
|
||||||
var logger = helper.getLogger('invoke-chaincode');
|
var logger = helper.getLogger('invoke-chaincode');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var path = require('path');
|
|
||||||
var fs = require('fs');
|
|
||||||
|
|
||||||
var helper = require('./helper.js');
|
var helper = require('./helper.js');
|
||||||
var logger = helper.getLogger('Join-Channel');
|
var logger = helper.getLogger('Join-Channel');
|
||||||
|
|
@ -71,7 +69,7 @@ var joinChannel = async function(channel_name, peers, username, org_name) {
|
||||||
if(peer_result.response && peer_result.response.status == 200) {
|
if(peer_result.response && peer_result.response.status == 200) {
|
||||||
logger.info('Successfully joined peer to the channel %s',channel_name);
|
logger.info('Successfully joined peer to the channel %s',channel_name);
|
||||||
} else {
|
} else {
|
||||||
let message = util.format('Failed to joined peer to the channel %s',channel_name);
|
let message = util.format('Failed to join peer to the channel %s',channel_name);
|
||||||
error_message = message;
|
error_message = message;
|
||||||
logger.error(message);
|
logger.error(message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
var path = require('path');
|
|
||||||
var fs = require('fs');
|
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var hfc = require('fabric-client');
|
|
||||||
var helper = require('./helper.js');
|
var helper = require('./helper.js');
|
||||||
var logger = helper.getLogger('Query');
|
var logger = helper.getLogger('Query');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue