parser

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const MinTxsBatchLimit = 500

Variables

This section is empty.

Functions

func ConvertToBatch

func ConvertToBatch(blocks []blockatlas.Block, ctx context.Context) blockatlas.Txs

func FetchBlocks

func FetchBlocks(params Params, lastParsedBlock, currentBlock int64, ctx context.Context) []blockatlas.Block

func GetBlocksIntervalToFetch

func GetBlocksIntervalToFetch(params Params, ctx context.Context) (int64, int64, error)

func GetInterval

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

func PublishTransactionsBatch

func PublishTransactionsBatch(params Params, txs blockatlas.Txs, ctx context.Context)

func RunParser

func RunParser(params Params)

func SaveLastParsedBlock

func SaveLastParsedBlock(params Params, blocks []blockatlas.Block, ctx context.Context) error

Types

type GetBlockByNumber

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

type Params

type Params struct {
	Ctx                                       context.Context
	Api                                       blockatlas.BlockAPI
	Queue                                     []mq.Queue
	ParsingBlocksInterval, FetchBlocksTimeout time.Duration
	BacklogCount                              int
	MaxBacklogBlocks                          int64
	StopChannel                               chan<- struct{}
	TxBatchLimit                              uint
	Database                                  *db.Instance
}

Jump to

Keyboard shortcuts

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