blocklog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	// RegisterBlockHash registers a blockHash for a test name.
	// When a log line with this blockHash is seen, it will be associated with the test.
	// If the log already arrived (buffered in unmatched), it's immediately associated.
	RegisterBlockHash(testName, blockHash string)

	// GetBlockLogs returns all captured block logs mapped by test name.
	GetBlockLogs() map[string]json.RawMessage

	// Writer returns an io.Writer that intercepts log lines, parses them,
	// and passes them through to the downstream writer.
	Writer() io.Writer
}

Collector intercepts log streams, parses JSON payloads from client logs, and associates them with tests using blockHash matching.

func NewCollector

func NewCollector(parser Parser, downstream io.Writer) Collector

NewCollector creates a new block log collector with the given parser and downstream writer.

type Parser

type Parser interface {
	// ParseLine attempts to extract a JSON payload from a log line.
	// Returns the raw JSON message and true if successful, or nil and false if the line
	// doesn't contain a parseable JSON payload.
	ParseLine(line string) (json.RawMessage, bool)

	// ClientType returns the client type this parser is for.
	ClientType() client.ClientType
}

Parser extracts JSON payloads from client log lines.

func NewBesuParser

func NewBesuParser() Parser

NewBesuParser creates a new Besu log parser (stub).

func NewErigonParser

func NewErigonParser() Parser

NewErigonParser creates a new Erigon log parser (stub).

func NewGethParser

func NewGethParser() Parser

NewGethParser creates a new Geth log parser.

func NewNethermindParser

func NewNethermindParser() Parser

NewNethermindParser creates a new Nethermind log parser (stub).

func NewNimbusParser

func NewNimbusParser() Parser

NewNimbusParser creates a new Nimbus log parser (stub).

func NewNoopParser

func NewNoopParser() Parser

NewNoopParser creates a new no-op parser.

func NewParser

func NewParser(clientType client.ClientType) Parser

NewParser returns the appropriate parser for the given client type. Returns nil if the client type is not supported or unknown.

func NewRethParser

func NewRethParser() Parser

NewRethParser creates a new Reth log parser (stub).

Jump to

Keyboard shortcuts

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