poller

package
v0.0.0-...-8cda47c Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwaitBlocks

func AwaitBlocks(wssHost string, height chan int64)

Types

type BlockHeightNotifier

type BlockHeightNotifier interface {
	Subscribe(o BlockHeightObserver, chainID string) (bool, error)
	Unsubscribe(o BlockHeightObserver, chainID string) (bool, error)
	Notify(chain string, height int64)
}

Observers get notified when a new block is published to the chain.

type BlockHeightObserver

type BlockHeightObserver interface {
	Get() chan uint64
}

type Data

type Data struct {
	Value EventDataNewBlockHeader
}

type EventDataNewBlockHeader

type EventDataNewBlockHeader struct {
	Header Header `json:"header"`
	NumTxs string `json:"num_txs"` // Number of txs in a block
}
type Header struct {
	// basic block info
	ChainID string    `json:"chain_id"`
	Height  string    `json:"height"`
	Time    time.Time `json:"time"`
}

type Querier

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

func (*Querier) Notify

func (q *Querier) Notify(chain string, height int64)

func (*Querier) Subscribe

func (q *Querier) Subscribe(o BlockHeightObserver, chainID string) (bool, error)

func (*Querier) Unsubscribe

func (q *Querier) Unsubscribe(o BlockHeightObserver, chainID string) (bool, error)

type Result

type Result struct {
	Data Data
}

type TendermintNewBlockHeader

type TendermintNewBlockHeader struct {
	Result Result
}

Jump to

Keyboard shortcuts

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