Documentation ¶
Overview ¶
Package generator implements block generation.
Index ¶
- Constants
- Variables
- type Consensus
- type FeePriorityTransactions
- type Generator
- type GeneratorInfo
- func (e *GeneratorInfo) Decode(data []byte) error
- func (e *GeneratorInfo) DecodeFromReader(reader *codec.Reader) error
- func (e *GeneratorInfo) DecodeStrict(data []byte) error
- func (e *GeneratorInfo) DecodeStrictFromReader(reader *codec.Reader) error
- func (e *GeneratorInfo) Encode() []byte
- func (f GeneratorInfo) Equal(val *GeneratorInfo) bool
- func (f GeneratorInfo) IsZero() bool
- func (e *GeneratorInfo) MustDecode(data []byte)
- type GeneratorInitParams
- type GeneratorParams
- type Keypair
- func (e *Keypair) Decode(data []byte) error
- func (e *Keypair) DecodeFromReader(reader *codec.Reader) error
- func (e *Keypair) DecodeStrict(data []byte) error
- func (e *Keypair) DecodeStrictFromReader(reader *codec.Reader) error
- func (e *Keypair) Encode() []byte
- func (e *Keypair) MustDecode(data []byte)
- type Keys
- func (e *Keys) Decode(data []byte) error
- func (e *Keys) DecodeFromReader(reader *codec.Reader) error
- func (e *Keys) DecodeStrict(data []byte) error
- func (e *Keys) DecodeStrictFromReader(reader *codec.Reader) error
- func (e *Keys) Encode() []byte
- func (k *Keys) EncryptedKeys() (*crypto.EncryptedMessage, error)
- func (k Keys) IsEncrypted() bool
- func (k Keys) IsPlain() bool
- func (e *Keys) MustDecode(data []byte)
- func (k *Keys) PlainKeys() (*PlainKeys, error)
- func (k Keys) Validate() error
- type KeysFile
- type KeysFileItem
- type PlainKeys
- func (e *PlainKeys) Decode(data []byte) error
- func (e *PlainKeys) DecodeFromReader(reader *codec.Reader) error
- func (e *PlainKeys) DecodeStrict(data []byte) error
- func (e *PlainKeys) DecodeStrictFromReader(reader *codec.Reader) error
- func (e *PlainKeys) Encode() []byte
- func (e *PlainKeys) MustDecode(data []byte)
- func (k PlainKeys) Validate() error
- type TransactionWithFeePriority
Constants ¶
View Source
const ( KeyTypePlain = "plain" KeyTypeEncrypted = "encrypted" )
Variables ¶
View Source
var ( GeneratorDBPrefixGeneratedInfo = []byte{0} GeneratorDBPrefixKeys = []byte{1} )
Functions ¶
This section is empty.
Types ¶
type Consensus ¶
type Consensus interface { Syncing() bool AddInternal(block *blockchain.Block) GetAggregateCommit() (*blockchain.AggregateCommit, error) Certify(from, to uint32, address codec.Lisk32, blsPrivateKey []byte) error Subscribe(topic string) <-chan interface{} GetSlotNumber(unixTime uint32) int GetSlotTime(slot int) uint32 GetBFTHeights(context *diffdb.Database) (uint32, uint32, uint32, error) GetBFTParameters(context *diffdb.Database, height uint32) (*liskbft.BFTParams, error) GetGeneratorKeys(context *diffdb.Database, height uint32) (liskbft.Generators, error) HeaderHasPriority(context *diffdb.Database, header blockchain.SealedBlockHeader, height, maxHeightPrevoted, maxHeightPreviouslyForged uint32) (bool, error) ImpliesMaximalPrevotes(context *diffdb.Database, blockHeader blockchain.ReadableBlockHeader) (bool, error) BFTBeforeTransactionsExecute(blockHeader blockchain.SealedBlockHeader, diffStore *diffdb.Database) error }
type FeePriorityTransactions ¶
type FeePriorityTransactions []*TransactionWithFeePriority
func (FeePriorityTransactions) Len ¶
func (h FeePriorityTransactions) Len() int
func (FeePriorityTransactions) Less ¶
func (h FeePriorityTransactions) Less(i, j int) bool
func (*FeePriorityTransactions) Pop ¶
func (h *FeePriorityTransactions) Pop() interface{}
func (*FeePriorityTransactions) Push ¶
func (h *FeePriorityTransactions) Push(x interface{})
func (FeePriorityTransactions) Swap ¶
func (h FeePriorityTransactions) Swap(i, j int)
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(params *GeneratorParams) *Generator
func (*Generator) DisableGeneration ¶
func (*Generator) EnableGeneration ¶
func (*Generator) Init ¶
func (g *Generator) Init(params *GeneratorInitParams) error
func (*Generator) IsGenerationEnabled ¶
type GeneratorInfo ¶
type GeneratorInfo struct { Height uint32 `json:"height" fieldNumber:"1"` MaxHeightPrevoted uint32 `json:"maxHeightPrevoted" fieldNumber:"2"` MaxHeightGenerated uint32 `json:"maxHeightGenerated" fieldNumber:"3"` }
func (*GeneratorInfo) Decode ¶
func (e *GeneratorInfo) Decode(data []byte) error
func (*GeneratorInfo) DecodeFromReader ¶
func (e *GeneratorInfo) DecodeFromReader(reader *codec.Reader) error
func (*GeneratorInfo) DecodeStrict ¶
func (e *GeneratorInfo) DecodeStrict(data []byte) error
func (*GeneratorInfo) DecodeStrictFromReader ¶
func (e *GeneratorInfo) DecodeStrictFromReader(reader *codec.Reader) error
func (*GeneratorInfo) Encode ¶
func (e *GeneratorInfo) Encode() []byte
func (GeneratorInfo) Equal ¶
func (f GeneratorInfo) Equal(val *GeneratorInfo) bool
func (GeneratorInfo) IsZero ¶
func (f GeneratorInfo) IsZero() bool
func (*GeneratorInfo) MustDecode ¶
func (e *GeneratorInfo) MustDecode(data []byte)
type GeneratorInitParams ¶
type GeneratorParams ¶
type GeneratorParams struct { Consensus Consensus ABI labi.ABI Pool *txpool.TransactionPool Chain *blockchain.Chain }
type Keypair ¶
type Keypair struct {
// contains filtered or unexported fields
}
func NewKeypair ¶
func (*Keypair) DecodeStrict ¶
func (*Keypair) DecodeStrictFromReader ¶
func (*Keypair) MustDecode ¶
type Keys ¶
type Keys struct { Address codec.Lisk32 `json:"address" fieldNumber:"1"` Type string `json:"type" fieldNumber:"2"` Data []byte `json:"data" fieldNumber:"3"` }
func (*Keys) DecodeStrict ¶
func (*Keys) DecodeStrictFromReader ¶
func (*Keys) EncryptedKeys ¶
func (k *Keys) EncryptedKeys() (*crypto.EncryptedMessage, error)
func (Keys) IsEncrypted ¶
func (*Keys) MustDecode ¶
type KeysFile ¶
type KeysFile struct {
Keys []*KeysFileItem `json:"keys"`
}
type KeysFileItem ¶
type KeysFileItem struct { Address codec.Lisk32 `json:"address"` Plain *PlainKeys `json:"plain"` Encrypted *crypto.EncryptedMessage `json:"encrypted"` }
type PlainKeys ¶
type PlainKeys struct { GeneratorKey codec.Hex `json:"generatorKey" fieldNumber:"1"` GeneratorPrivateKey codec.Hex `json:"generatorPrivateKey" fieldNumber:"2"` BLSKey codec.Hex `json:"blsKey" fieldNumber:"3"` BLSPrivateKey codec.Hex `json:"blsPrivateKey" fieldNumber:"4"` }
func (*PlainKeys) DecodeFromReader ¶
func (*PlainKeys) DecodeStrict ¶
func (*PlainKeys) DecodeStrictFromReader ¶
func (*PlainKeys) MustDecode ¶
type TransactionWithFeePriority ¶
type TransactionWithFeePriority struct { *blockchain.Transaction FeePriority int }
Click to show internal directories.
Click to hide internal directories.