Passing an array as argument to chaincode via Node.js SDK #fabric-questions #fabric-chaincode


@secure12
 

In the chaincode (in Golang) I have the following function:
func (s *SmartContract) f(ctx contractapi.TransactionContextInterface, arr []string) error { /* function details */ }
When I attempt to call this function via the Node.js SDK,
contract.submitTransaction('f', my_array);
where my_array equals ["v1", "v2"]. I get the following error
message=Error managing parameter param0. Conversion error. Value v1,v2 was not passed in expected format []string
What should be the right way to invoke the chaincode function via the SDK?

Join fabric@lists.hyperledger.org to automatically receive all group messages.