factory

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: AGPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLedger

func NewLedger(config Config, triggerCheckpoint *atomic.Bool) (ledger.Ledger, error)

NewLedger creates a ledger instance based on the configuration. If LedgerServiceAddr is set, it creates a remote ledger client. Otherwise, it creates a local ledger with WAL and compactor. triggerCheckpoint is a runtime control signal to trigger checkpoint on next segment finish (can be nil for remote ledger).

Types

type Config

type Config struct {
	// Remote ledger service configuration
	LedgerServiceAddr     string // gRPC address for remote ledger service (empty means use local ledger)
	LedgerMaxRequestSize  uint   // Maximum request message size in bytes for remote ledger client (0 = default 1 GiB)
	LedgerMaxResponseSize uint   // Maximum response message size in bytes for remote ledger client (0 = default 1 GiB)

	// Local ledger configuration
	Triedir            string
	MTrieCacheSize     uint32
	CheckpointDistance uint
	CheckpointsToKeep  uint
	MetricsRegisterer  prometheus.Registerer
	WALMetrics         module.WALMetrics
	LedgerMetrics      module.LedgerMetrics
	Logger             zerolog.Logger
}

Config holds configuration for creating a ledger instance.

Jump to

Keyboard shortcuts

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