Documentation ¶
Index ¶
- Constants
- type DataGen
- func (g *DataGen) EnableAddToTxPoolTimer(counter *TimeCounter)
- func (g *DataGen) EnableProcessDataTimer(counter *TimeCounter)
- func (g *DataGen) Exit()
- func (g *DataGen) Generate(height uint32) (err error)
- func (g *DataGen) GetChain() *blockchain.BlockChain
- func (g *DataGen) Save() (err error)
- func (g *DataGen) SetGenerateMode(mode GenerationMod)
- func (g *DataGen) SetPressure(enable bool, size int)
- func (g *DataGen) SetPrevBlockHash(hash common.Uint256)
- type GenerationMod
- type GenerationParams
- type TimeCounter
- type TxRepository
- func (r *TxRepository) Deserialize(reader io.Reader) (err error)
- func (r *TxRepository) GeneratePressureTxs(height uint32, size int) (txs []*types.Transaction, err error)
- func (r *TxRepository) GenerateTxs(height uint32) (txs []*types.Transaction, err error)
- func (r *TxRepository) GetFoundationAccount() *account.Account
- func (r *TxRepository) Params() *GenerationParams
- func (r *TxRepository) Serialize(w io.Writer) (err error)
- func (r *TxRepository) SetFoundationUTXO(utxo *types.UTXO)
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 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) GetChain ¶
func (g *DataGen) GetChain() *blockchain.BlockChain
func (*DataGen) SetGenerateMode ¶
func (g *DataGen) SetGenerateMode(mode GenerationMod)
func (*DataGen) SetPressure ¶
func (*DataGen) SetPrevBlockHash ¶
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)
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) SetFoundationUTXO ¶
func (r *TxRepository) SetFoundationUTXO(utxo *types.UTXO)
Click to show internal directories.
Click to hide internal directories.