Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通道管理API开发 #14

Closed
4 tasks
Tracked by #36
bjwswang opened this issue Feb 16, 2023 · 2 comments · Fixed by #37
Closed
4 tasks
Tracked by #36

通道管理API开发 #14

bjwswang opened this issue Feb 16, 2023 · 2 comments · Fixed by #37
Assignees
Labels
enhancement New feature or request high High Priority
Milestone

Comments

@bjwswang
Copy link
Member

bjwswang commented Feb 16, 2023

  • 新建通道
    • 获取发起者组织的节点列表
  • 通道列表查询和条件过滤
  • 节点加入通道
@bjwswang bjwswang added this to the v0.1.1 milestone Feb 16, 2023
@bjwswang bjwswang added the enhancement New feature or request label Feb 16, 2023
@bjwswang
Copy link
Member Author

bjwswang commented Feb 20, 2023

1. 新建通道API

示例:

apiVersion: ibp.com/v1beta1
kind: Channel
metadata:
  name: channel-sample
spec:  
  license:
    accept: true
  network: "network-sample3"
  members:
    - name: org1
    - name: org2
  peers:
    - name: org1peer1
      namespace: org1
  description: "channel with org1 & org2"

参数详解:

  • network: 用户管理的组织所在的网络 (required)
  • members: 通道的成员列表(不区分initiator) (required)
    • 至少有一个用户管理的组织 (required)
    • 其他的成员组织 (optional)
  • peers: 创建通道时,加入此通道的节点列表 (optional)
    • 必须是用户管理的组织(在members中)下的节点
  • description : 当前通道的描述信息 (optional)

1.1 获取组织下的节点列表

kubectl get ibppeers -n {org_name}

2. 通道列表查询和过滤

NOTE: 网络列表查询基础上

2.1 列表查询

kubectl get networks {network_name}  -ojson | jq '.status.channels' 

3. 节点加入通道

Note: 通道已经创建的基础上

3.1 获取 当前用户在通道中的组织未加入此通道 的节点列表

  1. 获取节点列表
kubectl get ibppeers -n {currorg_name}
  1. 过滤出 channel.spec.peers 中的已经有的节点

3.2 将新选择的节点 patchchannel.spec.peers

@dayuy
Copy link
Contributor

dayuy commented Mar 1, 2023

补充API:

  1. 通道详情:getChannel($name: String!)
  2. 删除网络: deleteNetwork($name: String!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants