chain

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxRepoFile = "dategen.repo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataGen

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

func FromTxRepository

func FromTxRepository(dataDir string, interrupt <-chan struct{},
	repo *TxRepository, initFoundationUTXO bool) (*DataGen, error)

func LoadDataGen

func LoadDataGen(dataPath string) (*DataGen, error)

func NewDataGen

func NewDataGen(dataDir string, interrupt <-chan struct{},
	params *GenerationParams) (*DataGen, error)

func (*DataGen) EnableAddToTxPoolTimer

func (g *DataGen) EnableAddToTxPoolTimer(counter *TimeCounter)

func (*DataGen) EnableProcessDataTimer

func (g *DataGen) EnableProcessDataTimer(counter *TimeCounter)

func (*DataGen) Exit

func (g *DataGen) Exit()

func (*DataGen) Generate

func (g *DataGen) Generate(height uint32) (err error)

func (*DataGen) GetChain

func (g *DataGen) GetChain() *blockchain.BlockChain

func (*DataGen) Save

func (g *DataGen) Save() (err error)

func (*DataGen) SetGenerateMode

func (g *DataGen) SetGenerateMode(mode GenerationMod)

func (*DataGen) SetPressure

func (g *DataGen) SetPressure(enable bool, size int)

func (*DataGen) SetPrevBlockHash

func (g *DataGen) SetPrevBlockHash(hash common.Uint256)

type GenerationMod

type GenerationMod byte
const (
	Fast    GenerationMod = 0x00
	Normal  GenerationMod = 0x01
	Minimal GenerationMod = 0x02
)

type GenerationParams

type GenerationParams struct {
	Mode GenerationMod

	PrepareStartHeight uint32
	RandomStartHeight  uint32

	InputsPerBlock uint32
	MaxRefersCount uint32
	MinRefersCount uint32
	AddressCount   uint32
}

func (*GenerationParams) Deserialize

func (p *GenerationParams) Deserialize(r io.Reader) (err error)

func (*GenerationParams) Serialize

func (p *GenerationParams) Serialize(w io.Writer) error

type TimeCounter

type TimeCounter struct {
	StartTimer func()
	StopTimer  func()
}

type TxRepository

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

func NewTxRepository

func NewTxRepository(params *GenerationParams) (result *TxRepository,
	err error)

func (*TxRepository) Deserialize

func (r *TxRepository) Deserialize(reader io.Reader) (err error)

func (*TxRepository) GeneratePressureTxs

func (r *TxRepository) GeneratePressureTxs(
	height uint32, size int) (txs []*types.Transaction, err error)

func (*TxRepository) GenerateTxs

func (r *TxRepository) GenerateTxs(
	height uint32) (txs []*types.Transaction, err error)

func (*TxRepository) GetFoundationAccount

func (r *TxRepository) GetFoundationAccount() *account.Account

func (*TxRepository) Params

func (r *TxRepository) Params() *GenerationParams

func (*TxRepository) Serialize

func (r *TxRepository) Serialize(w io.Writer) (err error)

func (*TxRepository) SetFoundationUTXO

func (r *TxRepository) SetFoundationUTXO(utxo *types.UTXO)

Jump to

Keyboard shortcuts

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