crawlers

package
v0.0.0-...-086ef7a Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressFilter

type AddressFilter interface {
	MatchesNone(addresses ...string) (bool, errstack.E)
}

AddressFilter is the Interface for addresses filters Operations are: - MatchesNone: returns true if none of the addresses are part of the filter

func NewFixedAddressesFilter

func NewFixedAddressesFilter(addresses []string) (AddressFilter, errstack.E)

NewFixedAddressesFilter returns a an instance of FixedAddressFilter setup with a list of addresses

type BCBlock

type BCBlock struct {
	*BCBlockHeader
	Transactions []*BCTrans
	Logs         []*BCLog
}

BCBlock is a chain block Data structure

type BCBlockHeader

type BCBlockHeader struct {
	BlockNum     int64     `json:"blockNum"`
	BlockHash    string    `json:"blockHash"`
	Timestamp    time.Time `json:"timestamp"`
	NetworkID    int64     `json:"networkId"`
	NetworkLabel string    `json:"networkLabel"`
}

BCBlockHeader contains Block's header details

type BCBlockProcessor

type BCBlockProcessor interface {
	Process(block *BCBlock) errstack.E
}

BCBlockProcessor is the interface of all BCBlock processors

type BCLog

type BCLog struct {
	ID        string   `json:"uid"`
	TxIndex   int64    `json:"txIndex"`
	TxHash    string   `json:"txHash"`
	LogIndex  uint     `json:"logIndex"`
	Address   string   `json:"address"`
	EventName string   `json:"eventName"`
	EventAgs  []string `json:"eventArgs"`
	Data      string   `json:"data"`
}

BCLog contains Chain log event data

type BCTrans

type BCTrans struct {
	ID                     string     `json:"uid"`
	TxIndex                int64      `json:"txIndex"`
	TxHash                 string     `json:"txHash"`
	GasPrice               uint64     `json:"gasPrice"`
	Gas                    uint64     `json:"gas"`
	CumulativeGasUsed      uint64     `json:"cumulativeGasUsed"`
	GasUsed                uint64     `json:"gasUsed"`
	From                   string     `json:"from"`
	To                     string     `json:"to,omitempty"`
	ContractCreated        bool       `json:"contractCreation,omitempty"`
	CreatedContractAddress string     `json:"createdContractAddress,omitempty"`
	Value                  *big.Float `json:"value"`
	RawValue               *big.Int   `json:"rawValue"`
	Data                   string     `json:"data"`
}

BCTrans contains Chain transaction data

type ChainCrawler

type ChainCrawler interface {
	Process() errstack.E
}

ChainCrawler is a blockchain crawler interface

type CrawlerOpts

type CrawlerOpts struct {
	ChainAddress string   `long:"chain" required:"yes" description:"The ethereum blockchain endpoint"`
	BlockOffset  int64    `` /* 181-byte string literal not displayed */
	Delay        int64    `` /* 174-byte string literal not displayed */
	Addresses    []string `long:"filter" required:"yes" description:"Addresses used to filter the transactions or logs of interest"`
}

CrawlerOpts contains the options for crawling a chain

func (*CrawlerOpts) Check

func (r *CrawlerOpts) Check() errstack.E

Check applies validation rules

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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