parser

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchBlocks

func FetchBlocks(params Params, lastParsedBlock, currentBlock int64) ([]types.Block, error)

func GetBlocksIntervalToFetch

func GetBlocksIntervalToFetch(params Params) (int64, int64, error)

func GetInterval

func GetInterval(value int, minInterval, maxInterval time.Duration) time.Duration

func GetNextBlocksToParse added in v1.1.15

func GetNextBlocksToParse(lastParsedBlock int64, currentBlock int64, maxBlocks int64) (int64, int64, error)

func RunParser

func RunParser(params Params, ctx context.Context)

func SaveLastParsedBlock

func SaveLastParsedBlock(params Params, blocks []types.Block) error

Types

type GetBlockByNumber

type GetBlockByNumber func(num int64) (*types.Block, error)

type Params

type Params struct {
	Api                                       blockatlas.BlockAPI
	TransactionsExchange                      mq.Exchange
	ParsingBlocksInterval, FetchBlocksTimeout time.Duration
	MaxBlocks                                 int64
	StopChannel                               chan<- struct{}
	Database                                  *db.Instance
}

Jump to

Keyboard shortcuts

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