committer

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Committer

type Committer interface {

	// Commit block to the ledger
	Commit(block *common.Block) error

	// Get recent block sequence number
	LedgerHeight() (uint64, error)

	// Gets blocks with sequence numbers provided in the slice
	GetBlocks(blockSeqs []uint64) []*common.Block

	// Closes committing service
	Close()
}

Committer is the interface supported by committers The only committer is noopssinglechain committer. The interface is intentionally sparse with the sole aim of "leave-everything-to-the-committer-for-now". As we solidify the bootstrap process and as we add more support (such as Gossip) this interface will change

type LedgerCommitter

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

LedgerCommitter is the implementation of Committer interface it keeps the reference to the ledger to commit blocks and retreive chain information

func NewLedgerCommitter

func NewLedgerCommitter(ledger ledger.PeerLedger, validator txvalidator.Validator) *LedgerCommitter

NewLedgerCommitter is a factory function to create an instance of the committer

func (*LedgerCommitter) Close

func (lc *LedgerCommitter) Close()

Close the ledger

func (*LedgerCommitter) Commit

func (lc *LedgerCommitter) Commit(block *common.Block) error

Commit commits block to into the ledger Note, it is important that this always be called serially

func (*LedgerCommitter) GetBlocks

func (lc *LedgerCommitter) GetBlocks(blockSeqs []uint64) []*common.Block

GetBlocks used to retrieve blocks with sequence numbers provided in the slice

func (*LedgerCommitter) LedgerHeight

func (lc *LedgerCommitter) LedgerHeight() (uint64, error)

LedgerHeight returns recently committed block sequence number

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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