monitor

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppchainMonitor

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

Monitor receives event from blockchain and sends it to network

func New

func New(client plugins.Client, cryptor txcrypto.Cryptor) (*AppchainMonitor, error)

New creates monitor instance given client interacting with appchain and interchainCounter about appchain.

func (*AppchainMonitor) ListenOnIBTP

func (m *AppchainMonitor) ListenOnIBTP() chan *pb.IBTP

func (*AppchainMonitor) QueryIBTP

func (m *AppchainMonitor) QueryIBTP(id string) (*pb.IBTP, error)

func (*AppchainMonitor) QueryLatestMeta

func (m *AppchainMonitor) QueryLatestMeta() map[string]uint64

func (*AppchainMonitor) Start

func (m *AppchainMonitor) Start() error

Start implements Monitor

func (*AppchainMonitor) Stop

func (m *AppchainMonitor) Stop() error

Stop implements Monitor

type Monitor

type Monitor interface {
	// Start starts the service of monitor
	Start() error

	// Stop stops the service of monitor
	Stop() error

	// listen on interchain ibtp from now on
	ListenOnIBTP() chan *pb.IBTP

	// query historical ibtp by its id
	QueryIBTP(id string) (*pb.IBTP, error)

	// QueryLatestMeta queries latest index map of ibtps executed on appchain
	QueryLatestMeta() map[string]uint64
}

Directories

Path Synopsis
Package mock_monitor is a generated GoMock package.
Package mock_monitor is a generated GoMock package.

Jump to

Keyboard shortcuts

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