如何在Hyperledger Fabric 1.4.4中设置每个区块的交易数



我有一个HLF启动并运行,一切正常。事情是每10分钟,我将发送最多21个数据。

在没有配置的情况下,每十分钟,我有4个区块分别由6,6,5,4个事务创建。

我想在可能的情况下将块大小配置为21,因此我将有1块/时间步骤

我看到这可以在configtx.yaml中配置:

# Batch Timeout: The amount of time to wait before creating a batch
BatchTimeout: 2s
# Batch Size: Controls the number of messages batched into a block
BatchSize:
# Max Message Count: The maximum number of messages to permit in a batch
MaxMessageCount: 100
# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch.
AbsoluteMaxBytes: 98 MB
# Preferred Max Bytes: The preferred maximum number of bytes allowed for
# the serialized messages in a batch. A message larger than the preferred
# max bytes will result in a batch larger than preferred max bytes.
PreferredMaxBytes: 512 KB

但是我看到这里MaxMessageCount是100,它应该是OK的

你知道吗?

需要更新BatchTimeout. BatchTimeout是在第一个事务到达后,在切割块之前等待其他事务的时间量。降低这个值可以改善延迟,但是降低太多可能会因为不允许块填充到最大容量而降低吞吐量。

所以你需要以这样一种方式设置BatchTimeout,即在超时发生之前所有事务都落在同一个块中。

也检查PreferredMaxBytes

最新更新