Code Monkey home page Code Monkey logo

bc-apis's Introduction

bc-apis

Description

Composited APIs for fabric resource APIs.

Installation

This project uses pnpm to manage dependencies, we also recommend installing ni to help switching between repos using different package managers. ni also provides the handy nr command which running npm scripts easier.

$ npm i pnpm @antfu/ni zx -g
$ ni

zx is Google's open source javascript scripting tool, which will be used when generating sdk in our project.

Running the app

# development
$ nr start

# watch mode
$ nr start:dev

# production mode
$ nr start:prod

bc-apis's People

Contributors

dayuy avatar bjwswang avatar carrotzpc avatar nkwangleigit avatar

Stargazers

 avatar  avatar

Watchers

moonsky avatar  avatar

Forkers

dayuy

bc-apis's Issues

通道管理-获取通道连接文件接口

通道创建后,会在每个成员组织下创建一个ConfigMap用于存储当前通道连接文件.

1. 查询获取

k get cm -ndayu  chan-explorer3-connection-profile  -ojson  |  jq -r '.binaryData."profile.json"' | base64 --decode 

参数详解:

  • namespace 为 具体成员组织的名称 {org_name}
  • ConfigMap名称为 : chan-{channel_name}-connection-profile

返回结果

ConfigMap中包含两个文件:

  • profile.yaml : YAML格式的连接文件
  • profile.json: JSON格式的连接文件 (区块链浏览器默认使用json格式)

提议管理-提议超时应返回失败信息

创建联盟时,初始成员未操作提议投票,导致提议超时,创建联盟状态一直是“组建中”,应该为“组建失败”
bestchains/fabric-operator#235

在proposal创建的时候,将过期时间记录在联盟的annotations中,格式
bestchains.federation.creation.proposal.endAt=1681713476。获取联盟列表的时候,如果发现这个key存在并且联盟没有正常激活且已经过期,显示过期信息。

导入合约接口

功能描述:
将合约商店的某合约导入到网络中 (相当于新建)

List问题汇总

由于RBAC设计问题,部分CRD的List 权限未开放,需要通过多CRD之间组合查询完成list.

  1. 组织管理
  • 全部组织 : 展示所有组织 List
  • 我创建的 :通过 organization.spec.admin 过滤
  1. 联盟管理
  • 全部联盟 : 1) 获取用户作为admin的组织列表 2) 读取organization.status.federations,获取有权限访问的联盟列表 3)查看具体的联盟信息
  • 我创建的 : 1) 基于上述列表 2) 判断 label bestchains.federation.initiator是否为用户管理的组织
  1. 提议管理
  • 全部提议 : 1)获取用户管理(admin)的组织 2) 获取该组织下的所有votes 3)通过votes查看proposal
  • 我创建的: 1) 基于上述的提议列表 2) 判断proposal.spec.initiatorOrganization是否为当前用户管理的组织
  1. 网络管理
  • 网络列表: 1) 获取用户管理的组织所在的联盟列表 2) 通过federation.status.networks获取所有的网络列表 3) 查看获取具体的网络信息

Labels参考: bestchains/fabric-operator#32

API: 查看合约metadata

方法

通过合约调用可获取合约当前metadata:

  1. contract : org.hyperledger.fabric
  2. method : GetMetadata

metadata 内容

通道管理API开发

  • 新建通道
    • 获取发起者组织的节点列表
  • 通道列表查询和条件过滤
  • 节点加入通道

fix the depository file hash

          > @dayuy how did you get the png hash ?we can only keep the first 20bytes of the hash . Please refer to [kid calculation](https://github.com/bestchains/bestchains-contracts/blob/main/contracts/depository/depository.go#L401)

ok, I will check bc-api code about uploading depository file.

Originally posted by @dayuy in bestchains/bc-cli#50 (comment)

chaincode 必填写字段:externalBuilder

目前需要在创建chaincode的时候验证chaincodebuild的镜像是否存在,但是之前创建的时候,chaincode的 externalBuilder 字段不是必填的,externalBuilder 实际是写到了proposal里,导致chaincode的webhook无法找到chaincodebuild。所以,这里变成必填字段。
proposal的变化,spec.deployChaincodeexternalBuilder可以不写,spec.UpgradeChaincodeexternalBuilder必须填写。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.