sim

package
v0.2.5-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenOpt

type GenOpt func(*Generator)

GenOpt for configuring Generator.

func WithLayerSize

func WithLayerSize(size uint32) GenOpt

WithLayerSize configures average layer size.

func WithLogger

func WithLogger(logger log.Log) GenOpt

WithLogger configures logger.

func WithSeed

func WithSeed(seed int64) GenOpt

WithSeed configures seed for Generator. By default current time used as a seed.

type Generator

type Generator struct {
	State State
	// contains filtered or unexported fields
}

Generator for layers of blocks.

func New

func New(opts ...GenOpt) *Generator

New creates Generator instance.

func (*Generator) Next

func (g *Generator) Next() types.LayerID

Next generates next layer.

func (*Generator) Setup

func (g *Generator) Setup(opts ...SetupOpt)

Setup should be called before running Next.

type SetupOpt

type SetupOpt func(g *setupConf)

SetupOpt configures setup.

func WithSetupMinerRange

func WithSetupMinerRange(low, high int) SetupOpt

WithSetupMinerRange number of miners will be selected between low and high values.

func WithSetupUnitsRange

func WithSetupUnitsRange(low, high int) SetupOpt

WithSetupUnitsRange adjusts units of the ATXs, which will directly affect block weight.

type State

type State struct {
	MeshDB *mesh.DB
	AtxDB  *activation.DB
}

State is state that can be used by tortoise.

Jump to

Keyboard shortcuts

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