Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the size of the default block on hyperldger fabric?

I'm trying to create a estimation of the size of a chain if i create a new blockchain using hyperldger.

In order to have an idea of disk space usage i would like to know that is the average size of a default block in the hyperldger fabric.

Thank you before hand, Best Regards

like image 610
Cortesao Avatar asked May 14 '18 18:05

Cortesao


2 Answers

Bellow you can find default configuration provided for ordering service. You can actually control block size with BatchTimeout and BatchSize parameters, also note that this is pretty use case dependent as it relies on transaction size, i.e. the logic of your chaincode.

################################################################################
#
#   SECTION: Orderer
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for orderer related parameters
#
################################################################################
Orderer: &OrdererDefaults

    # Orderer Type: The orderer implementation to start
    # Available types are "solo" and "kafka"
    OrdererType: solo

    Addresses:
        - orderer.example.com:7050

    # 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: 10

        # 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
like image 67
Artem Barger Avatar answered Sep 28 '22 19:09

Artem Barger


The value is configured:

################################################################################
#   SECTION: Orderer
################################################################################
Orderer: &OrdererDefaults
    OrdererType: solo
    Addresses:
        #- orderer0.ordererorg:7050
        - orderer0:7050
    Kafka:
        Brokers:
    BatchTimeout: 2s
    BatchSize:
        MaxMessageCount: 10
        AbsoluteMaxBytes: 98 MB
        PreferredMaxBytes: 512 KB
    Organizations:

The file is located in configtx.yaml, and it is defined in config.go.

// BatchSize contains configuration affecting the size of batches.
type BatchSize struct {
    MaxMessageCount   uint32 `yaml:"MaxMessageSize"`
    AbsoluteMaxBytes  uint32 `yaml:"AbsoluteMaxBytes"`
    PreferredMaxBytes uint32 `yaml:"PreferredMaxBytes"`
}

The values are set according the configtx.yaml file above.

like image 36
jiaxyan Avatar answered Sep 28 '22 20:09

jiaxyan