gen

package
v0.0.8-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockGenerationInterval          = time.Second
	BlockVersion                     = 1
	MinAllowableTimeBetweenDupBlocks = time.Minute * 2
)

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(logger *logger.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type AssertError

type AssertError string

AssertError identifies an error that indicates an internal code consistency issue and should be treated as a critical and unrecoverable error.

func (AssertError) Error

func (e AssertError) Error() string

Error returns the assertion error as a human-readable string and satisfies the error interface.

type BlockGenerator

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

func NewBlockGenerator

func NewBlockGenerator(opts ...Option) (*BlockGenerator, error)

func (*BlockGenerator) Active

func (g *BlockGenerator) Active() bool

func (*BlockGenerator) Close

func (g *BlockGenerator) Close()

func (*BlockGenerator) Interrupt

func (g *BlockGenerator) Interrupt(height uint32)

func (*BlockGenerator) Start

func (g *BlockGenerator) Start()

type Option

type Option func(cfg *config) error

Option is configuration option function for the mempool

func Blockchain

func Blockchain(chain *blockchain.Blockchain) Option

Blockchain is the node's active blockchain.

func BroadcastFunc

func BroadcastFunc(f func(blk *blocks.XThinnerBlock) error) Option

BroadcastFunc broadcasts the block to the network.

This cannot be nil.

func Mempool

func Mempool(mpool *mempool.Mempool) Option

Mempool is the node's mempool object. This is needed to populate the block with transactions.

This cannot be nil.

func Policy

func Policy(p *policy.Policy) Option

Policy holds the node's policy settings. It's used to access the blocksize soft limit.

This cannot be nil.

func PrivateKey

func PrivateKey(key crypto.PrivKey) Option

PrivateKey is the private key for the validator. It will be used to sign blocks.

This cannot be nil

Jump to

Keyboard shortcuts

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