Documentation
¶
Index ¶
- type CommitTimestamp
- type MetadataStoreSqlite
- func (d *MetadataStoreSqlite) AutoMigrate(dst ...interface{}) error
- func (d *MetadataStoreSqlite) Close() error
- func (d *MetadataStoreSqlite) Create(value interface{}) *gorm.DB
- func (d *MetadataStoreSqlite) DB() *gorm.DB
- func (d *MetadataStoreSqlite) DeleteUtxo(utxo any, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) DeleteUtxos(utxos []any, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) First(args interface{}) *gorm.DB
- func (d *MetadataStoreSqlite) GetCommitTimestamp() (int64, error)
- func (d *MetadataStoreSqlite) GetEpochLatest(txn *gorm.DB) (models.Epoch, error)
- func (d *MetadataStoreSqlite) GetPParamUpdates(epoch uint64, txn *gorm.DB) ([]models.PParamUpdate, error)
- func (d *MetadataStoreSqlite) GetPParams(epoch uint64, txn *gorm.DB) ([]models.PParams, error)
- func (d *MetadataStoreSqlite) GetPoolRegistrations(pkh []byte, txn *gorm.DB) ([]models.PoolRegistration, error)
- func (d *MetadataStoreSqlite) GetStakeRegistrations(cred []byte, txn *gorm.DB) ([]models.StakeRegistration, error)
- func (d *MetadataStoreSqlite) GetTip(txn *gorm.DB) (ocommon.Tip, error)
- func (d *MetadataStoreSqlite) GetUtxo(txId []byte, idx uint32, txn *gorm.DB) (models.Utxo, error)
- func (d *MetadataStoreSqlite) GetUtxosByAddress(addr ledger.Address, txn *gorm.DB) ([]models.Utxo, error)
- func (d *MetadataStoreSqlite) Order(args interface{}) *gorm.DB
- func (d *MetadataStoreSqlite) SetCommitTimestamp(txn *gorm.DB, timestamp int64) error
- func (d *MetadataStoreSqlite) SetEpoch(slot, epoch uint64, nonce []byte, era, slotLength, lengthInSlots uint, ...) error
- func (d *MetadataStoreSqlite) SetPParamUpdate(genesis, update []byte, slot, epoch uint64, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) SetPParams(params []byte, slot, epoch uint64, eraId uint, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) SetPoolRegistration(pkh, vrf []byte, pledge, cost, slot, deposit uint64, margin *big.Rat, ...) error
- func (d *MetadataStoreSqlite) SetPoolRetirement(pkh []byte, slot, epoch uint64, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) SetStakeDelegation(cred, pkh []byte, slot uint64, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) SetStakeDeregistration(cred []byte, slot uint64, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) SetStakeRegistration(cred []byte, slot, deposit uint64, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) SetTip(tip ochainsync.Tip, txn *gorm.DB) error
- func (d *MetadataStoreSqlite) Transaction() *gorm.DB
- func (d *MetadataStoreSqlite) Where(query interface{}, args ...interface{}) *gorm.DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitTimestamp ¶ added in v0.4.0
CommitTimestamp represents the sqlite table used to track the current commit timestamp
func (CommitTimestamp) TableName ¶ added in v0.4.0
func (CommitTimestamp) TableName() string
type MetadataStoreSqlite ¶ added in v0.4.0
type MetadataStoreSqlite struct {
// contains filtered or unexported fields
}
MetadataStoreSqlite stores all data in sqlite. Data may not be persisted
func New ¶
func New( dataDir string, logger *slog.Logger, ) (*MetadataStoreSqlite, error)
New creates a new database
func (*MetadataStoreSqlite) AutoMigrate ¶ added in v0.4.0
func (d *MetadataStoreSqlite) AutoMigrate(dst ...interface{}) error
AutoMigrate wraps the gorm AutoMigrate
func (*MetadataStoreSqlite) Close ¶ added in v0.4.0
func (d *MetadataStoreSqlite) Close() error
Close gets the database handle from our MetadataStore and closes it
func (*MetadataStoreSqlite) Create ¶ added in v0.4.0
func (d *MetadataStoreSqlite) Create(value interface{}) *gorm.DB
Create creates a record
func (*MetadataStoreSqlite) DB ¶ added in v0.4.0
func (d *MetadataStoreSqlite) DB() *gorm.DB
DB returns the database handle
func (*MetadataStoreSqlite) DeleteUtxo ¶ added in v0.4.2
func (d *MetadataStoreSqlite) DeleteUtxo( utxo any, txn *gorm.DB, ) error
func (*MetadataStoreSqlite) DeleteUtxos ¶ added in v0.4.2
func (d *MetadataStoreSqlite) DeleteUtxos( utxos []any, txn *gorm.DB, ) error
func (*MetadataStoreSqlite) First ¶ added in v0.4.0
func (d *MetadataStoreSqlite) First(args interface{}) *gorm.DB
First returns the first DB entry
func (*MetadataStoreSqlite) GetCommitTimestamp ¶ added in v0.4.0
func (d *MetadataStoreSqlite) GetCommitTimestamp() (int64, error)
func (*MetadataStoreSqlite) GetEpochLatest ¶ added in v0.4.2
GetEpochLatest returns the latest epoch
func (*MetadataStoreSqlite) GetPParamUpdates ¶ added in v0.4.2
func (d *MetadataStoreSqlite) GetPParamUpdates( epoch uint64, txn *gorm.DB, ) ([]models.PParamUpdate, error)
GetPParamUpdates returns a list of protocol parameter updates for a given epoch
func (*MetadataStoreSqlite) GetPParams ¶ added in v0.4.2
GetPParams returns a list of protocol parameters for a given epoch
func (*MetadataStoreSqlite) GetPoolRegistrations ¶ added in v0.4.2
func (d *MetadataStoreSqlite) GetPoolRegistrations( pkh []byte, txn *gorm.DB, ) ([]models.PoolRegistration, error)
GetPoolRegistrations returns pool registration certificates
func (*MetadataStoreSqlite) GetStakeRegistrations ¶ added in v0.4.2
func (d *MetadataStoreSqlite) GetStakeRegistrations( cred []byte, txn *gorm.DB, ) ([]models.StakeRegistration, error)
GetStakeRegistrations returns stake registration certificates
func (*MetadataStoreSqlite) GetTip ¶ added in v0.4.2
GetTip returns the current metadata Tip as ocommon.Tip
func (*MetadataStoreSqlite) GetUtxo ¶ added in v0.4.2
func (d *MetadataStoreSqlite) GetUtxo( txId []byte, idx uint32, txn *gorm.DB, ) (models.Utxo, error)
GetUtxo returns a Utxo by reference
func (*MetadataStoreSqlite) GetUtxosByAddress ¶ added in v0.4.2
func (d *MetadataStoreSqlite) GetUtxosByAddress( addr ledger.Address, txn *gorm.DB, ) ([]models.Utxo, error)
GetUtxosByAddress returns a list of Utxos
func (*MetadataStoreSqlite) Order ¶ added in v0.4.0
func (d *MetadataStoreSqlite) Order(args interface{}) *gorm.DB
Order orders a DB query
func (*MetadataStoreSqlite) SetCommitTimestamp ¶ added in v0.4.0
func (d *MetadataStoreSqlite) SetCommitTimestamp( txn *gorm.DB, timestamp int64, ) error
func (*MetadataStoreSqlite) SetEpoch ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetEpoch( slot, epoch uint64, nonce []byte, era, slotLength, lengthInSlots uint, txn *gorm.DB, ) error
SetEpoch saves an epoch
func (*MetadataStoreSqlite) SetPParamUpdate ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetPParamUpdate( genesis, update []byte, slot, epoch uint64, txn *gorm.DB, ) error
SetPParamUpdate saves a protocol parameter update
func (*MetadataStoreSqlite) SetPParams ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetPParams( params []byte, slot, epoch uint64, eraId uint, txn *gorm.DB, ) error
SetPParams saves protocol parameters
func (*MetadataStoreSqlite) SetPoolRegistration ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetPoolRegistration( pkh, vrf []byte, pledge, cost, slot, deposit uint64, margin *big.Rat, owners []lcommon.AddrKeyHash, relays []lcommon.PoolRelay, metadata *lcommon.PoolMetadata, txn *gorm.DB, ) error
SetPoolRegistration saves a pool registration certificate
func (*MetadataStoreSqlite) SetPoolRetirement ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetPoolRetirement( pkh []byte, slot, epoch uint64, txn *gorm.DB, ) error
SetPoolRetirement saves a pool retirement certificate
func (*MetadataStoreSqlite) SetStakeDelegation ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetStakeDelegation( cred, pkh []byte, slot uint64, txn *gorm.DB, ) error
SetStakeDelegation saves a stake delegation certificate
func (*MetadataStoreSqlite) SetStakeDeregistration ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetStakeDeregistration( cred []byte, slot uint64, txn *gorm.DB, ) error
SetStakeDeregistration saves a stake deregistration certificate
func (*MetadataStoreSqlite) SetStakeRegistration ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetStakeRegistration( cred []byte, slot, deposit uint64, txn *gorm.DB, ) error
SetStakeRegistration saves a stake registration certificate
func (*MetadataStoreSqlite) SetTip ¶ added in v0.4.2
func (d *MetadataStoreSqlite) SetTip( tip ochainsync.Tip, txn *gorm.DB, ) error
SetTip saves a tip
func (*MetadataStoreSqlite) Transaction ¶ added in v0.4.0
func (d *MetadataStoreSqlite) Transaction() *gorm.DB
Transaction creates a gorm transaction
func (*MetadataStoreSqlite) Where ¶ added in v0.4.0
func (d *MetadataStoreSqlite) Where( query interface{}, args ...interface{}, ) *gorm.DB
Where constrains a DB query