Documentation ¶
Index ¶
- Constants
- type Solo
- func (s *Solo) Author(header *types.Header) (common.Address, error)
- func (s *Solo) CheckValidatorVotes(chain consensus.ChainReader, header *types.Header) (map[common.Address]bool, error)
- func (s *Solo) CompareBlocks(blockA *types.Block, blockB *types.Block) int
- func (s *Solo) Finalize(chain consensus.ChainReader, header *types.Header, statedb *state.StateDB, ...)
- func (s *Solo) FinalizeAndAssemble(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (s *Solo) GetLookBackBlockNumber(num *big.Int) *big.Int
- func (s *Solo) GetValMainAddress() common.Address
- func (s *Solo) Pause() error
- func (s *Solo) Prepare(chain consensus.ChainReader, header *types.Header) error
- func (s *Solo) Resume() error
- func (s *Solo) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
- func (s *Solo) SetChain(chain consensus.ChainReader)
- func (s *Solo) SetValKey(sk *ecdsa.PrivateKey, blsKeyBytes []byte) (err error)
- func (s *Solo) StartMining(chain consensus.ChainReader, inserter consensus.MineInserter, ...) error
- func (s *Solo) Stop() error
- func (s *Solo) Update(sealer bool, nodeIdx uint64, totalNodes uint64)
- func (s *Solo) UpdateContextForNewBlock(block *types.Block) error
- func (s *Solo) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error
- func (s *Solo) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
- func (s *Solo) VerifySeal(chain consensus.ChainReader, header *types.Header) error
Constants ¶
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 (*Solo) CheckValidatorVotes ¶
func (*Solo) CompareBlocks ¶
TODO: fork-selection rules
-1 if blockA < blockB 0 if blockA == blockB +1 if blockA > blockB
func (*Solo) FinalizeAndAssemble ¶
func (*Solo) GetValMainAddress ¶
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) UpdateContextForNewBlock ¶
todo update here
func (*Solo) VerifyHeader ¶
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 ¶
VerifySeal checks whether the crypto seal on a header is valid according to the consensus rules of the given engine.