tracer

package
v1.56.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tracer provides functionality for tracing blockchain store operations by reading and parsing trace output from a FIFO pipe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	BlockHeight int64  `json:"blockHeight"`
	StoreName   string `json:"store_name"`
}

Metadata contains contextual information about a trace event.

type StoreTracer

type StoreTracer struct {
	Traces chan *Trace
	// contains filtered or unexported fields
}

StoreTracer reads and parses store operation traces from a file or FIFO pipe.

func NewStoreTracer

func NewStoreTracer(path string, createFifo bool) (*StoreTracer, error)

NewStoreTracer creates a new StoreTracer that reads from the specified path. If createFifo is true, a FIFO pipe will be created at the path. The tracer must be started with Start() to begin processing traces.

func (*StoreTracer) Start

func (t *StoreTracer) Start()

Start begins processing trace events and sending them to the Traces channel. This method blocks until the tracer is stopped or the file is closed.

func (*StoreTracer) Stop

func (t *StoreTracer) Stop() error

Stop stops the tracer and closes the underlying file.

type Trace

type Trace struct {
	Operation string    `json:"operation"`
	Key       string    `json:"key"`
	Value     string    `json:"value"`
	Metadata  *Metadata `json:"metadata,omitempty"`
	Err       error     `json:"-"`
}

Trace represents a single store operation trace event.

Jump to

Keyboard shortcuts

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