blockcreator

package
v0.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapBlock

func BootstrapBlock(tx *types.ConfigTxEnvelope) (*types.Block, error)

Types

type BlockCreator

type BlockCreator struct {
	// contains filtered or unexported fields
}

BlockCreator uses transactions batch queue to construct a block proposal and submits the proposed block to the block-replicator. The block-replicator is in charge of numbering the blocks and setting the previous BlockHeaderBase hash.

func New

func New(conf *Config) (*BlockCreator, error)

New creates a new block assembler

func (*BlockCreator) RegisterReplicator

func (b *BlockCreator) RegisterReplicator(blockReplicator Replicator)

func (*BlockCreator) Start

func (b *BlockCreator) Start()

Start runs the block assembler in an infinite loop

func (*BlockCreator) Stop

func (b *BlockCreator) Stop()

Stop stops the block creator

func (*BlockCreator) WaitTillStart

func (b *BlockCreator) WaitTillStart()

WaitTillStart waits till the block creator is started

type Config

type Config struct {
	TxBatchQueue *queue.Queue
	BlockStore   *blockstore.Store
	PendingTxs   *queue.PendingTxs
	Logger       *logger.SugarLogger
}

Config holds the configuration information required to initialize the block creator

type Replicator

type Replicator interface {
	Submit(block *types.Block) error
}

Replicator is the input to the block replication layer.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL