parser

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 18 Imported by: 0

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, tracker models.Tracker) (int64, int64, error)

func GetInterval

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

func GetNextBlocksToParse

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