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. |
RegionId | String | No | cn-hangzhou |
The ID of the region. |
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
&ChaincodeId=code-sacc-1pr09q7jm****
&OrganizationId=peers-aaaaaa2-1eqnj5o5w****
&<Common request parameters>
Successful response examples
XML
format
<SynchronizeFabricChaincodeResponse>
<Result>
<ProviderId>provider</ProviderId>
<ProviderName>name</ProviderName>
<ChaincodeName>mycc3</ChaincodeName>
<Input>args:&quot;john&quot; args:&quot;10&quot; </Input>
<Install>false</Install>
<State>Running</State>
<Type>1</Type>
<ChannelName>mychannel</ChannelName>
<ConsortiumId>consortium-lianmenyumingyi-hc5d1bwl****</ConsortiumId>
<ChaincodeVersion>0.1</ChaincodeVersion>
<ChaincodeId>cc-null-c856k9i1m****</ChaincodeId>
<Path>github.com/hyperledger/fabric-samples/chaincode/sacc</Path>
</Result>
<RequestId>2A3ABD81-95F5-4931-ACB3-31BDAE561FC7</RequestId>
<Success>true</Success>
<ErrorCode>200</ErrorCode>
</SynchronizeFabricChaincodeResponse>
JSON
format
{
"Result":{
"ChaincodeVersion":"0.1",
"Input":"args:"john" args:"10" ",
"ConsortiumId":"consortium-lianmenyumingyi-hc5d1bwl****",
"State":"Running",
"Install":false,
"ChaincodeName":"mycc3",
"Type":1,
"ProviderName":"name",
"ProviderId":"provider",
"ChannelName":"mychannel",
"Path":"github.com/hyperledger/fabric-samples/chaincode/sacc",
"ChaincodeId":"cc-null-c856k9i1m****"
},
"RequestId":"2A3ABD81-95F5-4931-ACB3-31BDAE561FC7",
"ErrorCode":200,
"Success":true
}
Error codes
For more information about error codes, see Error codes.