ethblocklistener

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockListener

type BlockListener interface {
	ReconcileConfirmationsForTransaction(ctx context.Context, txHash string, existingConfirmations []*ffcapi.MinimalBlockInfo, targetConfirmationCount uint64) (*ffcapi.ConfirmationUpdateResult, *ethrpc.TxReceiptJSONRPC, error)
	GetMonitoredHeadLength() int // provides a getter on the configuration for unstable head length - as this information is important to consumers (might be multiple from this block listener)
	AddConsumer(ctx context.Context, c *BlockUpdateConsumer)
	RemoveConsumer(ctx context.Context, id *fftypes.UUID)
	GetHighestBlock(ctx context.Context) (uint64, bool)
	GetBlockInfoByNumber(ctx context.Context, blockNumber uint64, allowCache bool, expectedParentHashStr string, expectedBlockHashStr string) (*ethrpc.BlockInfoJSONRPC, error)
	GetBlockInfoByHash(ctx context.Context, hash0xString string) (*ethrpc.BlockInfoJSONRPC, error)
	GetEVMBlockWithTxHashesByHash(ctx context.Context, hash0xString string) (b *ethrpc.EVMBlockWithTxHashesJSONRPC, err error)
	GetEVMBlockWithTransactionsByHash(ctx context.Context, hash0xString string) (b *ethrpc.EVMBlockWithTransactionsJSONRPC, err error)
	GetEVMBlockWithTxHashesByNumber(ctx context.Context, numberLookup string) (b *ethrpc.EVMBlockWithTxHashesJSONRPC, err error)
	GetEVMBlockWithTransactionsByNumber(ctx context.Context, numberLookup string) (b *ethrpc.EVMBlockWithTransactionsJSONRPC, err error)
	FetchBlockReceiptsAsync(blockNumber uint64, blockHash ethtypes.HexBytes0xPrefix, cb func([]*ethrpc.TxReceiptJSONRPC, error))
	SnapshotMonitoredHeadChain() []*ethrpc.BlockInfoJSONRPC // snapshot the whole view, with complete blocks, using the read-lock.
	WaitClosed()
	GetBackend() rpcbackend.RPC
	UTSetBackend(rpcbackend.RPC)
}

func NewBlockListener

func NewBlockListener(ctx context.Context, retry *retry.Retry, conf *BlockListenerConfig, httpConf *ffresty.Config, wsConf *wsclient.WSConfig) (bl BlockListener, err error)

func NewBlockListenerSupplyBackend

func NewBlockListenerSupplyBackend(ctx context.Context, retry *retry.Retry, conf *BlockListenerConfig, httpBackend rpcbackend.RPC, wsBackend rpcbackend.WebSocketRPCClient) (_ BlockListener, err error)

type BlockListenerConfig

type BlockListenerConfig struct {
	MonitoredHeadLength           int           `json:"monitoredHeadLength"`
	BlockPollingInterval          time.Duration `json:"blockPollingInterval"`
	HederaCompatibilityMode       bool          `json:"hederaCompatibilityMode"`
	BlockCacheSize                int           `json:"blockCacheSize"`
	IncludeLogsBloom              bool          `json:"includeLogsBloom"`
	UseGetBlockReceipts           bool          `json:"useGetBlockReceipts"`
	MaxAsyncBlockFetchConcurrency int           `json:"maxAsyncBlockFetchConcurrency"`
}

type BlockUpdateConsumer

type BlockUpdateConsumer struct {
	ID      *fftypes.UUID // could be an event stream ID for example - must be unique
	Ctx     context.Context
	Updates chan<- *ffcapi.BlockHashEvent // FFTM change events
}

Jump to

Keyboard shortcuts

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