diff --git a/fabric-client/lib/Chain.js b/fabric-client/lib/Chain.js index 4e05db1f58..3037bb8fe9 100644 --- a/fabric-client/lib/Chain.js +++ b/fabric-client/lib/Chain.js @@ -870,15 +870,9 @@ var Chain = class { return Promise.reject(new Error(errorMsg)); } - // Verify that chaincodePath is being passed - if (request && (!request.chaincodePath || request.chaincodePath === '')) { - errorMsg = 'Missing chaincodePath parameter in Deployment proposal request'; - } else { - errorMsg = Chain._checkProposalRequest(request); - } - - if(errorMsg) { - logger.error('Chain.sendDeploymentProposal error '+ errorMsg); + errorMsg = Chain._checkProposalRequest(request); + if (errorMsg) { + logger.error('Chain.sendDeploymentProposal error ' + errorMsg); return Promise.reject(new Error(errorMsg)); } @@ -888,93 +882,72 @@ var Chain = class { } let self = this; - return packageChaincode(request.chaincodePath, request.chaincodeId, request['dockerfile-contents']) - .then( - function(data) { - var targzFilePath = data; + // step 1: construct a ChaincodeSpec + var args = []; + args.push(Buffer.from(request.fcn ? request.fcn : 'init', 'utf8')); - logger.debug('Chain.sendDeployment- Successfully generated chaincode deploy archive and name (%s)', request.chaincodeId); + for (let i = 0; i < request.args.length; i++) + args.push(Buffer.from(request.args[i], 'utf8')); - // at this point, the targzFile has been successfully generated + let ccSpec = { + type: _ccProto.ChaincodeSpec.Type.GOLANG, + chaincodeID: { + name: request.chaincodeId + }, + input: { + args: args + } + }; - // step 1: construct a ChaincodeSpec - var args = []; - args.push(Buffer.from(request.fcn ? request.fcn : 'init', 'utf8')); - - for (let i=0; i