hyperledger / hyperledger/fabric-chaincode-node

Read/write batching

オープン
#453 コメント 10 件 リアクション 0 件 担当者 1 名 @JhaSourav07 が担当を希望しています GitHub で見る
enhancement help wanted
主要言語
JavaScript
スター
262
フォーク
149
平均マージ
8時間 32分
マージ済み PR(30日)
2

説明

Fabric [v3.1.0](https://github.com/hyperledger/fabric/releases/tag/v3.1.0) introduced a new performance optimization that allows ledger reads and writes to be performed in batches. This feature is described in the [Peer to Chaincode Communication Optimization RFC](https://github.com/hyperledger/fabric-rfcs/blob/main/text/0011-peer-chaincode-optimization.md).

[fabric-chaincode-go](https://github.com/hyperledger/fabric-chaincode-go) provides a reference implementation of this functionality, which should be replicated by the Node chaincode libraries.

Implementation is composed of these component parts:

- [Configuration of batching based on peer capabilities when a connection is established](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/handler.go#L807-L819)
- Modifications to [PutState](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/stub.go#L203-L221) (and [PutPrivateData](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/stub.go#L288-L295)) API functions
- An accompanying [WriteBatch](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/batch.go) implementation to collect batched writes.
- Modification of [handleInit](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/handler.go#L200-L202) and [handleTransaction](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/handler.go#L230-L232) to ensure that batched writes are sent at the end of a client invocation
- New Stub API functions:
- [StartWriteBatch](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/stub.go#L652-L657)
- [FinishWriteBatch](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/stub.go#L659-L664)
- [GetMultipleStates](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/stub.go#L169-L174)
- [GetMultiplePrivateData](https://github.com/hyperledger/fabric-chaincode-go/blob/9e139c0c2edd362fbfe24261de66fff60eccc6d0/shim/stub.go#L272-L278)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。