调用UpgradeFabricChaincode升级链码。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | UpgradeFabricChaincode |
系统规定参数。取值:UpgradeFabricChaincode。 |
RegionId | String | 否 | cn-hangzhou |
地域 |
OrganizationId | String | 是 | peers-wholesaler-15ix77tof**** |
组织ID |
ChaincodeId | String | 是 | code-sacc-fk9z4r97**** |
链码ID |
EndorsePolicy | String | 否 | OR ("wholesalerMSP.peer") |
背书策略 |
Location | String | 否 | cn-hangzhou |
位置 |
CollectionConfig | String | 否 | [{"requiredPeerCount":0,"name":"collectionName","maxPeerCount":3,"blockToLive":0,"policy":"OR('Org1MSP.peer')"}] |
隐私数据集配置:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | A6CC6C63-2D71-4D0C-AEBE-E95F0127C514 |
请求ID |
Success | Boolean | true |
是否成功 |
ErrorCode | Integer | 200 |
错误码 |
Result | Object |
结果 |
|
Type | Integer | 1 |
类型 |
EndorsePolicy | String | OR ("wholesalerMSP.peer") |
背书策略 |
State | String | Running |
状态 |
CreateTime | String | 1545215617000 |
创建时间 |
ChaincodeId | String | code-sacc-fk9z4r97**** |
链码ID |
ProviderName | String | uid-1928592 |
上传者 |
Message | String | OK |
消息 |
ChaincodeName | String | mychaincode |
链码名 |
Input | String | input |
输入 |
Install | Boolean | false |
是否安装 |
ProviderId | String | 1928592 |
上传者ID |
DeployTime | String | 1545215617000 |
部署时间 |
ChaincodeVersion | String | 1.0 |
链码版本 |
ConsortiumId | String | consortium-supplychain-1pxzsp5tb**** |
联盟ID |
ChannelName | String | cc |
通道名 |
Path | String | github.com/sacc |
路径 |
示例
请求示例
http(s)://[Endpoint]/?Action=UpgradeFabricChaincode
&ChaincodeId=code-sacc-fk9z4r97****
&OrganizationId=peers-wholesaler-15ix77tof****
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<UpgradeFabricChaincodeResponse>
<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>
</UpgradeFabricChaincodeResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"Result" : {
"ProviderId" : "provider",
"ProviderName" : "name",
"ChaincodeName" : "mycc3",
"Input" : "args:"john" args:"10" ",
"Install" : false,
"State" : "Running",
"Type" : 1,
"ChannelName" : "mychannel",
"ConsortiumId" : "consortium-lianmenyumingyi-hc5d1bwl****",
"ChaincodeVersion" : "0.1",
"ChaincodeId" : "cc-null-c856k9i1m****",
"Path" : "github.com/hyperledger/fabric-samples/chaincode/sacc"
},
"RequestId" : "2A3ABD81-95F5-4931-ACB3-31BDAE561FC7",
"Success" : true,
"ErrorCode" : 200
}