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接口