filters

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2015 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

package filters implements an ethereum filtering system for block, transactions and log events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountChange

type AccountChange struct {
	Address, StateAddress []byte
}

type Filter

type Filter struct {
	BlockCallback       func(*types.Block, vm.Logs)
	TransactionCallback func(*types.Transaction)
	LogsCallback        func(vm.Logs)
	// contains filtered or unexported fields
}

Filtering interface

func New

func New(db ethdb.Database) *Filter

Create a new filter which uses a bloom filter on blocks to figure out whether a particular block is interesting or not.

func (*Filter) FilterLogs

func (self *Filter) FilterLogs(logs vm.Logs) vm.Logs

func (*Filter) Find

func (self *Filter) Find() vm.Logs

Run filters logs with the current parameters set

func (*Filter) SetAddresses

func (self *Filter) SetAddresses(addr []common.Address)

func (*Filter) SetBeginBlock

func (self *Filter) SetBeginBlock(begin int64)

Set the earliest and latest block for filtering. -1 = latest block (i.e., the current block) hash = particular hash from-to

func (*Filter) SetEndBlock

func (self *Filter) SetEndBlock(end int64)

func (*Filter) SetTopics

func (self *Filter) SetTopics(topics [][]common.Hash)

type FilterSystem

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

FilterSystem manages filters that filter specific events such as block, transaction and log events. The Filtering system can be used to listen for specific LOG events fired by the EVM (Ethereum Virtual Machine).

func NewFilterSystem

func NewFilterSystem(mux *event.TypeMux) *FilterSystem

NewFilterSystem returns a newly allocated filter manager

func (*FilterSystem) Add

func (fs *FilterSystem) Add(filter *Filter) (id int)

Add adds a filter to the filter manager

func (*FilterSystem) Get

func (fs *FilterSystem) Get(id int) *Filter

Get retrieves a filter installed using Add The filter may not be modified.

func (*FilterSystem) Remove

func (fs *FilterSystem) Remove(id int)

Remove removes a filter by filter id

func (*FilterSystem) Stop

func (fs *FilterSystem) Stop()

Stop quits the filter loop required for polling events

Jump to

Keyboard shortcuts

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