Skip to content

How to use "args" as JSON instead of array of strings (i.e. [] string ) #120

@mna2016

Description

@mna2016

Hi All,
I am trying to modify the chaincode vehicles.go in order to have "args" parameter of an incoming invoke statement as a JSON instead of array of string. I want the request to look like below:

{ 
	"jsonrpc": "2.0", 
	"method": "invoke", 
	"params": 
		{ 	"type": 1, 
			"chaincodeID": 
	        { "name": "fe4ffc3aff02c2dda7a61f18d934c84474edecd4fe1ade6c5181f541afd936bff01bc6b3066f349b5caed6aa0f1a74e31d47ee82929d3157194f441afa171ff2" }, 
			"ctorMsg": 
						{ 
							"function": "update_xxx", 
							"args": {"make":"HONDA", "vin":"MOD123", "color":"RED", "owner":"DVLA"} 
						}, 
	"secureContext": "WebAppAdmin" 
		}, 
"id":1234 
}
  1. How to update the vehicles.go in order to achieve this?
  2. Is there any other place where I need to make change in order to accept this new invoke API call structure?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions