Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockProgressLogger ¶
BlockProgressLogger provides periodic logging for other services in order to show users progress of certain "actions" involving some or all current blocks. Ex: syncing to best chain, indexing all blocks, etc.
func NewBlockProgressLogger ¶
func NewBlockProgressLogger(progressMessage string, logger log.Logger) *BlockProgressLogger
NewBlockProgressLogger returns a new block progress logger. The progress message is templated as follows:
{progressAction} {numProcessed} {blocks|block} in the last {timePeriod} ({numTxs}, height {lastBlockHeight}, {lastBlockTimeStamp})
func (*BlockProgressLogger) LogBlockHeight ¶
func (b *BlockProgressLogger) LogBlockHeight(block *types.SerializedBlock)
logBlockHeight logs a new block height as an information message to show progress to the user. In order to prevent spam, it limits logging to one message every 10 seconds with duration and totals included.
func (*BlockProgressLogger) LogBlockHeightByParent ¶
func (b *BlockProgressLogger) LogBlockHeightByParent(block, parent *types.SerializedBlock)
LogBlockHeight logs a new block height as an information message to show progress to the user. In order to prevent spam, it limits logging to one message every 10 seconds with duration and totals included.
func (*BlockProgressLogger) SetLastLogTime ¶
func (b *BlockProgressLogger) SetLastLogTime(time time.Time)