chainsync

package
v0.0.0-...-1196ed7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockTime

func BlockTime(ctx context.Context, client *ethclient.Client, block uint64) (time.Time, error)

func DialRpc

func DialRpc(ctx context.Context) (*ethclient.Client, error)

func FindContractDeploymentBlock

func FindContractDeploymentBlock(ctx context.Context, client *ethclient.Client, contract common.Address) (*big.Int, error)

findContractDeploymentBlock performs a binary search to determine the block in which the contract was deployed.

func GetSyncFromBlock

func GetSyncFromBlock(ctx context.Context, client *ethclient.Client, contract common.Address, currentBlockFunc CurrentBlockFunc) (*big.Int, error)

func GetSyncToBlock

func GetSyncToBlock(ctx context.Context, client *ethclient.Client, from, confirmations, maxBlockScanRange uint64) (*big.Int, bool, error)

Types

type CurrentBlockFunc

type CurrentBlockFunc func(context.Context) (uint64, error)

type SetCurrentBlockFunc

type SetCurrentBlockFunc func(context.Context, uint64) error

Jump to

Keyboard shortcuts

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