timer

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockServiceName = "block-subscriber"
	BlockQuery       = "tm.event = 'NewBlock'"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockNotifier

type BlockNotifier func(height uint64) error

type BlockSubscriber

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

BlockSubscriber subscribes to the NewBlock events on the tendermint core. New blocks indexes will be pushed to the timer and used in future for session timestamping

func NewBlockSubscriber

func NewBlockSubscriber(timer *Timer, tendermint *http.HTTP, log *logan.Entry) *BlockSubscriber

NewBlockSubscriber creates the subscriber instance for listening new blocks

func (*BlockSubscriber) Run

func (b *BlockSubscriber) Run()

type Timer

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

Timer provides the source for timestamping all operations in the tss system. Use Notifier to receive notification about new blocks in your service

func NewTimer

func NewTimer(tendermint *http.HTTP, log *logan.Entry) *Timer

func (*Timer) CurrentBlock

func (t *Timer) CurrentBlock() uint64

func (*Timer) SubscribeToBlocks

func (t *Timer) SubscribeToBlocks(name string, f BlockNotifier)

SubscribeToBlocks adds receiver method to notify fot the new block events

Jump to

Keyboard shortcuts

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