hyperledger / hyperledger/fabric-chaincode-java

Read/write batching

オープン
#378 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement help wanted
主要言語
Java
スター
323
フォーク
210
平均マージ
8時間 1分
マージ済み PR(30日)
8

説明

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 Java 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 を短くまとめたダイジェスト。