blockswithtx

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

Get blocks with receipts from a geth node, as fast as possible (concurrent)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlocksWithTxReceipts

func GetBlocksWithTxReceipts(client *ethclient.Client, blockChan chan<- *BlockWithTxReceipts, startBlock int64, endBlock int64, concurrency int)

GetBlocksWithTxReceipts downloads a range of blocks with tx receipts, and sends each to a channel once it is ready. Uses concurrency parallel connections to get data from the eth node fast. 5 seems a good number for a direct IPC connection.

Types

type BlockWithTxReceipts

type BlockWithTxReceipts struct {
	Block      *types.Block
	TxReceipts map[common.Hash]*types.Receipt
}

BlockWithTxReceipts contains a single block and receipts for all its transactions (eth does not guarantee that every tx has a receipt)

func GetBlockWithTxReceipts

func GetBlockWithTxReceipts(client *ethclient.Client, height int64) (res *BlockWithTxReceipts, err error)

GetBlockWithTxReceipts returns a single block with receipts for all transactions

Jump to

Keyboard shortcuts

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