metadata

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataStore

type MetadataStore interface {
	// Database
	Close() error
	DB() *gorm.DB
	GetCommitTimestamp() (int64, error)
	SetCommitTimestamp(*gorm.DB, int64) error
	Transaction() *gorm.DB

	// Ledger state
	// GetEpoch(uint64, *gorm.DB)
	// GetEpochs(*gorm.DB) ([]models.Epoch, error)
	GetPoolRegistrations(
		[]byte,
		*gorm.DB,
	) ([]models.PoolRegistration, error)
	GetPParams(
		uint64,
		*gorm.DB,
	) ([]models.PParams, error)
	GetPParamUpdates(
		uint64,
		*gorm.DB,
	) ([]models.PParamUpdate, error)
	GetStakeRegistrations(
		[]byte,
		*gorm.DB,
	) ([]models.StakeRegistration, error)
	GetTip(*gorm.DB) (ochainsync.Tip, error)
	GetUtxo(
		[]byte,
		uint32,
		*gorm.DB,
	) (models.Utxo, error)

	SetEpoch(
		uint64,
		uint64,
		[]byte,
		uint,
		uint,
		uint,
		*gorm.DB,
	) error
	SetPoolRegistration(
		[]byte,
		[]byte,
		uint64,
		uint64,
		uint64,
		uint64,
		*big.Rat,
		[]lcommon.AddrKeyHash,
		[]lcommon.PoolRelay,
		*lcommon.PoolMetadata,
		*gorm.DB,
	) error
	SetPoolRetirement(
		[]byte,
		uint64,
		uint64,
		*gorm.DB,
	) error
	SetPParams(
		[]byte,
		uint64,
		uint64,
		uint,
		*gorm.DB,
	) error
	SetPParamUpdate(
		[]byte,
		[]byte,
		uint64,
		uint64,
		*gorm.DB,
	) error
	SetStakeDelegation(
		[]byte,
		[]byte,
		uint64,
		*gorm.DB,
	) error
	SetStakeDeregistration(
		[]byte,
		uint64,
		*gorm.DB,
	) error
	SetStakeRegistration(
		[]byte,
		uint64,
		uint64,
		*gorm.DB,
	) error
	SetTip(
		ochainsync.Tip,
		*gorm.DB,
	) error

	// Helpers
	GetEpochLatest(*gorm.DB) (models.Epoch, error)
	GetUtxosByAddress(ledger.Address, *gorm.DB) ([]models.Utxo, error)
	DeleteUtxo(any, *gorm.DB) error
	DeleteUtxos([]any, *gorm.DB) error
}

func New

func New(
	pluginName, dataDir string,
	logger *slog.Logger,
) (MetadataStore, error)

For now, this always returns a sqlite plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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