blockprocessor

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDBEntriesForDataTx

func AddDBEntriesForDataTx(tx *types.DataTx, version *types.Version, dbsUpdates map[string]*worldstate.DBUpdates)

func ApplyBlockOnStateTrie

func ApplyBlockOnStateTrie(trie *mptrie.MPTrie, worldStateUpdates map[string]*worldstate.DBUpdates) error

func ConstructDBUpdatesForBlock

func ConstructDBUpdatesForBlock(block *types.Block, bp *BlockProcessor) (map[string]*worldstate.DBUpdates, error)

Types

type BlockCommitListener

type BlockCommitListener interface {
	PostBlockCommitProcessing(block *types.Block) error
}

BlockCommitListener is a listener who listens to the commit events

type BlockProcessor

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

BlockProcessor holds block Validator and committer

func New

func New(conf *Config) *BlockProcessor

New creates a ValidatorAndCommitter

func (*BlockProcessor) Bootstrap

func (b *BlockProcessor) Bootstrap(configBlock *types.Block, ledgerConfig config.LedgerConf) error

Bootstrap initializes the ledger and database with the first block, which contains a config transaction. This block is a.k.a. the "genesis block".

func (*BlockProcessor) RegisterBlockCommitListener

func (b *BlockProcessor) RegisterBlockCommitListener(name string, listener BlockCommitListener) error

RegisterBlockCommitListener registers a commit listener with the block processor

func (*BlockProcessor) Start

func (b *BlockProcessor) Start()

Start starts the Validator and committer

func (*BlockProcessor) Stop

func (b *BlockProcessor) Stop()

Stop stops the block processor

func (*BlockProcessor) WaitTillStart

func (b *BlockProcessor) WaitTillStart()

WaitTillStart waits till the block processor is started

type Config

type Config struct {
	BlockOneQueueBarrier *queue.OneQueueBarrier
	BlockStore           *blockstore.Store
	DB                   worldstate.DB
	ProvenanceStore      *provenance.Store
	StateTrieStore       mptrie.Store
	TxValidator          *txvalidation.Validator
	Logger               *logger.SugarLogger
}

Config holds the configuration information needed to bootstrap the block processor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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