Documentation ¶
Index ¶
- type Observer
- func (ob *Observer) Alert()
- func (ob *Observer) DeleteBlockAndTxEvents(height int64) error
- func (ob *Observer) Fetch(startHeight int64)
- func (ob *Observer) GetCurrentBlockLog() (*model.BlockLog, error)
- func (ob *Observer) Prune()
- func (ob *Observer) SaveBlockAndTxEvents(blockLog *model.BlockLog, packages []interface{}) error
- func (ob *Observer) Start()
- func (ob *Observer) UpdateSwapPairRegisterConfirmedNum(height int64) error
- func (ob *Observer) UpdateSwapStartConfirmedNum(height int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observer ¶
type Observer struct { DB *gorm.DB StartHeight int64 ConfirmNum int64 Config *util.Config Executor executor.Executor }
func NewObserver ¶
func NewObserver(db *gorm.DB, startHeight, confirmNum int64, cfg *util.Config, executor executor.Executor) *Observer
NewObserver returns the observer instance
func (*Observer) Alert ¶
func (ob *Observer) Alert()
Alert sends alerts to tg group if there is no new block fetched in a specific time
func (*Observer) DeleteBlockAndTxEvents ¶
DeleteBlockAndTxEvents deletes the block and txs of the given height
func (*Observer) GetCurrentBlockLog ¶
GetCurrentBlockLog returns the highest block log
func (*Observer) SaveBlockAndTxEvents ¶
func (*Observer) UpdateSwapPairRegisterConfirmedNum ¶
func (*Observer) UpdateSwapStartConfirmedNum ¶
Click to show internal directories.
Click to hide internal directories.