For hyperledger fabric, what exactly is in a block? Does it have 1 transaction only? Or 1 or more transactions?
Can’t seems to find the answer from their documentation.
Answer by Phil_Hirsch (272) | Mar 09, 2018 at 08:29 AM
After poking around in the docs, I think the number of blocks per transaction is configurable. See the section on "Ledger and block formation" in this Hyperledger architecture page:
http://hyperledger-fabric.readthedocs.io/en/release/arch-deep-dive.html
This page talks about how to set parameters including this one in a config file when running configtxgen:
http://hyperledger-fabric.readthedocs.io/en/release/configtxgen.html
There's a sample config file here that has comments in its BatchSize stanza talking about how the config parameters work:
https://github.com/hyperledger/fabric/blob/master/sampleconfig/configtx.yaml
The above is for Hyperledger in general. Here's a sample config file specifically for IBM Blockchain running in the IBM Container service:
https://github.com/IBM-Blockchain/ibm-container-service/blob/master/sampleconfig/configtx.yaml
I'm not sure if it is just me, but it seems that these 2 links are not working:
OK, after going through those links and sample, these are my conclusion (correct me if I'm wrong): these are the parameters which decides how many messages is in a block:
BatchTimeout - Block will be created if the time exceeds the timeout and there's at least 1 transaction
MaxMessageCount - Block will be created if the # of messages reach the max
AbsoluteMaxBytes - Block will be created if the size (memory) exceeds the max
So, the correct answer (based on the IBM sample) should be 1 or more transactions
@Phil_Hirsch care to confirm my understanding above? Then i'll mark it as answer.
Answer by Phil_Hirsch (272) | Mar 09, 2018 at 10:57 AM
I wrote:
the number of blocks per transaction
which should of course be "number of transactions per block."