mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Merge "[FAB-5287] NodeSDK - fix sample"
This commit is contained in:
commit
d9e2d5cc8c
3 changed files with 7 additions and 7 deletions
|
|
@ -146,7 +146,7 @@ curl -s -X POST \
|
||||||
"peers": ["localhost:7051"],
|
"peers": ["localhost:7051"],
|
||||||
"chaincodeName":"mycc",
|
"chaincodeName":"mycc",
|
||||||
"chaincodeVersion":"v0",
|
"chaincodeVersion":"v0",
|
||||||
"functionName":"init",
|
"fcn":"init",
|
||||||
"args":["a","100","b","200"]
|
"args":["a","100","b","200"]
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -216,12 +216,12 @@ app.post('/channels/:channelName/chaincodes', function(req, res) {
|
||||||
var chaincodeName = req.body.chaincodeName;
|
var chaincodeName = req.body.chaincodeName;
|
||||||
var chaincodeVersion = req.body.chaincodeVersion;
|
var chaincodeVersion = req.body.chaincodeVersion;
|
||||||
var channelName = req.params.channelName;
|
var channelName = req.params.channelName;
|
||||||
var functionName = req.body.functionName;
|
var fcn = req.body.fcn;
|
||||||
var args = req.body.args;
|
var args = req.body.args;
|
||||||
logger.debug('channelName : ' + channelName);
|
logger.debug('channelName : ' + channelName);
|
||||||
logger.debug('chaincodeName : ' + chaincodeName);
|
logger.debug('chaincodeName : ' + chaincodeName);
|
||||||
logger.debug('chaincodeVersion : ' + chaincodeVersion);
|
logger.debug('chaincodeVersion : ' + chaincodeVersion);
|
||||||
logger.debug('functionName : ' + functionName);
|
logger.debug('fcn : ' + fcn);
|
||||||
logger.debug('args : ' + args);
|
logger.debug('args : ' + args);
|
||||||
if (!chaincodeName) {
|
if (!chaincodeName) {
|
||||||
res.json(getErrorMessage('\'chaincodeName\''));
|
res.json(getErrorMessage('\'chaincodeName\''));
|
||||||
|
|
@ -235,15 +235,15 @@ app.post('/channels/:channelName/chaincodes', function(req, res) {
|
||||||
res.json(getErrorMessage('\'channelName\''));
|
res.json(getErrorMessage('\'channelName\''));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!functionName) {
|
if (!fcn) {
|
||||||
res.json(getErrorMessage('\'functionName\''));
|
res.json(getErrorMessage('\'fcn\''));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!args) {
|
if (!args) {
|
||||||
res.json(getErrorMessage('\'args\''));
|
res.json(getErrorMessage('\'args\''));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
instantiate.instantiateChaincode(channelName, chaincodeName, chaincodeVersion, functionName, args, req.username, req.orgname)
|
instantiate.instantiateChaincode(channelName, chaincodeName, chaincodeVersion, fcn, args, req.username, req.orgname)
|
||||||
.then(function(message) {
|
.then(function(message) {
|
||||||
res.send(message);
|
res.send(message);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ curl -s -X POST \
|
||||||
-d '{
|
-d '{
|
||||||
"chaincodeName":"mycc",
|
"chaincodeName":"mycc",
|
||||||
"chaincodeVersion":"v0",
|
"chaincodeVersion":"v0",
|
||||||
"functionName":"init",
|
"fcn":"init",
|
||||||
"args":["a","100","b","200"]
|
"args":["a","100","b","200"]
|
||||||
}'
|
}'
|
||||||
echo
|
echo
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue