node

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load added in v0.5.0

func Load(ctx context.Context, cfg *config.Config, logger *slog.Logger, immutableDir string) error

func LoadWithDB added in v0.22.0

func LoadWithDB(
	ctx context.Context,
	cfg *config.Config,
	logger *slog.Logger,
	immutableDir string,
	db *database.Database,
) error

LoadWithDB loads immutable DB blocks into the chain. If db is nil, a new database connection is opened (and closed on return).

func Run

func Run(cfg *config.Config, logger *slog.Logger) error

func WithBulkLoadPragmas added in v0.22.0

func WithBulkLoadPragmas(
	db *database.Database,
	logger *slog.Logger,
) func()

WithBulkLoadPragmas enables bulk-load optimizations on the metadata store if it implements BulkLoadOptimizer. The returned cleanup function restores normal pragmas and must be deferred by the caller.

Types

type Backfill added in v0.22.0

type Backfill struct {
	// contains filtered or unexported fields
}

Backfill replays stored blocks to populate historical metadata. It is triggered automatically during Mithril sync when storageMode is "api".

func NewBackfill added in v0.22.0

func NewBackfill(
	db *database.Database,
	nodeCfg *cardano.CardanoNodeConfig,
	logger *slog.Logger,
) *Backfill

NewBackfill creates a new Backfill instance.

func (*Backfill) NeedsBackfill added in v0.22.0

func (b *Backfill) NeedsBackfill() (bool, error)

NeedsBackfill checks if there's an incomplete backfill checkpoint. Returns true only when a checkpoint exists and is not yet completed.

func (*Backfill) Run added in v0.22.0

func (b *Backfill) Run(ctx context.Context) error

Run executes the backfill. Blocks until complete or context cancelled. Safe to call multiple times; uses checkpoints for resume.

type LoadBlobsResult added in v0.22.0

type LoadBlobsResult struct {
	BlocksCopied     int
	ImmutableTipSlot uint64
}

LoadBlobsResult contains the result of a blob-only ImmutableDB load.

func LoadBlobsWithDB added in v0.22.0

func LoadBlobsWithDB(
	ctx context.Context,
	cfg *config.Config,
	logger *slog.Logger,
	immutableDir string,
	db *database.Database,
) (*LoadBlobsResult, error)

LoadBlobsWithDB copies blocks from an ImmutableDB directory into the blob store without starting the ledger processing pipeline. This is used after a Mithril snapshot import where the ledger state has already been loaded from the snapshot. Returns the number of blocks copied and the immutable tip slot so the caller can update the metadata tip to match.

Jump to

Keyboard shortcuts

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