watcher

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: AGPL-3.0 Imports: 15 Imported by: 2

Documentation

Overview

Contract watcher is built with a more generic interface that allows offloading more of the operational logic to the transformers, allowing them to act more dynamically Built to work primarily with the contract_watcher packaging

Index

Constants

View Source
const NoNewDataPause = time.Second * 7

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractWatcher

type ContractWatcher struct {
	Transformers []transformer.ContractTransformer
	DB           *postgres.DB
	BlockChain   core.BlockChain
}

func NewContractWatcher

func NewContractWatcher(db *postgres.DB, bc core.BlockChain) ContractWatcher

func (*ContractWatcher) AddTransformers

func (watcher *ContractWatcher) AddTransformers(inits interface{}) error

func (*ContractWatcher) Execute

func (watcher *ContractWatcher) Execute() error

type EventWatcher

type EventWatcher struct {
	LogDelegator logs.ILogDelegator
	LogExtractor logs.ILogExtractor
	// contains filtered or unexported fields
}

func NewEventWatcher

func NewEventWatcher(db *postgres.DB, bc core.BlockChain) EventWatcher

func (*EventWatcher) AddTransformers

func (watcher *EventWatcher) AddTransformers(initializers []transformer.EventTransformerInitializer) error

Adds transformers to the watcher so that their logs will be extracted and delegated.

func (*EventWatcher) Execute

func (watcher *EventWatcher) Execute(recheckHeaders constants.TransformerExecution) error

Extracts and delegates watched log events.

type IStorageWatcher added in v0.0.8

type IStorageWatcher interface {
	AddTransformers(initializers []transformer.StorageTransformerInitializer)
	Execute(diffsChan chan utils.StorageDiff, errsChan chan error, queueRecheckInterval time.Duration)
}

type StorageWatcher

type StorageWatcher struct {
	StorageFetcher            fetcher.IStorageFetcher
	Queue                     storage.IStorageQueue
	KeccakAddressTransformers map[common.Hash]transformer.StorageTransformer // keccak hash of an address => transformer
	// contains filtered or unexported fields
}

func NewStorageWatcher

func NewStorageWatcher(fetcher fetcher.IStorageFetcher, db *postgres.DB) StorageWatcher

func (StorageWatcher) AddTransformers

func (storageWatcher StorageWatcher) AddTransformers(initializers []transformer.StorageTransformerInitializer)

func (StorageWatcher) Execute

func (storageWatcher StorageWatcher) Execute(diffsChan chan utils.StorageDiff, errsChan chan error, queueRecheckInterval time.Duration)

Jump to

Keyboard shortcuts

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