gen

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockGenerationInterval = time.Second
	BlockVersion            = 1
)

Variables

This section is empty.

Functions

func UpdateLogger

func UpdateLogger()

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) 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 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