GalaChain / GalaChain/sdk

Use batch writes from Fabric 3.1

Open
#645 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
138
Forks
44
Avg merge
1d 16h
Merged PRs (30d)
22

Description

In the method `.flushWrites()` which is called at the end of the transaction use batch writes which are supported from Fabric `3.1`. They can be used for other versions, it just has no effect. As documented in the Fabric source code in `interfaces.go`:

```go
// StartWriteBatch enables a mode where all changes are not immediately forwarded to the peer,
// but accumulate in the cache. The cache is sent in large batches either at the end of transaction
// execution or after the FinishWriteBatch call.
// IMPORTANT: in this mode, the expected order of transaction execution and expected errors can be changed.
//
// If write batching is not supported by the peer, this method has no effect
// and writes to the ledger continue to be processed immediately.
StartWriteBatch()

// FinishWriteBatch sends accumulated changes in large batches to the peer
// if StartWriteBatch has been called before it.
//
// If write batching is not supported by the peer or no write batch has been
// started, this method has no effect and returns nil.
FinishWriteBatch() error
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.