0

Visual Studio Code: 1.60.2 MacOS: 20.6.0 IBM Blockchain extension:2.0.3 I successfully installed and deployed the chaincode in golang for the asset-transfer-private-data example in Hyperledger Fabric 2.3.2 in VS code using the IBM blockchain extension. I started the mini fab Test Network that comes with the extension. The chaincode was installed and deployed successfully to this network. But when I try to invoke the CreateAsset function in the chaincode I get the following error:

Error evaluating transaction: Query failed. Errors: ["Peer org1peer-api.127-0-0-1.nip.io:8081: failed to unmarshal JSON: invalid character '\x00' looking for beginning of value","Peer org2peer-api.127-0-0-1.nip.io:8081: failed to unmarshal JSON: invalid character '\x00' looking for beginning of value"]

Below is the JSON that I use for the Transient Data:

{
   "asset_properties":[
      {
         "objectType":"asset",
         "assetID":"asset1",
         "color":"green",
         "size":20,
         "appraisedValue":100
      }
   ]
}

Any help will be much appreciated.

Jugma
  • 21
  • 1
  • 6

1 Answers1

0

I think the problem is that you have an array in your transient data. I think you need to do something like

{
   "asset_properties": {
         "objectType":"asset",
         "assetID":"asset1",
         "color":"green",
         "size":20,
         "appraisedValue":100
      }
}
Caroline Church
  • 203
  • 2
  • 8