You can call this operation to install the chaincode.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | InstallFabricChaincode |
The operation that you want to perform. Set the value to InstallFabricChaincode. |
ChaincodeId | String | Yes | chan-channelx-1l1hmckuuisxo |
The ID of the chaincode. |
OrganizationId | String | Yes | peers-aaaaaa2-1eqnj5o5w9dt3 |
The ID of the organization. |
Location | String | No | cn-hangzhou |
The location. |
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 | cc-198jejf8f8chi8 |
The ID of the chaincode. |
ChaincodeName | String | mychannel |
The name of the chaincode. |
ChaincodeVersion | String | 1.0 |
The version of the chaincode. |
ChannelName | String | mychannel |
The name of the channel. |
ConsortiumId | String | consortium-lianmenyumingyi-hc5d1bwlulg7 |
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 ("perf9141MSP.member") |
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 | github.com/hyperledger/fabric-samples/chaincode/sacc |
The path of the chaincode. |
ProviderId | String | providerid |
The ID of the user who uploaded the chaincode. |
ProviderName | String | prividername |
The user who uploaded the chaincode. |
State | String | Pending |
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=InstallFabricChaincode
&ChaincodeId=chan-channelx-1l1hmckuuisxo
&OrganizationId=peers-aaaaaa2-1eqnj5o5w9dt3
&<Common request parameters>
Successful response examples
XML
format
<InstallFabricChaincodeResponse>
<Result>
<install>false</install>
<channelName>mychannel</channelName>
<input>args:&quot;john&quot; args:&quot;10&quot; </input>
<ChaincodeName>mycc3</ChaincodeName>
<Path>github.com/hyperledger/fabric-samples/chaincode/sacc</Path>
<state>Running</state>
<chaincodeId>cc-198jejf8f8chi8</chaincodeId>
<type>1</type>
<ChaincodeVersion>0.1</ChaincodeVersion>
<ConsortiumId>consortium-lianmenyumingyi-hc5d1bwlulg7</ConsortiumId>
<CreateTime>1533025590</CreateTime>
<EndorsePolicy>OR (perf9141MSP.member)</EndorsePolicy>
<Message>OK</Message>
</Result>
<RequestId>7D27692E-C501-4B1D-878C-0B869DD3D9E6</RequestId>
<Success>true</Success>
<ErrorCode>200</ErrorCode>
</InstallFabricChaincodeResponse>
JSON
format
{
"Result":{
"install":false,
"channelName":"mychannel",
"ConsortiumId":"consortium-lianmenyumingyi-hc5d1bwlulg7",
"Message":"OK",
"state":"Running",
"chaincodeId":"cc-198jejf8f8chi8",
"type":1,
"EndorsePolicy":"OR (perf9141MSP.member)",
"Path":"github.com/hyperledger/fabric-samples/chaincode/sacc",
"ChaincodeVersion":"0.1",
"input":"args:"john" args:"10" ",
"ChaincodeName":"mycc3",
"CreateTime":"1533025590"
},
"RequestId":"7D27692E-C501-4B1D-878C-0B869DD3D9E6",
"ErrorCode":200,
"Success":true
}
Error codes
For more information about error codes, see Error codes.