Skip to content

Commit

Permalink
[FAB-5287] NodeSDK - fix sample
Browse files Browse the repository at this point in the history
Sample should use 'fcn' not 'functionName'
in the sample curl calls and sample app.

Change-Id: I4be92a0394fdf579195e9566d049aac0862d5888
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
  • Loading branch information
harrisob committed Jul 13, 2017
1 parent ca8fad3 commit e0db341
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion balance-transfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ curl -s -X POST \
"peers": ["localhost:7051"],
"chaincodeName":"mycc",
"chaincodeVersion":"v0",
"functionName":"init",
"fcn":"init",
"args":["a","100","b","200"]
}'
```
Expand Down
10 changes: 5 additions & 5 deletions balance-transfer/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ app.post('/channels/:channelName/chaincodes', function(req, res) {
var chaincodeName = req.body.chaincodeName;
var chaincodeVersion = req.body.chaincodeVersion;
var channelName = req.params.channelName;
var functionName = req.body.functionName;
var fcn = req.body.fcn;
var args = req.body.args;
logger.debug('channelName : ' + channelName);
logger.debug('chaincodeName : ' + chaincodeName);
logger.debug('chaincodeVersion : ' + chaincodeVersion);
logger.debug('functionName : ' + functionName);
logger.debug('fcn : ' + fcn);
logger.debug('args : ' + args);
if (!chaincodeName) {
res.json(getErrorMessage('\'chaincodeName\''));
Expand All @@ -235,15 +235,15 @@ app.post('/channels/:channelName/chaincodes', function(req, res) {
res.json(getErrorMessage('\'channelName\''));
return;
}
if (!functionName) {
res.json(getErrorMessage('\'functionName\''));
if (!fcn) {
res.json(getErrorMessage('\'fcn\''));
return;
}
if (!args) {
res.json(getErrorMessage('\'args\''));
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) {
res.send(message);
});
Expand Down
2 changes: 1 addition & 1 deletion balance-transfer/testAPIs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ curl -s -X POST \
-d '{
"chaincodeName":"mycc",
"chaincodeVersion":"v0",
"functionName":"init",
"fcn":"init",
"args":["a","100","b","200"]
}'
echo
Expand Down

0 comments on commit e0db341

Please sign in to comment.