调用InstallFabricChaincode安装链码。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 |
类型 |
是否必选 |
示例值 |
描述 |
Action | String | 是 | InstallFabricChaincode | 系统规定参数。取值:InstallFabricChaincode。 |
OrganizationId | String | 是 | peers-aaaaaa2-1eqnj5o5w9dt3 | 组织ID |
ChaincodeId | String | 是 | chan-channelx-1l1hmckuuisxo | 链码ID |
Location | String | 否 | cn-hangzhou | 位置 |
返回数据
名称 |
类型 |
示例值 |
描述 |
RequestId | String | 1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3 | 请求ID |
Success | Boolean | true | 是否成功 |
ErrorCode | Integer | 200 | 错误码 |
Result | Object | 结果 |
|
Type | Integer | 1 | 类型:
|
EndorsePolicy | String | OR ("perf9141MSP.member") | 背书策略 |
State | String | Pending | 状态 |
CreateTime | String | 1533025590 | 创建时间 |
ChaincodeId | String | cc-198jejf8f8chi8 | 链码ID |
ProviderName | String | prividername | 上传者 |
Message | String | ok | 信息 |
ChaincodeName | String | mychannel | 链码名称 |
Input | String | input | 输入 |
Install | Boolean | false | 是否安装 |
ProviderId | String | providerid | 上传者ID |
DeployTime | String | 1533025590 | 部署时间 |
ChaincodeVersion | String | 1.0 | 链码版本 |
ConsortiumId | String | consortium-lianmenyumingyi-hc5d1bwlulg7 | 联盟ID |
ChannelName | String | mychannel | 通道名 |
Path | String | github.com/hyperledger/fabric-samples/chaincode/sacc | 路径 |
示例
请求示例
http(s)://[Endpoint]/?Action=InstallFabricChaincode
&OrganizationId=peers-aaaaaa2-1eqnj5o5w9dt3
&ChaincodeId=chan-channelx-1l1hmckuuisxo
&Location=cn-hangzhou
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<InstallFabricChaincodeResponse>
<RequestId>1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3</RequestId>
<Success>true</Success>
<ErrorCode>200</ErrorCode>
<Result>
<Type>1</Type>
<EndorsePolicy>OR ("perf9141MSP.member")</EndorsePolicy>
<State>Pending</State>
<CreateTime>1533025590</CreateTime>
<ChaincodeId>cc-198jejf8f8chi8</ChaincodeId>
<ProviderName>prividername</ProviderName>
<Message>ok</Message>
<ChaincodeName>mychannel</ChaincodeName>
<Input>input</Input>
<Install>false</Install>
<ProviderId>providerid</ProviderId>
<DeployTime>1533025590</DeployTime>
<ChaincodeVersion>1.0</ChaincodeVersion>
<ConsortiumId>consortium-lianmenyumingyi-hc5d1bwlulg7</ConsortiumId>
<ChannelName>mychannel</ChannelName>
<Path>github.com/hyperledger/fabric-samples/chaincode/sacc</Path>
</Result>
</InstallFabricChaincodeResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3",
"Success" : true,
"ErrorCode" : 200,
"Result" : {
"Type" : 1,
"EndorsePolicy" : "OR (\"perf9141MSP.member\")",
"State" : "Pending",
"CreateTime" : "1533025590",
"ChaincodeId" : "cc-198jejf8f8chi8",
"ProviderName" : "prividername",
"Message" : "ok",
"ChaincodeName" : "mychannel",
"Input" : "input",
"Install" : false,
"ProviderId" : "providerid",
"DeployTime" : "1533025590",
"ChaincodeVersion" : "1.0",
"ConsortiumId" : "consortium-lianmenyumingyi-hc5d1bwlulg7",
"ChannelName" : "mychannel",
"Path" : "github.com/hyperledger/fabric-samples/chaincode/sacc"
}
}
错误码
访问错误中心查看更多错误码。