功能介绍
5.2.2 政务接口
5.2.2.4 联盟链管理
5.2.2.4.5 创建联盟
"description" : "This is my chain", "id" : "1",
"name" : "MyChain",
"orgIDs" : [ "WeiBanJuA", "WeiBanJuB", "WeiBanJuC" ], "unionID" : "111"
} ],
"creatorOrgID" : "WeiBanJuA",
"description" : "busichain based on ugbaas", "oemType" : "HW",
"orgs" : [ "WeiBanJuA", "WeiBanJuB", "WeiBanJuC" ], "status" : "Normal",
"unionID" : "xxx-xx-xxx", "unionName" : "MyUnion"
} ]
状态码
状态码 描述
200 QueryUnionsResponse is QueryUnionsResponse 400 ErrResponse is general error response
错误码
POST /v1/ugbaas/unions
开发指南 5 区块链中间件接口
请求参数
表5-221 请求 Body 参数
参数 是否必选 参数类型 描述
UID 否 String 联盟链UID
busiChains 是 Array of BusiChainCre ation objects
BusiChain列表
creatorOrgID 是 String 联盟发起者已注册的组织ID
description 否 String 描述
invitation 否 Invitation
object Invitation is invitation struct
oemType 是 String 平台厂商类型,分为华为
(HW)
orgs 否 Array of
strings 联盟包含组织列表
unionID 否 String 联盟链ID
unionName 是 String 联盟名称
表5-222 BusiChainCreation
参数 是否必选 参数类型 描述
chainSpecs 否 Array of ChainSpec objects
联盟链规格,其中包含资源规格 和区块链规格, 如果不提供则使 用默认值
description 否 String 描述
id 否 String 业务链ID
name 是 String 业务链名称
orgIDs 是 Array of
strings 业务链中包含的已注册的orgID 列表
unionID 否 String 联盟ID
开发指南 5 区块链中间件接口
表5-223 ChainSpec
参数 是否必选 参数类型 描述
blockSpec 否 Array of BlockSpec objects
区块链节点规格。区块链规格元 素数量与orgIDList中orgID对 应。
infraSpec 否 InfraSpec
object InfraSpec is infrastructure struct
orgIDList 是 Array of
strings 此资源中包含已注册的orgID列 表,如果InfraSpec中没有指定 OrgID, 则此列表中第一个orgID 为资源提供者
表5-224 BlockSpec
参数 是否必选 参数类型 描述
OrderNum 否 Long Order数量,取值范围为[4, 10]
PeerNum 否 Long Peer背书节点数量,取值范围为
[1, 5]
signAlgorithm 否 String 安全机制,可选:ECDSA
(ECDSA),国密算法
(sm2), 默认为sm2
表5-225 InfraSpec
参数 是否必选 参数类型 描述
空闲资源,true/false, 默认为 false(暂未实现)
az 否 String available zone,可选参数,已知
flavor时使用
clusterID 否 String 已经存在CCE集群ID,可选参数,
已知可用集群时使用
clusterName 否 String 已经存在CCE集群名称,可选参 数,已知可用集群时使用
开发指南 5 区块链中间件接口
参数 是否必选 参数类型 描述 clusterPlatfor
mType 否 String 集群CPU架构类型,X86
(VirtualMachine),ARM
(ARM64),可选参数,默认为 X86
flavor 否 String flavor,可选参数,已知flavor时 使用
initNodePwd 否 String 节点初始密码,加盐加密,可详 细参考https://
support.huaweicloud.com/
bestpractice-cce/
cce_bestpractice_0058.html
orgID 是 String 提供资源的已注册的组织ID
表5-226 Invitation
参数 是否必选 参数类型 描述
adminList 否 Array of
strings 管理员列表,可以为空,使用默 认管理员
响应参数
状态码: 200
表5-227 响应 Body 参数
参数 参数类型 描述
busiChainList Array of BusiChainBas e objects
业务链列表
txID Long 事务ID
unionID String 联盟ID
表5-228 BusiChainBase
参数 参数类型 描述
description String 描述
id String 业务链ID
name String 业务链名称
开发指南 5 区块链中间件接口
参数 参数类型 描述 orgIDs Array of
strings 业务链中包含的已注册的orgID列表 unionID String 联盟ID
状态码: 400
表5-229 响应 Body 参数
参数 参数类型 描述
error_code String 错误代码 error_messag
e String 错误信息
请求示例
{ "UID" : "xxx-xx-xxx", "busiChains" : [ {
"anyExistingClusterIfNotMatch" : "cn-north-7c", "az" : "cn-north-7c",
"clusterID" : "831f84cb-8789-11ea-95d0-0255ac100b0d", "clusterName" : "master01",
"clusterPlatformType" : "ARM64",
"flavor" : "831f84cb-8789-11ea-95d0-0255ac100b0d", "initNodePwd" :
"JDYkUzdOOUR0JEdyajFQV0tSWXNQRjZBZlhiSE5MVmpWV204V3M5alFMUXl4Z3dtOVNKb25xR0lIZWZaNUF ReDVWeHNJa3gvb3JML2d1WjZyazNLQmNWczBpWVVFR2gw",
"orgID" : "WeiBanJuA"
},
"orgIDList" : [ "WeiBanJuA", "WeiBanJuB", "WeiBanJuC" ] } ],
"description" : "This is my chain", "id" : "1",
"name" : "MyChain",
"orgIDs" : [ "WeiBanJuA", "WeiBanJuB", "WeiBanJuC" ], "unionID" : "111"
状态码
状态码 描述
200 CreateUnionResponse is create union response 400 ErrResponse is general error response
错误码
请参见错误码。