monitor

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: GPL-3.0 Imports: 12 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, logger logrus.FieldLogger) (*AppchainMonitor, error)

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

func (*AppchainMonitor) ListenIBTP added in v1.5.0

func (m *AppchainMonitor) ListenIBTP() <-chan *pb.IBTP

func (*AppchainMonitor) QueryIBTP

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

QueryIBTP queries interchain tx recorded in appchain given ibtp id

func (*AppchainMonitor) QueryOuterMeta added in v1.5.0

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

QueryOuterMeta queries outer meta from appchain. It will loop until the result is returned or panic.

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 appchain
	ListenIBTP() <-chan *pb.IBTP
	// query historical ibtp by its id
	QueryIBTP(id string) (*pb.IBTP, error)
	// QueryLatestMeta queries latest index map of ibtps threw on appchain
	QueryOuterMeta() 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