You can call this operation to create a channel.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | CreateFabricChannel | The operation that you want to perform. Set the value to CreateFabricChannel. |
ChannelName | String | Yes | channelx | The name of the channel. It must be 1 to 50 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). |
ConsortiumId | String | Yes | consortium-aaaaaa-akpcsjjac2jd | The ID of the consortium. |
BatchTimeout | Integer | No | 2 | The amount of time to wait after the first transaction arrives for additional transactions before cutting a block. |
MaxMessageCount | Integer | No | 50 | The maximum number of transactions that are permitted in a block. |
Organization.N.Id | String | No | peers-aaaaaa1-1oxw31d046jtl | The ID list of organizations that have joined the channel. Enter: |
PreferredMaxBytes | Integer | No | 12 | The preferred maximum number of bytes allowed for. |
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. | ||
BatchTimeout | Integer | 2 | The amount of time to wait after the first transaction arrives for additional transactions before cutting a block. |
BlockCount | Integer | 2 | The number of blocks. |
ChaincodeCount | Integer | 2 | The number of chaincodes. |
ChannelId | String | chan-channelx-1l1hmckuuisxo | The ID of the channel. |
ChannelName | String | channelx | The name of the channel. |
ConsortiumId | String | consortium-aaaaaa-akpcsjjac2jd | The ID of the consortium. |
ConsortiumName | String | aaaaaa | The name of the consortium. |
CreateTime | String | 1544768139624 | The time when the channel was created. |
MaxMessageCount | Integer | 50 | The maximum number of transactions that are permitted in a block. |
MemberCount | Integer | 1 | The number of members. |
OwnerBid | String | 26842 | The business ID of the creator. |
OwnerName | String | uid- | The user who created the organization. |
OwnerUid | Integer | 1234 | The user ID of the creator. |
PreferredMaxBytes | Integer | 12 | The preferred maximum number of bytes allowed for. |
RequestId | String | 1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3 | The ID of the API request. |
State | String | Running | The status. |
SupportConfig | Boolean | true | Indicates whether custom parameters are supported. |
UpdateTime | String | 1544768139624 | The time when the channel was last updated. |
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=CreateFabricChannel
&ConsortiumId=consortium-aaaaaa-akpcsjjac2jd
&ChannelName=channelx
&BatchTimeout=2
&MaxMessageCount=50
&PreferredMaxBytes=12
&Organization=[{"Id":"peers-aaaaaa1-1oxw31d046jtl"}]
&<Common request parameters>
Successful response examples
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateFabricChannelResponse>
<RequestId>1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3</RequestId>
<Success>true</Success>
<ErrorCode>200</ErrorCode>
<Result>
<BatchTimeout>2</BatchTimeout>
<UpdateTime>1544768139624</UpdateTime>
<ChaincodeCount>2</ChaincodeCount>
<PreferredMaxBytes>12</PreferredMaxBytes>
<State>Running</State>
<CreateTime>1544768139624</CreateTime>
<OwnerName>uid-</OwnerName>
<OwnerUid>1234</OwnerUid>
<OwnerBid>26842</OwnerBid>
<MaxMessageCount>50</MaxMessageCount>
<MemberCount>1</MemberCount>
<RequestId>1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3</RequestId>
<ConsortiumId>consortium-aaaaaa-akpcsjjac2jd</ConsortiumId>
<ChannelName>channelx</ChannelName>
<SupportConfig>true</SupportConfig>
<ChannelId>chan-channelx-1l1hmckuuisxo</ChannelId>
<ConsortiumName>aaaaaa</ConsortiumName>
<BlockCount>2</BlockCount>
</Result>
</CreateFabricChannelResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3",
"Success" : true,
"ErrorCode" : 200,
"Result" : {
"BatchTimeout" : 2,
"UpdateTime" : "1544768139624",
"ChaincodeCount" : 2,
"PreferredMaxBytes" : 12,
"State" : "Running",
"CreateTime" : "1544768139624",
"OwnerName" : "uid-",
"OwnerUid" : 1234,
"OwnerBid" : "26842",
"MaxMessageCount" : 50,
"MemberCount" : 1,
"RequestId" : "1890FA4F-067A-4CE9-AC9B-2BD2E58FB5D3",
"ConsortiumId" : "consortium-aaaaaa-akpcsjjac2jd",
"ChannelName" : "channelx",
"SupportConfig" : true,
"ChannelId" : "chan-channelx-1l1hmckuuisxo",
"ConsortiumName" : "aaaaaa",
"BlockCount" : 2
}
}
Error codes
For more information about error codes, see Error codes.