Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fraction ¶
type Fraction struct {
Nominator, Denominator int
}
Fraction of something.
type GenOpt ¶
type GenOpt func(*Generator)
GenOpt for configuring Generator.
func WithLayerSize ¶
WithLayerSize configures average layer size.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator for layers of blocks.
type NextOpt ¶
type NextOpt func(*nextConf)
NextOpt is for configuring layer generator.
func WithEmptyInputVector ¶
func WithEmptyInputVector() NextOpt
WithEmptyInputVector will save empty input vector.
func WithLayerSizeOverwrite ¶
WithLayerSizeOverwrite overwrite expected layer size.
func WithNextReorder ¶
WithNextReorder configures when reordered layer should be returned. Examples: Next() Next(WithNextReorder(1)) Next() 1 3 2 Next() Next(WithNextReorder(2)) Next() Next() 1 3 4 2
So the Next layer with WithNextReorder will be delayed exactly by `delay` value.
func WithPartialHare ¶
WithPartialHare will set input vector only to a fraction of all known blocks. Input vector will be limited to nominator*size/denominator.
func WithVoteGenerator ¶
func WithVoteGenerator(gen VotesGenerator) NextOpt
WithVoteGenerator declares vote generator for a layer.
func WithoutInputVector ¶
func WithoutInputVector() NextOpt
WithoutInputVector will prevent from saving input vector.
type Sequence ¶
Sequence of layers with same configuration.
func WithSequence ¶
WithSequence creates Sequence object.
type SetupOpt ¶
type SetupOpt func(g *setupConf)
SetupOpt configures setup.
func WithSetupMinerRange ¶
WithSetupMinerRange number of miners will be selected between low and high values.
func WithSetupUnitsRange ¶
WithSetupUnitsRange adjusts units of the ATXs, which will directly affect block weight.
type SplitOpt ¶
type SplitOpt func(*splitConf)
SplitOpt is for configuring partition.
func WithPartitions ¶
WithPartitions configures number of miners in each partition relative to original Generator.
type State ¶
type State struct { MeshDB *mesh.DB AtxDB *activation.DB Beacons *beaconStore // contains filtered or unexported fields }
State of the node.
func (*State) OnActivationTx ¶
func (s *State) OnActivationTx(atx *types.ActivationTx)
OnActivationTx callback to store activation transaction.
func (*State) OnCoinflip ¶
OnCoinflip callback to store coinflip.
type VotesGenerator ¶
VotesGenerator allows to replace default votes generator. TODO(dshulyak) what is the best way to encapsulate all configuration that is required to generate votes?