observer

package
v0.0.0-...-855f576 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultObserverLevelDBFolder = `observer_data`

Variables

This section is empty.

Functions

This section is empty.

Types

type BinanceBlockScanner

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

BinanceBlockScanner is to scan the blocks

func NewBinanceBlockScanner

func NewBinanceBlockScanner(cfg config.BlockScannerConfiguration, scanStorage blockscanner.ScannerStorage, isTestNet bool, pav PoolAddressValidator, m *metrics.Metrics) (*BinanceBlockScanner, error)

NewBinanceBlockScanner create a new instance of BlockScan

func (*BinanceBlockScanner) GetMessages

func (b *BinanceBlockScanner) GetMessages() <-chan stypes.TxIn

GetMessages return the channel

func (*BinanceBlockScanner) Start

func (b *BinanceBlockScanner) Start()

Start block scanner

func (*BinanceBlockScanner) Stop

func (b *BinanceBlockScanner) Stop() error

type BinanceChanBlockScannerStorage

type BinanceChanBlockScannerStorage struct {
	*blockscanner.LevelDBScannerStorage
	// contains filtered or unexported fields
}

func NewBinanceChanBlockScannerStorage

func NewBinanceChanBlockScannerStorage(levelDbFolder string) (*BinanceChanBlockScannerStorage, error)

func (*BinanceChanBlockScannerStorage) Close

func (ldbss *BinanceChanBlockScannerStorage) Close() error

Close underlying db

func (*BinanceChanBlockScannerStorage) GetTxInForRetry

func (ldbss *BinanceChanBlockScannerStorage) GetTxInForRetry(failedOnly bool) ([]types.TxIn, error)

GetTxInForRetry retrieve all txin that had been failed before to retry

func (*BinanceChanBlockScannerStorage) RemoveTxIn

func (ldbss *BinanceChanBlockScannerStorage) RemoveTxIn(txin types.TxIn) error

RemoveTxIn remove the given txin from the store

func (*BinanceChanBlockScannerStorage) SetTxInStatus

func (ldbss *BinanceChanBlockScannerStorage) SetTxInStatus(txIn types.TxIn, status types.TxInStatus) error

SetTxInStatus set the given txin to a status , in the data store

type MockPoolAddressValidator

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

func NewMockPoolAddressValidator

func NewMockPoolAddressValidator() *MockPoolAddressValidator

func (*MockPoolAddressValidator) IsValidPoolAddress

func (mpa *MockPoolAddressValidator) IsValidPoolAddress(addr string) bool

type Observer

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

Observer observer service

func NewObserver

func NewObserver(cfg config.Configuration) (*Observer, error)

NewObserver create a new instance of Observer

func (*Observer) Start

func (o *Observer) Start() error

func (*Observer) Stop

func (o *Observer) Stop() error

Stop the observer

type PoolAddressManager

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

PoolAddressManager it manage the pool address

func NewPoolAddressManager

func NewPoolAddressManager(chainHost string, m *metrics.Metrics) (*PoolAddressManager, error)

NewPoolAddressManager create a new instance of PoolAddressManager

func (*PoolAddressManager) IsValidPoolAddress

func (pam *PoolAddressManager) IsValidPoolAddress(addr string) bool

IsFromValidPoolAddress check whether the given address is a pool addr

func (*PoolAddressManager) Start

func (pam *PoolAddressManager) Start() error

Start to poll poll addresses from statechain

func (*PoolAddressManager) Stop

func (pam *PoolAddressManager) Stop() error

Stop pool address manager

type PoolAddressValidator

type PoolAddressValidator interface {
	IsValidPoolAddress(addr string) bool
}

type TxInStatusItem

type TxInStatusItem struct {
	TxIn   types.TxIn       `json:"tx_in"`
	Status types.TxInStatus `json:"status"`
}

TxInStatusItem represent the TxIn item status

type TxInStorage

type TxInStorage interface {
	SetTxInStatus(types.TxIn, types.TxInStatus) error
	RemoveTxIn(types.TxIn) error
	GetTxInForRetry(failedOnly bool) ([]types.TxIn, error)
}

TxInStorage define method used by observer

Jump to

Keyboard shortcuts

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