solo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StakeLookBack = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Solo

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

func NewFallbackSolo

func NewFallbackSolo(sealer bool, nodeIdx uint64, totalNodes uint64, blockTime time.Duration) *Solo

func NewSolo

func NewSolo() *Solo

func (*Solo) Author

func (s *Solo) Author(header *types.Header) (common.Address, error)

func (*Solo) CheckValidatorVotes

func (s *Solo) CheckValidatorVotes(chain consensus.ChainReader, header *types.Header) (map[common.Address]bool, error)

func (*Solo) CompareBlocks

func (s *Solo) CompareBlocks(blockA *types.Block, blockB *types.Block) int

TODO: fork-selection rules

-1 if blockA <  blockB
 0 if blockA == blockB
+1 if blockA >  blockB

func (*Solo) Finalize

func (s *Solo) Finalize(chain consensus.ChainReader, header *types.Header, statedb *state.StateDB, txs []*types.Transaction, receipts []*types.Receipt)

func (*Solo) FinalizeAndAssemble

func (s *Solo) FinalizeAndAssemble(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, receipts []*types.Receipt) (*types.Block, error)

func (*Solo) GetLookBackBlockNumber

func (s *Solo) GetLookBackBlockNumber(num *big.Int) *big.Int

func (*Solo) GetValMainAddress

func (s *Solo) GetValMainAddress() common.Address

func (*Solo) Pause added in v0.9.6

func (s *Solo) Pause() error

func (*Solo) Prepare

func (s *Solo) Prepare(chain consensus.ChainReader, header *types.Header) error

func (*Solo) Resume added in v0.9.6

func (s *Solo) Resume() error

func (*Solo) Seal

func (s *Solo) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)

Seal generates a new block for the given input block with the local miner's seal place on top.

func (*Solo) SetChain

func (s *Solo) SetChain(chain consensus.ChainReader)

func (*Solo) SetValKey

func (s *Solo) SetValKey(sk *ecdsa.PrivateKey, blsKeyBytes []byte) (err error)

func (*Solo) StartMining

func (s *Solo) StartMining(chain consensus.ChainReader, inserter consensus.MineInserter, eventMux *event.TypeMux) error

func (*Solo) Stop

func (s *Solo) Stop() error

func (*Solo) Update

func (s *Solo) Update(sealer bool, nodeIdx uint64, totalNodes uint64)

func (*Solo) UpdateContextForNewBlock

func (s *Solo) UpdateContextForNewBlock(block *types.Block) error

todo update here

func (*Solo) VerifyHeader

func (s *Solo) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error

VerifyHeader checks whether a header conforms to the consensus rules of a given engine. Verifying the seal may be done optionally here, or explicitly via the VerifySeal method.

func (*Solo) VerifyHeaders

func (s *Solo) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers concurrently. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications (the order is that of the input slice).

func (*Solo) VerifySeal

func (s *Solo) VerifySeal(chain consensus.ChainReader, header *types.Header) error

VerifySeal checks whether the crypto seal on a header is valid according to the consensus rules of the given engine.

Jump to

Keyboard shortcuts

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