sbp

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConstructor added in v0.9.4

GetConstructor build and returns consensus.Constructor from New function.

func GetName added in v1.0.0

func GetName() string

GetName returns the name of the consensus.

func ValidateGenesis added in v1.3.3

func ValidateGenesis(genesis *types.Genesis) error

Types

type SimpleBlockFactory

type SimpleBlockFactory struct {
	*component.ComponentHub
	consensus.ChainDB
	// contains filtered or unexported fields
}

SimpleBlockFactory implments a simple block factory which generate block each cfg.Consensus.BlockInterval.

This can be used for testing purpose.

func New

New returns a SimpleBlockFactory.

func (*SimpleBlockFactory) BlockFactory

func (s *SimpleBlockFactory) BlockFactory() consensus.BlockFactory

BlockFactory returns s itself.

func (*SimpleBlockFactory) ClusterInfo added in v1.3.3

func (s *SimpleBlockFactory) ClusterInfo(bestBlockHash []byte) *types.GetClusterInfoResponse

func (*SimpleBlockFactory) ConfChange added in v1.3.3

func (*SimpleBlockFactory) ConfChangeInfo added in v1.3.3

func (s *SimpleBlockFactory) ConfChangeInfo(requestID uint64) (*types.ConfChangeProgress, error)

func (*SimpleBlockFactory) ConsensusInfo added in v1.0.0

func (s *SimpleBlockFactory) ConsensusInfo() *types.ConsensusInfo

func (*SimpleBlockFactory) GetType added in v1.0.0

func (*SimpleBlockFactory) HasWAL added in v1.3.3

func (s *SimpleBlockFactory) HasWAL() bool

func (*SimpleBlockFactory) Info added in v1.0.0

func (s *SimpleBlockFactory) Info() string

Info retuns an empty string since SBP has no valuable consensus-related information.

func (*SimpleBlockFactory) IsBlockValid

func (s *SimpleBlockFactory) IsBlockValid(*types.Block, *types.Block) error

IsBlockValid checks the consensus level validity of a block.

func (*SimpleBlockFactory) IsConnectedBlock added in v1.3.3

func (s *SimpleBlockFactory) IsConnectedBlock(block *types.Block) bool

func (*SimpleBlockFactory) IsForkEnable added in v1.3.3

func (s *SimpleBlockFactory) IsForkEnable() bool

func (*SimpleBlockFactory) IsTransactionValid

func (s *SimpleBlockFactory) IsTransactionValid(tx *types.Tx) bool

IsTransactionValid checks the onsensus level validity of a transaction

func (*SimpleBlockFactory) JobQueue

func (s *SimpleBlockFactory) JobQueue() chan<- interface{}

JobQueue returns the queue for block production triggering.

func (*SimpleBlockFactory) MakeConfChangeProposal added in v1.3.3

func (s *SimpleBlockFactory) MakeConfChangeProposal(req *types.MembershipChange) (*consensus.ConfChangePropose, error)

func (*SimpleBlockFactory) NeedNotify added in v1.3.3

func (s *SimpleBlockFactory) NeedNotify() bool

func (*SimpleBlockFactory) NeedReorganization

func (s *SimpleBlockFactory) NeedReorganization(rootNo types.BlockNo) bool

NeedReorganization has nothing to do.

func (*SimpleBlockFactory) QueueJob

func (s *SimpleBlockFactory) QueueJob(now time.Time, jq chan<- interface{})

QueueJob send a block triggering information to jq.

func (*SimpleBlockFactory) QuitChan

func (s *SimpleBlockFactory) QuitChan() chan interface{}

QuitChan returns the channel from which consensus-related goroutines check when shutdown is initiated.

func (*SimpleBlockFactory) RaftAccessor added in v1.3.3

func (*SimpleBlockFactory) Save

Save has nothging to do.

func (*SimpleBlockFactory) Start

func (s *SimpleBlockFactory) Start()

Start run a simple block factory service.

func (*SimpleBlockFactory) Ticker

func (s *SimpleBlockFactory) Ticker() *time.Ticker

Ticker returns a time.Ticker for the main consensus loop.

func (*SimpleBlockFactory) Update

func (s *SimpleBlockFactory) Update(block *types.Block)

Update has nothging to do.

func (*SimpleBlockFactory) VerifySign added in v0.9.10

func (s *SimpleBlockFactory) VerifySign(*types.Block) error

VerifySign checks the consensus level validity of a block.

func (*SimpleBlockFactory) VerifyTimestamp added in v0.11.0

func (s *SimpleBlockFactory) VerifyTimestamp(*types.Block) bool

VerifyTimestamp checks the validity of the block timestamp.

Jump to

Keyboard shortcuts

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