You can call this operation to query the statuses of the chaincode, including the upgrade status and the instantiation status.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | SynchronizeFabricChaincode | The operation that you want to perform. Set the value to SynchronizeFabricChaincode. |
ChaincodeId | String | Yes | code-sacc-1pr09q7jm**** | The ID of the chaincode. |
OrganizationId | String | Yes | Peers-aaaaaa2-1eqnj5o5w **** | The ID of the organization. |
Response parameters
Parameter | Type | Example | Description |
ErrorCode | Integer | 200 | The error code. |
RequestId | String | 1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3 | The ID of the API request. |
Result | The result of the operation. | ||
ChaincodeId | String | code-sacc-1pr09q7jm**** | The ID of the chaincode. |
ChaincodeName | String | mychaincode | The name of the chaincode. |
ChaincodeVersion | String | 1.0 | The version of the chaincode. |
ChannelName | String | chan-channelx-1l1hmckuuisxo | The name of the channel. |
ConsortiumId | String | consortium-lianmenyumingyi-hc5d1bwl**** | The ID of the consortium. |
CreateTime | String | 1533025590 | The time when the organization was created. |
DeployTime | String | 1533025590 | The time when the chaincode was deployed. |
EndorsePolicy | String | OR ('aaaaaa1MSP.peer') | The endorsement policy. |
Input | String | input | The input property of the chaincode. |
Install | Boolean | false | Indicates whether the chaincode is installed. A value of true indicates that the chaincode is installed. A value of false indicates that the chaincode is not installed. |
Message | String | ok | The message. |
Path | String | go-sdk-demo/chaincode/src | The path. |
ProviderId | String | provider | The ID of the user who uploaded the chaincode. |
ProviderName | String | name | The user who uploaded the chaincode. |
State | String | Running | The status. |
Type | Integer | 1 | The type of the chaincode. |
Success | Boolean | true | Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=SynchronizeFabricChaincode
&OrganizationId=peers-aaaaaa2-1eqnj5o5w****
&ChaincodeId=code-sacc-1pr09q7jm****
&<Common request parameters>Successful response examples
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<SynchronizeFabricChaincodeResponse>
<RequestId>1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3</RequestId>
<Success>true</Success>
<ErrorCode>200</ErrorCode>
<Result>
<Type>1</Type>
<EndorsePolicy>OR ('aaaaaa1MSP.peer')</EndorsePolicy>
<State>Running</State>
<CreateTime>1533025590</CreateTime>
<ChaincodeId>code-sacc-1pr09q7jm****</ChaincodeId>
<ProviderName>name</ProviderName>
<Message>ok</Message>
<ChaincodeName>mychaincode</ChaincodeName>
<Input>input</Input>
<Install>false</Install>
<ProviderId>provider</ProviderId>
<DeployTime>1533025590</DeployTime>
<ChaincodeVersion>1.0</ChaincodeVersion>
<ConsortiumId>consortium-lianmenyumingyi-hc5d1bwl****</ConsortiumId>
<ChannelName>chan-channelx-1l1hmckuuisxo</ChannelName>
<Path>go-sdk-demo/chaincode/src</Path>
</Result>
</SynchronizeFabricChaincodeResponse>JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3",
"Success" : true,
"ErrorCode" : 200,
"Result" : {
"Type" : 1,
"EndorsePolicy" : "OR ('aaaaaa1MSP.peer')",
"State" : "Running",
"CreateTime" : "1533025590",
"ChaincodeId" : "code-sacc-1pr09q7jm****",
"ProviderName" : "name",
"Message" : "ok",
"ChaincodeName" : "mychaincode",
"Input" : "input",
"Install" : false,
"ProviderId" : "provider",
"DeployTime" : "1533025590",
"ChaincodeVersion" : "1.0",
"ConsortiumId" : "consortium-lianmenyumingyi-hc5d1bwl****",
"ChannelName" : "chan-channelx-1l1hmckuuisxo",
"Path" : "go-sdk-demo/chaincode/src"
}
}Error codes
For more information about error codes, see Error codes.