I am able to call the chaincode functionality by peer chaincode invoke as:
`peer chaincode invoke -o localhost:7050 -C mychannel -n pmc -c '{"function":"initLedger","Args":["one", "two"]}`
But I want to pass javascript object as argument like:
`peer chaincode invoke -o localhost:7050 -C mychannel -n pmc -c '{"function":"initLedger","Args":[ {property1:"one"}, {property2:"two"}]}`
but this fails with invalid character 'p' looking for beginning of object key string. I have tried few other permutations but all without success.
the documentation says about -c as:
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
Can come one tell correct syntax to pass the object.
EDIT 1: For the sake of completeness following
peer chaincode invoke -o localhost:7050 -C mychannel -n pmc -c '{"function":"initLedger","Args": [{"property1":"one", "property2":"two"} ]}'
returns Error: Chaincode argument error: json: cannot unmarshal array into Go struct field strArgs.Args of type string