Documentation ¶
Overview ¶
Package generator implements the Chain Core generator.
A Chain Core configured as a generator produces new blocks on an interval.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockSigner ¶
type BlockSigner interface { // SignBlock returns an ed25519 signature over the block's sighash. // See also the Chain Protocol spec for the complete required behavior // of a block signer. SignBlock(ctx context.Context, marshalledBlock []byte) (signature []byte, err error) }
A BlockSigner signs blocks.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator collects pending transactions and produces new blocks on an interval.
func (*Generator) Generate ¶
Generate runs in a loop, making one new block every block period. It returns when its context is canceled. After each attempt to make a block, it calls health to report either an error or nil to indicate success.
func (*Generator) PendingTxs ¶
PendingTxs returns all of the pendings txs that will be included in the generator's next block.
Click to show internal directories.
Click to hide internal directories.