metadata

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 9 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
	AddUtxos(
		[]models.UtxoSlot,
		*gorm.DB,
	) error
	GetPoolRegistrations(
		lcommon.PoolKeyHash,
		*gorm.DB,
	) ([]lcommon.PoolRegistrationCertificate, error)
	GetPool(
		lcommon.PoolKeyHash,
		bool,
		*gorm.DB,
	) (*models.Pool, error)
	GetStakeRegistrations(
		[]byte,
		*gorm.DB,
	) ([]lcommon.StakeRegistrationCertificate, error)
	GetTip(*gorm.DB) (ochainsync.Tip, error)

	GetAccount(
		[]byte,
		bool,
		*gorm.DB,
	) (*models.Account, error)
	GetBlockNonce(
		ocommon.Point,
		*gorm.DB,
	) ([]byte, error)
	GetDatum(
		lcommon.Blake2b256,
		*gorm.DB,
	) (*models.Datum, error)
	GetDrep(
		[]byte,
		bool,
		*gorm.DB,
	) (*models.Drep, error)
	GetPParams(
		uint64,
		*gorm.DB,
	) ([]models.PParams, error)
	GetPParamUpdates(
		uint64,
		*gorm.DB,
	) ([]models.PParamUpdate, error)
	GetUtxo(
		[]byte,
		uint32,
		*gorm.DB,
	) (*models.Utxo, error)
	GetTransactionByHash(
		[]byte,
		*gorm.DB,
	) (*models.Transaction, error)
	GetScript(
		lcommon.ScriptHash,
		*gorm.DB,
	) (*models.Script, error)

	SetBlockNonce(
		[]byte,
		uint64,
		[]byte,
		bool,
		*gorm.DB,
	) error
	SetDatum(
		lcommon.Blake2b256,
		[]byte,
		uint64,
		*gorm.DB,
	) error
	SetEpoch(
		uint64,
		uint64,
		[]byte,
		uint,
		uint,
		uint,
		*gorm.DB,
	) error
	SetPParams(
		[]byte,
		uint64,
		uint64,
		uint,
		*gorm.DB,
	) error
	SetPParamUpdate(
		[]byte,
		[]byte,
		uint64,
		uint64,
		*gorm.DB,
	) error
	SetTip(
		ochainsync.Tip,
		*gorm.DB,
	) error
	SetTransaction(
		lcommon.Transaction,
		ocommon.Point,
		uint32,
		map[int]uint64,
		*gorm.DB,
	) error

	// Helpers
	DeleteBlockNoncesBeforeSlot(uint64, *gorm.DB) error
	DeleteBlockNoncesBeforeSlotWithoutCheckpoints(uint64, *gorm.DB) error
	DeleteUtxo(any, *gorm.DB) error
	DeleteUtxos([]any, *gorm.DB) error
	DeleteUtxosAfterSlot(uint64, *gorm.DB) error
	GetEpochsByEra(uint, *gorm.DB) ([]models.Epoch, error)
	GetEpochs(*gorm.DB) ([]models.Epoch, error)
	GetUtxosAddedAfterSlot(uint64, *gorm.DB) ([]models.Utxo, error)
	GetUtxosByAddress(ledger.Address, *gorm.DB) ([]models.Utxo, error)
	GetUtxosDeletedBeforeSlot(uint64, int, *gorm.DB) ([]models.Utxo, error)
	SetUtxoDeletedAtSlot(ledger.TransactionInput, uint64, *gorm.DB) error
	SetUtxosNotDeletedAfterSlot(uint64, *gorm.DB) error
}

func New

func New(pluginName string) (MetadataStore, error)

New creates a new metadata store instance using the specified plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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