HyperLedger-Fabric: "Error unmarshalling chaincode request payload: illegal base64 data at input byte 0"

+1 vote

I try to deploy chaincode, it always throws back the error in the JSON input as shown below.

peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'


sug@sri-ub:~/go/$ docker exec -it aa413f4c4289 bash
root@aa413f4c4289:/opt/gopath/src/github.com/hyperledger/fabric# peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}'

04:30:55.822 [logging] LoggingInit -> DEBU 001 Setting default logging level to DEBUG for command 'chaincode' Error: Non-empty JSON chaincode parameters must contain exactly 1 key: 'Args'

Please help

Oct 30, 2018 in Blockchain by slayer
• 29,040 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The function name should be in Args and all parameters should be base64 encoded.
Instead of:

{"function":"init","args":["a", "1000", "b", "2000"]}}

The arguments for deploy command will look like:

{"args":['aW5pdA==', 'YQ==', 'MTAwMA==', 'Yg==', 'MjAwMA==']}

answered Oct 30, 2018 by Sumanth

Related Questions In Blockchain

+1 vote
2 answers

Where is custom chaincode path Hyperledger Fabric 1.0?

You have to have your chaincode at ...READ MORE

answered Jul 10, 2018 in Blockchain by slayer
• 29,040 points
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer
+16 votes
4 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.