fabric sdk简介

SourceURL:file:///media/john/disk-500G/备份/桌面/监控技术预研结果.doc

https://hyperledger.github.io/fabric-sdk-node/

 

 

 

 

 

https://github.com/hyperledger/fabric-sdk-node

 

 

 

 

 

The Hyperledger Fabric Client SDK makes it possible to use APIs to interact with a Hyperledger Fabric blockchain. This readme is directed towards a current or future contributor to this project, and gives an overview of setting up the project locally and running tests. For more information on the SDK, including features and an API reference, please visit the SDK documentation.

This project publishes the following npm packages:

fabric-ca-client - client for the optional component in Hyperledger Fabric, fabric-ca. The fabric-ca component allows applications to enroll Peers and application users to establish trusted identities on the blockchain network. It also provides support for pseudonymous transaction submissions with Transaction Certificates. If the target blockchain network is configured with standard Certificate Authorities for trust anchors, the application does not need to use this package. 

fabric-common - encapsulates the common code used by all fabric-sdk-node packages supporting fine grain interactions with the Fabric network to send transaction invocations

fabric-network - This package encapsulates the APIs to connect to a Fabric network, submit transactions and perform queries against the ledger at a higher level of abstraction than through the fabric-common.

fabric-protos - This package encapsulates the protobuffers that are used to communicate over gRPC

 

 

 

SourceURL:file:///media/john/disk-500G/备份/桌面/监控技术预研结果.doc

一、监控SDK测试

 

 

应用程序通过sdk和区块链网络进行交互,需要连接的节点包括排序节点、对等节点。

 

 

 

(一)SDK组成

名称

作用

备注

fabric-ca-client

CA模块的客户端

 

fabric-common  

通用代码封装,工具模块

 

fabric-network  

网络连接,提交交易,执行查询比fabric-common提供的更高级

 

fabric-protos

封装gRPC协议

 

 

参考文章:

https://www.jianshu.com/p/1224f504bf9e?appinstall=0

 

SDK接口,使用SDK完成对区块链网络运行概况的监控,需要用到系统链码,系统链码包如下五大类型。

系统链码名称

功能

备注

cscc

配置管理

账本和链

GetChannels

escc

背书签名过程

 

lscc

链码生命周期管理

GetChaincodes  链码

 

qscc

账本和链码的信息查询

GetBlockByNumber  区块

GetChainInfo      链信息

 

vscc

验证系统链码

 

 

(二)SDK接口测试

Sdk使用前需要准备以下材料:

(1) 连接配置文件

(2) 身份信息(证书,私钥)

 

注意事项:

调用时配置参数,自动发现为真,作为本地主机为假。

 

 

2.2版本的SDK去掉了queryInfo接口

 

posted @ 2022-12-02 21:43  jiftle  阅读(150)  评论(0编辑  收藏  举报