Documentation
¶
Overview ¶
Package sqlstore contains the shared database/sql metadata store.
Index ¶
- Constants
- func OpenDB(driverName, dataSourceName, systemName string) (*sql.DB, error)
- type Config
- type Dialect
- type Execer
- type Store
- func (s *Store) AccountInactivityActivationMembership(refs []models.StakeCredentialRef, txn types.Txn) (map[string]struct{}, error)
- func (s *Store) AccountLastWitnessSlots(refs []models.StakeCredentialRef, maxSlot uint64, txn types.Txn) (map[string]uint64, error)
- func (s *Store) AccountsWitnessedAfterSlot(slot uint64, txn types.Txn) ([]models.StakeCredentialRef, error)
- func (s *Store) AddAccountRewardByCredential(credentialTag uint8, stakeKey []byte, amount uint64, slot uint64, ...) error
- func (s *Store) AddNetworkDonation(slot, epoch, amount uint64, txn types.Txn) error
- func (s *Store) AddPostSnapshotAccountRewardByCredential(credentialTag uint8, stakeKey []byte, amount uint64, slot uint64, ...) error
- func (s *Store) AddUtxos(utxos []models.UtxoSlot, txn types.Txn) error
- func (s *Store) ApplyAccountRewardWithdrawal(credentialTag uint8, stakeKey []byte, amount uint64, slot uint64, ...) error
- func (s *Store) BackupTo(ctx context.Context, dstPath string) error
- func (s *Store) BuildCriticalDeferredIndexes() error
- func (s *Store) BuildDeferredIndexes() error
- func (s *Store) ClaimFallbackRewardSnapshot(snapshot *models.RewardSnapshot, txn types.Txn) (bool, error)
- func (s *Store) ClaimFallbackRewardSnapshotGuard(epoch uint64, snapshotType string, txn types.Txn) (bool, uint, error)
- func (s *Store) ClearCommitteeQuorum(slot uint64, txn types.Txn) error
- func (s *Store) ClearDanglingDRepDelegations(atSlot uint64, txn types.Txn) (int, error)
- func (s *Store) ClearSyncState(txn types.Txn) error
- func (s *Store) Close() error
- func (s *Store) CloseContext(ctx context.Context) error
- func (s *Store) CountAccountDelegationHistoryByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) (int, error)
- func (s *Store) CountAccountRegistrationHistoryByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) (int, error)
- func (s *Store) CountAccountWithdrawalHistoryByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) (int, error)
- func (s *Store) CountAddressTransactionsByCredential(credentialTag uint8, stakingKey []byte, ...) (int, error)
- func (s *Store) CountAddressesByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) (int, error)
- func (s *Store) CountPoolBlocksInSlotRange(poolKeyHashes []lcommon.PoolKeyHash, startSlot uint64, endSlot uint64, ...) (map[string]uint64, uint64, error)
- func (s *Store) CountRewardAccountOutputsByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) (int, error)
- func (s *Store) CountTransactionsByAddress(paymentKey []byte, credentialTag uint8, stakingKey []byte, txn types.Txn) (int, error)
- func (s *Store) CountTransactionsByMetadataLabel(label uint64, txn types.Txn) (int, error)
- func (s *Store) CountTransactionsByPaymentCred(paymentKey []byte, txn types.Txn) (int, error)
- func (s *Store) CountTransactionsInSlotRange(startSlot uint64, endSlot uint64, txn types.Txn) (int, error)
- func (s *Store) CreateAccount(txn types.Txn, account *models.Account) error
- func (s *Store) CreateDrep(txn types.Txn, drep *models.Drep) error
- func (s *Store) CreateMidnightAriadneRollback(txn types.Txn, rollback *models.MidnightAriadneRollback) error
- func (s *Store) CreateMidnightAssetCreate(txn types.Txn, row *models.MidnightAssetCreate) error
- func (s *Store) CreateMidnightAssetSpend(txn types.Txn, row *models.MidnightAssetSpend) error
- func (s *Store) CreateMidnightDeregistration(txn types.Txn, row *models.MidnightDeregistration) error
- func (s *Store) CreateMidnightRegistration(txn types.Txn, row *models.MidnightRegistration) error
- func (s *Store) CreateUtxo(txn types.Txn, utxo *models.Utxo) error
- func (s *Store) DeactivateAccounts(txn types.Txn, refs []models.StakeCredentialRef) error
- func (s *Store) DeactivateDreps(txn types.Txn, credentials []models.StakeCredentialRef) error
- func (s *Store) DeleteAccountRewardsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteAddressTransactionsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteBlockNoncesAfterPoint(point ocommon.Point, txn types.Txn) error
- func (s *Store) DeleteBlockNoncesBeforeSlot(slotNumber uint64, txn types.Txn) error
- func (s *Store) DeleteBlockNoncesBeforeSlotWithoutCheckpoints(slotNumber uint64, txn types.Txn) error
- func (s *Store) DeleteCertificatesAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteCommitteeMembersAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteConstitutionsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteEpochSummariesAfterEpoch(epoch uint64, txn types.Txn) error
- func (s *Store) DeleteEpochsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteGovernanceProposalsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteGovernanceVotesAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteMidnightAriadneParamsByEpoch(txn types.Txn, epoch uint64) error
- func (s *Store) DeleteMidnightAriadneRollbacksBeforeBlock(txn types.Txn, blockNumber uint64) error
- func (s *Store) DeleteMidnightAriadneRollbacksByBlock(txn types.Txn, blockNumber uint64) error
- func (s *Store) DeleteMidnightAssetCreatesByBlock(txn types.Txn, blockNumber uint64) ([]models.MidnightAssetCreate, error)
- func (s *Store) DeleteMidnightAssetSpendsByBlock(txn types.Txn, blockNumber uint64) ([]models.MidnightAssetSpend, error)
- func (s *Store) DeleteMidnightCommitteeCandidateRegistrationsByBlock(txn types.Txn, blockNumber uint64) error
- func (s *Store) DeleteMidnightDeregistrationsByBlock(txn types.Txn, blockNumber uint64) ([]models.MidnightDeregistration, error)
- func (s *Store) DeleteMidnightEpochCandidatesByBlock(txn types.Txn, blockNumber uint64) error
- func (s *Store) DeleteMidnightGovernanceDatumsByBlock(txn types.Txn, blockNumber uint64) error
- func (s *Store) DeleteMidnightRegistrationsByBlock(txn types.Txn, blockNumber uint64) ([]models.MidnightRegistration, error)
- func (s *Store) DeleteNetworkDonationsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteNetworkStateAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeletePParamUpdatesAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeletePParamsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeletePoolStakeSnapshotsAfterEpoch(epoch uint64, txn types.Txn) error
- func (s *Store) DeletePoolStakeSnapshotsBeforeEpoch(epoch uint64, txn types.Txn) error
- func (s *Store) DeletePoolStakeSnapshotsForEpoch(epoch uint64, snapshotType string, txn types.Txn) error
- func (s *Store) DeleteRewardInputsForEpoch(epoch uint64, txn types.Txn) error
- func (s *Store) DeleteRewardOutputsForEpoch(epoch uint64, txn types.Txn) error
- func (s *Store) DeleteRewardStakeInputBeforeEpoch(epoch uint64, txn types.Txn) error
- func (s *Store) DeleteRewardStateAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteRewardStateBeforeEpoch(epoch uint64, txn types.Txn) error
- func (s *Store) DeleteSyncState(key string, txn types.Txn) error
- func (s *Store) DeleteTransactionMetadataLabelsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteTransactionsAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DeleteUtxo(utxoID models.UtxoId, txn types.Txn) error
- func (s *Store) DeleteUtxos(utxoIDs []models.UtxoId, txn types.Txn) error
- func (s *Store) DeleteUtxosAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) DiskSize() (int64, error)
- func (s *Store) DropDeferredIndexes() error
- func (s *Store) EnsureOffchainMetadataPointers(ctx context.Context, now time.Time, txn types.Txn) (int, error)
- func (s *Store) FindMidnightAriadneRollbacksByBlock(txn types.Txn, blockNumber uint64) ([]models.MidnightAriadneRollback, error)
- func (s *Store) FindMidnightAssetCreatesFrom(startBlock uint64, startTxIndex uint32, limit int, txn types.Txn) ([]models.MidnightAssetCreate, error)
- func (s *Store) FindMidnightAssetSpendsFrom(startBlock uint64, startTxIndex uint32, limit int, txn types.Txn) ([]models.MidnightAssetSpend, error)
- func (s *Store) FindMidnightDeregistrationsFrom(startBlock uint64, startTxIndex uint32, limit int, txn types.Txn) ([]models.MidnightDeregistration, error)
- func (s *Store) FindMidnightRegistrationsFrom(startBlock uint64, startTxIndex uint32, limit int, txn types.Txn) ([]models.MidnightRegistration, error)
- func (s *Store) FindUnspentMidnightAssetCreates() ([]models.MidnightAssetCreate, error)
- func (s *Store) FindUnspentMidnightRegistrations() ([]models.MidnightRegistration, error)
- func (s *Store) FlushBatch(accumulator types.MetadataBatchAccumulator, _ types.Txn) error
- func (s *Store) GetAccountByCredential(credentialTag uint8, stakeKey []byte, includeInactive bool, txn types.Txn) (*models.Account, error)
- func (s *Store) GetAccountDelegationHistoryByCredential(credentialTag uint8, stakingKey []byte, limit int, offset int, order string, ...) ([]models.AccountDelegationHistoryRow, error)
- func (s *Store) GetAccountRegistrationHistoryByCredential(credentialTag uint8, stakingKey []byte, limit int, offset int, order string, ...) ([]models.AccountRegistrationHistoryRow, error)
- func (s *Store) GetAccountSumsByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) (models.AccountSums, error)
- func (s *Store) GetAccountWithdrawalHistoryByCredential(credentialTag uint8, stakingKey []byte, limit int, offset int, order string, ...) ([]models.AccountWithdrawalHistoryRow, error)
- func (s *Store) GetAccountsActiveAtSlot(refs []models.StakeCredentialRef, slot uint64, txn types.Txn) (map[string]struct{}, error)
- func (s *Store) GetAccountsByCredential(refs []models.StakeCredentialRef, includeInactive bool, txn types.Txn) (map[string]*models.Account, error)
- func (s *Store) GetActiveAccountCredentials(txn types.Txn) ([]models.StakeCredentialRef, error)
- func (s *Store) GetActiveCommitteeMembers(txn types.Txn) ([]*models.AuthCommitteeHot, error)
- func (s *Store) GetActiveDreps(txn types.Txn) ([]*models.Drep, error)
- func (s *Store) GetActiveGovernanceProposals(epoch uint64, txn types.Txn) ([]*models.GovernanceProposal, error)
- func (s *Store) GetActivePoolKeyHashes(txn types.Txn) ([][]byte, error)
- func (s *Store) GetActivePoolKeyHashesAtSlot(slot uint64, txn types.Txn) ([][]byte, error)
- func (s *Store) GetActivePoolKeyHashesOrdered(txn types.Txn) ([][]byte, error)
- func (s *Store) GetActivePoolRelays(txn types.Txn) ([]models.PoolRegistrationRelay, error)
- func (s *Store) GetAddressTransactionsByCredential(credentialTag uint8, stakingKey []byte, limit int, offset int, order string, ...) ([]models.AccountTransactionAssociationRow, error)
- func (s *Store) GetAddressesByCredential(credentialTag uint8, stakingKey []byte, limit int, offset int, order string, ...) ([]models.AddressTransaction, error)
- func (s *Store) GetAssetByPolicyAndName(policyID lcommon.Blake2b224, assetName []byte, txn types.Txn) (models.Asset, error)
- func (s *Store) GetAssetMintBurnInfo(policyID lcommon.Blake2b224, assetName []byte, txn types.Txn) ([]byte, int, error)
- func (s *Store) GetAssetQuantityByPolicyAndName(policyID lcommon.Blake2b224, assetName []byte, txn types.Txn) (uint64, error)
- func (s *Store) GetBackfillCheckpoint(phase string, txn types.Txn) (*models.BackfillCheckpoint, error)
- func (s *Store) GetBlockNonce(point ocommon.Point, txn types.Txn) ([]byte, error)
- func (s *Store) GetBlockNoncesInSlotRange(startSlot uint64, endSlot uint64, txn types.Txn) ([]models.BlockNonce, error)
- func (s *Store) GetBlockSlotRangeStats(startSlot uint64, endSlot uint64, txn types.Txn) (metadata.SlotRangeStats, error)
- func (s *Store) GetChildGovernanceProposals(parentTxHash []byte, parentActionIndex uint32, txn types.Txn) ([]*models.GovernanceProposal, error)
- func (s *Store) GetCommitTimestamp() (int64, error)
- func (s *Store) GetCommitteeActiveCount(txn types.Txn) (int, error)
- func (s *Store) GetCommitteeMember(coldKey []byte, txn types.Txn) (*models.AuthCommitteeHot, error)
- func (s *Store) GetCommitteeMembers(txn types.Txn) ([]*models.CommitteeMember, error)
- func (s *Store) GetCommitteeMembersIncludeDeleted(txn types.Txn) ([]*models.CommitteeMember, error)
- func (s *Store) GetCommitteeQuorum(txn types.Txn) (*types.Rat, error)
- func (s *Store) GetConstitution(txn types.Txn) (*models.Constitution, error)
- func (s *Store) GetControlledAmountByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) (uint64, error)
- func (s *Store) GetDRepDelegators(credentialTag uint8, credential []byte, txn types.Txn) ([]models.StakeCredentialRef, error)
- func (s *Store) GetDRepVotingPower(credentialTag uint8, credential []byte, expiryEpoch uint64, txn types.Txn) (uint64, error)
- func (s *Store) GetDRepVotingPowerBatch(credentials []models.StakeCredentialRef, expiryEpoch uint64, txn types.Txn) (map[string]uint64, error)
- func (s *Store) GetDRepVotingPowerByType(drepTypes []uint64, expiryEpoch uint64, txn types.Txn) (map[uint64]uint64, error)
- func (s *Store) GetDatum(hash lcommon.Blake2b256, txn types.Txn) (*models.Datum, error)
- func (s *Store) GetDrep(credential []byte, includeInactive bool, txn types.Txn) (*models.Drep, error)
- func (s *Store) GetDrepByCredential(credentialTag uint8, credential []byte, includeInactive bool, txn types.Txn) (*models.Drep, error)
- func (s *Store) GetDrepLastRegistrationSlot(credentialTag uint8, credential []byte, txn types.Txn) (uint64, error)
- func (s *Store) GetDreps(txn types.Txn) ([]models.DrepListRow, error)
- func (s *Store) GetEnactedGovernanceProposalsAt(epoch uint64, slot uint64, txn types.Txn) ([]*models.GovernanceProposal, error)
- func (s *Store) GetEpoch(epochID uint64, txn types.Txn) (*models.Epoch, error)
- func (s *Store) GetEpochBoundaryRewardStakeInputsForPools(poolKeyHashes [][]byte, snapshotSlot uint64, boundarySlot uint64, ...) ([]*models.RewardStakeInput, error)
- func (s *Store) GetEpochBoundaryStakeByPools(poolKeyHashes [][]byte, snapshotSlot uint64, boundarySlot uint64, ...) (map[string]uint64, map[string]uint64, error)
- func (s *Store) GetEpochBySlot(slot uint64, txn types.Txn) (*models.Epoch, error)
- func (s *Store) GetEpochSummary(epoch uint64, txn types.Txn) (*models.EpochSummary, error)
- func (s *Store) GetEpochs(txn types.Txn) ([]models.Epoch, error)
- func (s *Store) GetEpochsByEra(eraID uint, txn types.Txn) ([]models.Epoch, error)
- func (s *Store) GetExpiredDReps(epoch uint64, txn types.Txn) ([]*models.Drep, error)
- func (s *Store) GetExpiredGovernanceProposalsAt(epoch uint64, slot uint64, txn types.Txn) ([]*models.GovernanceProposal, error)
- func (s *Store) GetExpiringGovernanceProposals(epoch uint64, txn types.Txn) ([]*models.GovernanceProposal, error)
- func (s *Store) GetGenesisDelegationForSlot(genesisHash []byte, blockSlot uint64, txn types.Txn) (*models.GenesisDelegation, error)
- func (s *Store) GetGovernanceProposal(txHash []byte, actionIndex uint32, txn types.Txn) (*models.GovernanceProposal, error)
- func (s *Store) GetGovernanceVotes(proposalID uint, txn types.Txn) ([]*models.GovernanceVote, error)
- func (s *Store) GetImportCheckpoint(importKey string, txn types.Txn) (*models.ImportCheckpoint, error)
- func (s *Store) GetLastBlockNonceInRange(startSlot uint64, endSlot uint64, txn types.Txn) ([]byte, error)
- func (s *Store) GetLastEnactedGovernanceProposal(actionTypes []uint8, txn types.Txn) (*models.GovernanceProposal, error)
- func (s *Store) GetLatestBlockNonce(txn types.Txn) (models.BlockNonce, bool, error)
- func (s *Store) GetLatestEpochSummary(txn types.Txn) (*models.EpochSummary, error)
- func (s *Store) GetLatestMidnightAriadneParams(txn types.Txn) (*models.MidnightAriadneParams, error)
- func (s *Store) GetLatestMidnightGovernanceDatum(datumType string, blockNumber uint64, txn types.Txn) (*models.MidnightGovernanceDatum, error)
- func (s *Store) GetLiveStakeInputsForPools(poolKeyHashes [][]byte, expiryEpoch uint64, txn types.Txn) ([]*models.RewardStakeInput, error)
- func (s *Store) GetLiveUtxosBySlot(slot uint64, txn types.Txn) ([]models.UtxoId, error)
- func (s *Store) GetMIRCertsInSlotRange(startSlot uint64, endSlot uint64, txn types.Txn) ([]models.MIREffect, error)
- func (s *Store) GetMidnightAriadneParamsAtOrBeforeEpoch(epoch uint64, txn types.Txn) (*models.MidnightAriadneParams, error)
- func (s *Store) GetMidnightAriadneParamsByEpoch(epoch uint64, txn types.Txn) (*models.MidnightAriadneParams, error)
- func (s *Store) GetMidnightCandidates(address ledger.Address, txn types.Txn) ([]models.Utxo, error)
- func (s *Store) GetMidnightCommitteeCandidateRegistrationsByTxHashes(txHashes [][]byte, txn types.Txn) ([]models.MidnightCommitteeCandidateRegistration, error)
- func (s *Store) GetMidnightEpochCandidatesByEpoch(epoch uint64, txn types.Txn) (*models.MidnightEpochCandidates, error)
- func (s *Store) GetNetworkState(txn types.Txn) (*models.NetworkState, error)
- func (s *Store) GetNodeSettings() (*types.NodeSettings, error)
- func (s *Store) GetNodeSettingsGates() (nodesettings.Values, error)
- func (s *Store) GetOffchainMetadata(sourceType string, url string, hash []byte, txn types.Txn) (*models.OffchainMetadata, error)
- func (s *Store) GetOffchainMetadataBatch(sourceType string, urls []string, txn types.Txn) ([]models.OffchainMetadata, error)
- func (s *Store) GetOffchainMetadataFetchBatch(ctx context.Context, limit int, now time.Time, txn types.Txn) ([]models.OffchainMetadata, error)
- func (s *Store) GetPParamUpdates(epoch uint64, txn types.Txn) ([]models.PParamUpdate, error)
- func (s *Store) GetPParams(epoch uint64, eraID uint, txn types.Txn) ([]models.PParams, error)
- func (s *Store) GetPool(poolKeyHash lcommon.PoolKeyHash, includeInactive bool, txn types.Txn) (*models.Pool, error)
- func (s *Store) GetPoolBlockIssuersInSlotRange(startSlot uint64, endSlot uint64, txn types.Txn) ([]models.PoolOpCertSequence, error)
- func (s *Store) GetPoolByVrfKeyHash(vrfKeyHash []byte, txn types.Txn) (*models.Pool, error)
- func (s *Store) GetPoolCertificateHistory(pkh lcommon.PoolKeyHash, txn types.Txn) ([][]byte, [][]byte, error)
- func (s *Store) GetPoolOwnerStakeAtSlot(ownerKeys [][]byte, slot uint64, expiryEpoch uint64, inactivityPeriod uint64, ...) (map[string]uint64, error)
- func (s *Store) GetPoolRegistrations(poolKeyHash lcommon.PoolKeyHash, txn types.Txn) ([]lcommon.PoolRegistrationCertificate, error)
- func (s *Store) GetPoolRegistrationsAtSlot(poolKeyHashes []lcommon.PoolKeyHash, slot uint64, txn types.Txn) ([]models.PoolRegistration, error)
- func (s *Store) GetPoolRegistrationsEffectiveForEpoch(poolKeyHashes []lcommon.PoolKeyHash, epochStartSlot uint64, endedEpoch uint64, ...) ([]models.PoolRegistration, error)
- func (s *Store) GetPoolStakeSnapshot(epoch uint64, snapshotType string, poolKeyHash []byte, txn types.Txn) (*models.PoolStakeSnapshot, error)
- func (s *Store) GetPoolStakeSnapshotsByEpoch(epoch uint64, snapshotType string, txn types.Txn) ([]*models.PoolStakeSnapshot, error)
- func (s *Store) GetPoolStakeSnapshotsForPools(epoch uint64, snapshotType string, poolKeyHashes [][]byte, txn types.Txn) ([]*models.PoolStakeSnapshot, error)
- func (s *Store) GetPools(poolKeyHashes []lcommon.PoolKeyHash, txn types.Txn) ([]models.Pool, error)
- func (s *Store) GetPoolsRetiringAtEpoch(epoch uint64, boundarySlot uint64, txn types.Txn) ([]models.PoolRetirementRefund, error)
- func (s *Store) GetPredefinedDrepFirstSeenSlots(txn types.Txn) (map[uint64]uint64, error)
- func (s *Store) GetRatifiedGovernanceProposals(txn types.Txn) ([]*models.GovernanceProposal, error)
- func (s *Store) GetResignedCommitteeMembers(coldKeys [][]byte, txn types.Txn) (map[string]bool, error)
- func (s *Store) GetRetiringPools(currentEpoch uint64, txn types.Txn) ([]models.PoolRetiringRow, error)
- func (s *Store) GetRewardAccountOutputs(epoch uint64, txn types.Txn) ([]*models.RewardAccountOutput, error)
- func (s *Store) GetRewardAccountOutputsByCredential(credentialTag uint8, stakingKey []byte, limit int, offset int, order string, ...) ([]*models.RewardAccountOutput, error)
- func (s *Store) GetRewardAdaPots(epoch uint64, txn types.Txn) (*models.RewardAdaPots, error)
- func (s *Store) GetRewardPoolInputs(epoch uint64, txn types.Txn) ([]*models.RewardPoolInput, error)
- func (s *Store) GetRewardPoolOutputs(epoch uint64, txn types.Txn) ([]*models.RewardPoolOutput, error)
- func (s *Store) GetRewardSnapshot(epoch uint64, snapshotType string, txn types.Txn) (*models.RewardSnapshot, error)
- func (s *Store) GetRewardStakeInputs(epoch uint64, txn types.Txn) ([]*models.RewardStakeInput, error)
- func (s *Store) GetRewardStakeInputsForPools(poolKeyHashes [][]byte, slot uint64, expiryEpoch uint64, ...) ([]*models.RewardStakeInput, error)
- func (s *Store) GetScript(hash lcommon.ScriptHash, txn types.Txn) (*models.Script, error)
- func (s *Store) GetScriptLockedSupply(txn types.Txn) (uint64, error)
- func (s *Store) GetStakeByPool(poolKeyHash []byte, txn types.Txn) (uint64, uint64, error)
- func (s *Store) GetStakeByPools(poolKeyHashes [][]byte, txn types.Txn) (map[string]uint64, map[string]uint64, error)
- func (s *Store) GetStakeByPoolsAtSlot(poolKeyHashes [][]byte, slot uint64, expiryEpoch uint64, ...) (map[string]uint64, map[string]uint64, error)
- func (s *Store) GetStakeRegistrationsByCredential(credentialTag uint8, stakingKey []byte, txn types.Txn) ([]lcommon.StakeRegistrationCertificate, error)
- func (s *Store) GetSyncState(key string, txn types.Txn) (string, error)
- func (s *Store) GetTip(txn types.Txn) (ochainsync.Tip, error)
- func (s *Store) GetTotalActiveStake(epoch uint64, snapshotType string, txn types.Txn) (uint64, error)
- func (s *Store) GetTransactionByHash(hash []byte, txn types.Txn) (*models.Transaction, error)
- func (s *Store) GetTransactionHashesAfterSlot(slot uint64, txn types.Txn) ([][]byte, error)
- func (s *Store) GetTransactionIDByHash(hash []byte, txn types.Txn) (uint, bool, error)
- func (s *Store) GetTransactionMetadataByHash(hash []byte, txn types.Txn) ([]byte, error)
- func (s *Store) GetTransactionSlotByHash(hash []byte, txn types.Txn) (uint64, bool, error)
- func (s *Store) GetTransactionsByAddress(paymentKey []byte, credentialTag uint8, stakingKey []byte, limit int, ...) ([]models.Transaction, error)
- func (s *Store) GetTransactionsByBlockHash(blockHash []byte, txn types.Txn) ([]models.Transaction, error)
- func (s *Store) GetTransactionsByHashes(hashes [][]byte, txn types.Txn) ([]models.Transaction, error)
- func (s *Store) GetTransactionsByMetadataLabel(label uint64, limit int, offset int, descending bool, txn types.Txn) ([]models.Transaction, error)
- func (s *Store) GetUtxo(txID []byte, index uint32, txn types.Txn) (*models.Utxo, error)
- func (s *Store) GetUtxoBalanceByAddress(address lcommon.Address, mode models.UtxoAddressMatchMode, txn types.Txn) (models.AddressBalance, error)
- func (s *Store) GetUtxoIncludingSpent(txID []byte, index uint32, txn types.Txn) (*models.Utxo, error)
- func (s *Store) GetUtxoPaymentScriptByCredential(credentialTag uint8, stakingKey []byte, paymentKeys [][]byte, txn types.Txn) (map[string]bool, error)
- func (s *Store) GetUtxosAddedAfterSlot(slot uint64, txn types.Txn) ([]models.Utxo, error)
- func (s *Store) GetUtxosByAddress(pattern models.UtxoAddressPattern, txn types.Txn) ([]models.Utxo, error)
- func (s *Store) GetUtxosByAddressAtSlot(pattern models.UtxoAddressPattern, slot uint64, txn types.Txn) ([]models.Utxo, error)
- func (s *Store) GetUtxosByAddressWithOrdering(query *models.UtxoWithOrderingQuery, txn types.Txn) ([]models.UtxoWithOrdering, error)
- func (s *Store) GetUtxosByAssets(policyID []byte, assetName []byte, txn types.Txn) ([]models.Utxo, error)
- func (s *Store) GetUtxosBySlot(slot uint64, txn types.Txn) ([]models.UtxoId, error)
- func (s *Store) GetUtxosDeletedBeforeSlot(slot uint64, limit int, txn types.Txn) ([]models.Utxo, error)
- func (s *Store) HasDeferredIndexesPending() (bool, error)
- func (s *Store) ImportAccount(account *models.Account, txn types.Txn) error
- func (s *Store) ImportDrep(drep *models.Drep, registration *models.RegistrationDrep, txn types.Txn) error
- func (s *Store) ImportPool(pool *models.Pool, registration *models.PoolRegistration, txn types.Txn) error
- func (s *Store) ImportUtxos(utxos []models.Utxo, txn types.Txn) error
- func (s *Store) InsertDrepIfAbsent(credentialTag uint8, credential []byte, slot uint64, url string, hash []byte, ...) error
- func (s *Store) InsertMidnightCommitteeCandidateRegistration(txn types.Txn, row *models.MidnightCommitteeCandidateRegistration) error
- func (s *Store) InsertMidnightGovernanceDatum(txn types.Txn, datum *models.MidnightGovernanceDatum) error
- func (s *Store) InsertNodeSettingsGateIfAbsent(name string, value string, recordedEpoch uint64, recordedSlot uint64) (bool, error)
- func (s *Store) InsertNodeSettingsGatesIfAbsent(gates nodesettings.Values, recordedEpoch uint64, recordedSlot uint64) (bool, error)
- func (s *Store) IsCommitteeMemberResigned(coldKey []byte, txn types.Txn) (bool, error)
- func (s *Store) IterateLiveUtxos(txn types.Txn, fn func(*models.Utxo) error) error
- func (s *Store) LatestPoolOpCertSequence(poolKeyHash lcommon.PoolKeyHash, txn types.Txn) (uint64, bool, error)
- func (s *Store) LatestPoolOpCertSequences(txn types.Txn) (map[string]uint64, error)
- func (s *Store) MarkUtxosDeletedAtSlot(txn types.Txn, refs []types.UtxoKey, atSlot uint64) error
- func (s *Store) NewBatchAccumulator() types.MetadataBatchAccumulator
- func (s *Store) ReadPoolStats() sql.DBStats
- func (s *Store) ReadTransaction() types.Txn
- func (s *Store) Ready() bool
- func (s *Store) RebuildRewardLiveStake(slot uint64, txn types.Txn) error
- func (s *Store) RecomputeGapCollateralFee(transaction lcommon.Transaction, _ ocommon.Point, txn types.Txn) error
- func (s *Store) ReleaseFallbackRewardSnapshotGuard(guardID uint, txn types.Txn) error
- func (s *Store) RenewAccountExpirations(refs []models.StakeCredentialRef, expirationEpoch uint64, txn types.Txn) error
- func (s *Store) ResetAccountExpirationActivation(txn types.Txn) ([]models.StakeCredentialRef, error)
- func (s *Store) RestoreAccountStateAtSlot(slot uint64, txn types.Txn) error
- func (s *Store) RestoreDrepStateAtSlot(slot uint64, txn types.Txn) error
- func (s *Store) RestoreFrom(ctx context.Context, srcPath string) error
- func (s *Store) RestoreNormalPragmas() error
- func (s *Store) RestorePoolStateAtSlot(slot uint64, txn types.Txn) error
- func (s *Store) RetirePools(txn types.Txn, poolKeyHashes [][]byte, epoch uint64, addedSlot uint64) error
- func (s *Store) RewardLiveStakeNeedsBackfill(txn types.Txn) (bool, error)
- func (s *Store) SaveEpochSummary(summary *models.EpochSummary, txn types.Txn) error
- func (s *Store) SavePoolStakeSnapshot(snapshot *models.PoolStakeSnapshot, txn types.Txn) error
- func (s *Store) SavePoolStakeSnapshots(snapshots []*models.PoolStakeSnapshot, txn types.Txn) error
- func (s *Store) SaveRewardAccountOutputs(outputs []*models.RewardAccountOutput, txn types.Txn) error
- func (s *Store) SaveRewardAdaPots(pots *models.RewardAdaPots, txn types.Txn) error
- func (s *Store) SaveRewardPoolInputs(inputs []*models.RewardPoolInput, txn types.Txn) error
- func (s *Store) SaveRewardPoolOutputs(outputs []*models.RewardPoolOutput, txn types.Txn) error
- func (s *Store) SaveRewardSnapshot(snapshot *models.RewardSnapshot, txn types.Txn) error
- func (s *Store) SaveRewardStakeInputs(inputs []*models.RewardStakeInput, txn types.Txn) error
- func (s *Store) SetBackfillCheckpoint(checkpoint *models.BackfillCheckpoint, txn types.Txn) error
- func (s *Store) SetBlockNonce(blockHash []byte, slotNumber uint64, nonce []byte, isCheckpoint bool, ...) error
- func (s *Store) SetBulkLoadPragmas() error
- func (s *Store) SetCommitTimestamp(timestamp int64, txn types.Txn) error
- func (s *Store) SetCommitteeMembers(members []*models.CommitteeMember, txn types.Txn) error
- func (s *Store) SetCommitteeQuorum(quorum *types.Rat, slot uint64, txn types.Txn) error
- func (s *Store) SetConstitution(constitution *models.Constitution, txn types.Txn) error
- func (s *Store) SetDatum(hash lcommon.Blake2b256, rawDatum []byte, addedSlot uint64, txn types.Txn) error
- func (s *Store) SetDrep(credentialTag uint8, credential []byte, slot uint64, url string, hash []byte, ...) error
- func (s *Store) SetEpoch(slot, epoch uint64, ...) error
- func (s *Store) SetGapBlockTransaction(transaction lcommon.Transaction, point ocommon.Point, index uint32, ...) error
- func (s *Store) SetGenesisGovernance(initialDReps conway.ConwayGenesisInitialDReps, ...) error
- func (s *Store) SetGenesisStaking(pools map[string]lcommon.PoolRegistrationCertificate, ...) error
- func (s *Store) SetGenesisTransaction(hash []byte, blockHash []byte, outputs []models.Utxo, txn types.Txn) error
- func (s *Store) SetGovernanceProposal(proposal *models.GovernanceProposal, txn types.Txn) error
- func (s *Store) SetGovernanceVote(vote *models.GovernanceVote, txn types.Txn) error
- func (s *Store) SetImportCheckpoint(checkpoint *models.ImportCheckpoint, txn types.Txn) error
- func (s *Store) SetNetworkState(treasury, reserves uint64, slot uint64, txn types.Txn) error
- func (s *Store) SetNodeSettings(settings *types.NodeSettings) error
- func (s *Store) SetNodeSettingsGates(gates nodesettings.Values, recordedEpoch uint64, recordedSlot uint64) error
- func (s *Store) SetOffchainMetadataFetchResult(ctx context.Context, doc *models.OffchainMetadata, txn types.Txn) error
- func (s *Store) SetPParamUpdate(genesis, update []byte, slot, epoch uint64, txn types.Txn) error
- func (s *Store) SetPParams(params []byte, slot, epoch uint64, eraID uint, txn types.Txn) error
- func (s *Store) SetSyncState(key, value string, txn types.Txn) error
- func (s *Store) SetTip(tip ochainsync.Tip, txn types.Txn) error
- func (s *Store) SetTransaction(transaction lcommon.Transaction, point ocommon.Point, index uint32, ...) error
- func (s *Store) SetTransactionBatched(transaction lcommon.Transaction, point ocommon.Point, index uint32, ...) error
- func (s *Store) SetUtxoDeletedAtSlot(input ledger.TransactionInput, slot uint64, spenderTxHash []byte, ...) error
- func (s *Store) SetUtxosNotDeletedAfterSlot(slot uint64, txn types.Txn) error
- func (s *Store) SoftDeleteAllCommitteeMembers(slot uint64, txn types.Txn) error
- func (s *Store) SoftDeleteCommitteeMembers(coldCredHashes [][]byte, slot uint64, txn types.Txn) error
- func (s *Store) StaleConsensusStakeSnapshotsExist(txn types.Txn) (bool, error)
- func (s *Store) StampAllActiveAccountExpirations(expirationEpoch uint64, txn types.Txn) (int64, error)
- func (s *Store) Start(ctx context.Context) error
- func (s *Store) SumNetworkDonationsForEpoch(epoch uint64, txn types.Txn) (uint64, error)
- func (s *Store) SumTransactionFeesInSlotRange(startSlot uint64, endSlot uint64, txn types.Txn) (uint64, error)
- func (s *Store) Transaction() types.Txn
- func (s *Store) UpdateDRepActivity(credentialTag uint8, credential []byte, activityEpoch uint64, ...) error
- func (s *Store) UpdatePlannerStats() error
- func (s *Store) UpdatePoolOpCertSequence(poolKeyHash lcommon.PoolKeyHash, sequence uint64, slot uint64, txn types.Txn) error
- func (s *Store) UpsertMidnightAriadneParams(txn types.Txn, params *models.MidnightAriadneParams) error
- func (s *Store) UpsertMidnightEpochCandidates(txn types.Txn, epochCandidates *models.MidnightEpochCandidates) error
- func (s *Store) WritePoolStats() sql.DBStats
Constants ¶
const LatestPoolOpCertSequencesSQL = `
SELECT pool_key_hash, MAX(sequence)
FROM pool_opcert_sequence
GROUP BY pool_key_hash`
LatestPoolOpCertSequencesSQL is the statement LatestPoolOpCertSequences issues.
Exported so a test can pin its query plan against the statement the store actually runs. The index this reads is only worth its write cost while the planner chooses it, and a test EXPLAINing a hand-copied statement would keep passing against the copy after the store's own SQL moved off the index.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
WriteDB *sql.DB
ReadDB *sql.DB
Dialect Dialect
Logger *slog.Logger
// StorageMode controls retention of API-only transaction detail. Empty
// selects the consensus-focused core mode.
StorageMode string
Migrations []migrations.Migration
MigrationLocker migrations.Locker
DiskSize func() (int64, error)
// Maintenance is optional backend maintenance started only after the
// migration readiness gate succeeds. SQLite uses it for periodic VACUUM.
Maintenance func(context.Context) error
MaintenanceInterval time.Duration
// BackupTo and RestoreFrom are optional provider-owned lifecycle hooks.
// SQLite supplies them for its file-backed store; other dialects may leave
// them unset until a native snapshot mechanism is available.
BackupTo func(context.Context, string) error
RestoreFrom func(context.Context, string) error
}
Config contains backend-neutral dependencies for a Store.
type Dialect ¶
type Dialect interface {
Name() string
Rebind(string) string
QuoteIdentifier(string) string
ParameterLimit() int
BeginOptions(readOnly bool) *sql.TxOptions
SetBulkMode(context.Context, Execer) error
RestoreNormalMode(context.Context, Execer) error
UpdatePlannerStats(context.Context, Execer) error
DropIndexSQL(name, table string) string
CreateIndexSQL(name, table string, columns []string) string
CanDropIndex(name, table string) bool
}
Dialect is the deliberately small backend capability boundary. Metadata orchestration belongs in Store; only SQL mechanics and backend tuning belong behind this interface.
func MySQLDialect ¶
func MySQLDialect() Dialect
MySQLDialect returns MySQL database/sql capabilities.
func PostgresDialect ¶
func PostgresDialect() Dialect
PostgresDialect returns PostgreSQL database/sql capabilities.
func SQLiteDialect ¶
func SQLiteDialect() Dialect
SQLiteDialect returns the capabilities used by the pure-Go SQLite driver.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns the shared database/sql pools. Provider packages own DSN and driver selection; metadata behavior belongs here.
func (*Store) AccountInactivityActivationMembership ¶
func (*Store) AccountLastWitnessSlots ¶
func (*Store) AccountsWitnessedAfterSlot ¶
func (*Store) AddAccountRewardByCredential ¶
func (*Store) AddNetworkDonation ¶
func (*Store) AddPostSnapshotAccountRewardByCredential ¶
func (*Store) ApplyAccountRewardWithdrawal ¶
func (*Store) BuildCriticalDeferredIndexes ¶
BuildCriticalDeferredIndexes restores the indexes needed before API and rollback traffic begins. The recovery marker stays set until the full manifest is restored.
func (*Store) BuildDeferredIndexes ¶
BuildDeferredIndexes restores the full manifest and clears the durable recovery marker in the same transaction.
func (*Store) ClaimFallbackRewardSnapshot ¶
func (*Store) ClaimFallbackRewardSnapshotGuard ¶
func (*Store) ClearCommitteeQuorum ¶
func (*Store) ClearDanglingDRepDelegations ¶
func (*Store) CloseContext ¶
CloseContext cancels maintenance and closes each owned pool. The lifecycle context is also passed to the maintenance wait so cancellation can interrupt a long-running VACUUM before the provider shutdown deadline expires.
func (*Store) CountAccountDelegationHistoryByCredential ¶
func (*Store) CountAccountRegistrationHistoryByCredential ¶
func (*Store) CountAccountWithdrawalHistoryByCredential ¶
func (*Store) CountAddressTransactionsByCredential ¶
func (*Store) CountAddressesByCredential ¶
func (*Store) CountPoolBlocksInSlotRange ¶
func (*Store) CountRewardAccountOutputsByCredential ¶
func (*Store) CountTransactionsByAddress ¶
func (*Store) CountTransactionsByMetadataLabel ¶
func (*Store) CountTransactionsByPaymentCred ¶
func (*Store) CountTransactionsInSlotRange ¶
func (*Store) CreateAccount ¶
func (*Store) CreateMidnightAriadneRollback ¶
func (*Store) CreateMidnightAssetCreate ¶
func (*Store) CreateMidnightAssetSpend ¶
func (*Store) CreateMidnightDeregistration ¶
func (*Store) CreateMidnightRegistration ¶
func (*Store) DeactivateAccounts ¶
func (*Store) DeactivateDreps ¶
func (*Store) DeleteAccountRewardsAfterSlot ¶
func (*Store) DeleteAddressTransactionsAfterSlot ¶
func (*Store) DeleteBlockNoncesAfterPoint ¶
func (*Store) DeleteBlockNoncesBeforeSlot ¶
func (*Store) DeleteBlockNoncesBeforeSlotWithoutCheckpoints ¶
func (*Store) DeleteCertificatesAfterSlot ¶
func (*Store) DeleteCommitteeMembersAfterSlot ¶
func (*Store) DeleteConstitutionsAfterSlot ¶
func (*Store) DeleteEpochSummariesAfterEpoch ¶
func (*Store) DeleteEpochsAfterSlot ¶
func (*Store) DeleteGovernanceProposalsAfterSlot ¶
func (*Store) DeleteGovernanceVotesAfterSlot ¶
func (*Store) DeleteMidnightAriadneParamsByEpoch ¶
func (*Store) DeleteMidnightAriadneRollbacksBeforeBlock ¶
func (*Store) DeleteMidnightAriadneRollbacksByBlock ¶
func (*Store) DeleteMidnightAssetCreatesByBlock ¶
func (*Store) DeleteMidnightAssetSpendsByBlock ¶
func (*Store) DeleteMidnightCommitteeCandidateRegistrationsByBlock ¶
func (*Store) DeleteMidnightDeregistrationsByBlock ¶
func (*Store) DeleteMidnightEpochCandidatesByBlock ¶
func (*Store) DeleteMidnightGovernanceDatumsByBlock ¶
func (*Store) DeleteMidnightRegistrationsByBlock ¶
func (*Store) DeleteNetworkDonationsAfterSlot ¶
func (*Store) DeleteNetworkStateAfterSlot ¶
func (*Store) DeletePParamUpdatesAfterSlot ¶
func (*Store) DeletePParamsAfterSlot ¶
func (*Store) DeletePoolStakeSnapshotsAfterEpoch ¶
func (*Store) DeletePoolStakeSnapshotsBeforeEpoch ¶
func (*Store) DeletePoolStakeSnapshotsForEpoch ¶
func (*Store) DeleteRewardInputsForEpoch ¶
func (*Store) DeleteRewardOutputsForEpoch ¶
func (*Store) DeleteRewardStakeInputBeforeEpoch ¶
func (*Store) DeleteRewardStateAfterSlot ¶
func (*Store) DeleteRewardStateBeforeEpoch ¶
func (*Store) DeleteTransactionMetadataLabelsAfterSlot ¶
func (*Store) DeleteTransactionsAfterSlot ¶
func (*Store) DeleteUtxos ¶
func (*Store) DeleteUtxosAfterSlot ¶
func (*Store) DropDeferredIndexes ¶
DropDeferredIndexes records the durable recovery marker and drops the manifest in one SQLite transaction.
func (*Store) EnsureOffchainMetadataPointers ¶
func (*Store) FindMidnightAriadneRollbacksByBlock ¶
func (*Store) FindMidnightAssetCreatesFrom ¶
func (*Store) FindMidnightAssetSpendsFrom ¶
func (*Store) FindMidnightDeregistrationsFrom ¶
func (*Store) FindMidnightRegistrationsFrom ¶
func (*Store) FindUnspentMidnightAssetCreates ¶
func (s *Store) FindUnspentMidnightAssetCreates() ( []models.MidnightAssetCreate, error, )
func (*Store) FindUnspentMidnightRegistrations ¶
func (s *Store) FindUnspentMidnightRegistrations() ( []models.MidnightRegistration, error, )
func (*Store) FlushBatch ¶
func (*Store) GetAccountByCredential ¶
func (*Store) GetAccountDelegationHistoryByCredential ¶
func (*Store) GetAccountRegistrationHistoryByCredential ¶
func (*Store) GetAccountSumsByCredential ¶
func (*Store) GetAccountWithdrawalHistoryByCredential ¶
func (*Store) GetAccountsActiveAtSlot ¶
func (*Store) GetAccountsByCredential ¶
func (*Store) GetActiveAccountCredentials ¶
func (*Store) GetActiveCommitteeMembers ¶
func (*Store) GetActiveDreps ¶
func (*Store) GetActiveGovernanceProposals ¶
func (*Store) GetActivePoolKeyHashes ¶
func (*Store) GetActivePoolKeyHashesAtSlot ¶
func (*Store) GetActivePoolKeyHashesOrdered ¶
func (*Store) GetActivePoolRelays ¶
GetActivePoolRelays returns relays from each active pool's latest registration. The query uses the same chain-position ordering as active-pool selection and avoids loading historical registrations into memory.
func (*Store) GetAddressTransactionsByCredential ¶
func (s *Store) GetAddressTransactionsByCredential( credentialTag uint8, stakingKey []byte, limit int, offset int, order string, from *models.AddressTransactionPosition, to *models.AddressTransactionPosition, txn types.Txn, ) ([]models.AccountTransactionAssociationRow, error)
func (*Store) GetAddressesByCredential ¶
func (*Store) GetAssetByPolicyAndName ¶
func (*Store) GetAssetMintBurnInfo ¶
func (*Store) GetAssetQuantityByPolicyAndName ¶
func (*Store) GetBackfillCheckpoint ¶
func (*Store) GetBlockNonce ¶
func (*Store) GetBlockNoncesInSlotRange ¶
func (*Store) GetBlockSlotRangeStats ¶
func (*Store) GetChildGovernanceProposals ¶
func (*Store) GetCommitTimestamp ¶
func (*Store) GetCommitteeActiveCount ¶
func (*Store) GetCommitteeMember ¶
func (*Store) GetCommitteeMembers ¶
func (*Store) GetCommitteeMembersIncludeDeleted ¶
func (*Store) GetCommitteeQuorum ¶
func (*Store) GetConstitution ¶
func (*Store) GetControlledAmountByCredential ¶
func (*Store) GetDRepDelegators ¶
func (*Store) GetDRepVotingPower ¶
func (*Store) GetDRepVotingPowerBatch ¶
func (*Store) GetDRepVotingPowerByType ¶
func (*Store) GetDrepByCredential ¶
func (*Store) GetDrepLastRegistrationSlot ¶
func (*Store) GetEnactedGovernanceProposalsAt ¶
func (*Store) GetEpochBoundaryRewardStakeInputsForPools ¶
func (*Store) GetEpochBoundaryStakeByPools ¶
func (*Store) GetEpochBySlot ¶
func (*Store) GetEpochSummary ¶
func (*Store) GetEpochsByEra ¶
func (*Store) GetExpiredDReps ¶
func (*Store) GetExpiredGovernanceProposalsAt ¶
func (*Store) GetExpiringGovernanceProposals ¶
func (*Store) GetGenesisDelegationForSlot ¶
func (*Store) GetGovernanceProposal ¶
func (*Store) GetGovernanceVotes ¶
func (*Store) GetImportCheckpoint ¶
func (*Store) GetLastBlockNonceInRange ¶
func (*Store) GetLastEnactedGovernanceProposal ¶
func (*Store) GetLatestBlockNonce ¶
GetLatestBlockNonce returns the highest-slot nonce row. The nonce is written in the same metadata transaction as the corresponding ledger effects, so this row is the durable ledger-state high-water mark.
func (*Store) GetLatestEpochSummary ¶
func (*Store) GetLatestMidnightAriadneParams ¶
func (*Store) GetLatestMidnightGovernanceDatum ¶
func (*Store) GetLiveStakeInputsForPools ¶
func (*Store) GetLiveUtxosBySlot ¶
func (*Store) GetMIRCertsInSlotRange ¶
func (*Store) GetMidnightAriadneParamsAtOrBeforeEpoch ¶
func (*Store) GetMidnightAriadneParamsByEpoch ¶
func (*Store) GetMidnightCandidates ¶
func (*Store) GetMidnightCommitteeCandidateRegistrationsByTxHashes ¶
func (*Store) GetMidnightEpochCandidatesByEpoch ¶
func (*Store) GetNetworkState ¶
func (*Store) GetNodeSettings ¶
func (s *Store) GetNodeSettings() (*types.NodeSettings, error)
func (*Store) GetNodeSettingsGates ¶
func (s *Store) GetNodeSettingsGates() (nodesettings.Values, error)
GetNodeSettingsGates returns the persisted node settings gate values, keyed by gate name. An empty result means no gates have been recorded yet.
func (*Store) GetOffchainMetadata ¶
func (*Store) GetOffchainMetadataBatch ¶
func (*Store) GetOffchainMetadataFetchBatch ¶
func (*Store) GetPParamUpdates ¶
func (*Store) GetPParams ¶
func (*Store) GetPoolBlockIssuersInSlotRange ¶
func (*Store) GetPoolByVrfKeyHash ¶
func (*Store) GetPoolCertificateHistory ¶
func (*Store) GetPoolOwnerStakeAtSlot ¶
func (*Store) GetPoolRegistrations ¶
func (s *Store) GetPoolRegistrations( poolKeyHash lcommon.PoolKeyHash, txn types.Txn, ) ([]lcommon.PoolRegistrationCertificate, error)
GetPoolRegistrations reconstructs the ledger certificates for a pool.
func (*Store) GetPoolRegistrationsAtSlot ¶
func (s *Store) GetPoolRegistrationsAtSlot( poolKeyHashes []lcommon.PoolKeyHash, slot uint64, txn types.Txn, ) ([]models.PoolRegistration, error)
GetPoolRegistrationsAtSlot returns the latest registration for every requested pool at or before slot. Certificate position breaks same-slot ties, with the row ID as a deterministic final fallback.
func (*Store) GetPoolRegistrationsEffectiveForEpoch ¶
func (*Store) GetPoolStakeSnapshot ¶
func (*Store) GetPoolStakeSnapshotsByEpoch ¶
func (*Store) GetPoolStakeSnapshotsForPools ¶
func (s *Store) GetPoolStakeSnapshotsForPools( epoch uint64, snapshotType string, poolKeyHashes [][]byte, txn types.Txn, ) ([]*models.PoolStakeSnapshot, error)
GetPoolStakeSnapshotsForPools returns the snapshot rows for just the pools named, for a caller that wants a bounded subset rather than a whole epoch.
A named pool with no row is simply absent from the result: the snapshot holds a row per pool with stake, so a pool it does not hold has no stake in that snapshot rather than a stake of zero.
The read is chunked over the dialect's parameter limit rather than issued per pool, so a large filter costs a bounded number of round trips instead of one per pool named.
func (*Store) GetPoolsRetiringAtEpoch ¶
func (*Store) GetPredefinedDrepFirstSeenSlots ¶
func (*Store) GetRatifiedGovernanceProposals ¶
func (*Store) GetResignedCommitteeMembers ¶
func (*Store) GetRetiringPools ¶
func (*Store) GetRewardAccountOutputs ¶
func (*Store) GetRewardAccountOutputsByCredential ¶
func (*Store) GetRewardAdaPots ¶
func (*Store) GetRewardPoolInputs ¶
func (*Store) GetRewardPoolOutputs ¶
func (*Store) GetRewardSnapshot ¶
func (*Store) GetRewardStakeInputs ¶
func (*Store) GetRewardStakeInputsForPools ¶
func (*Store) GetScriptLockedSupply ¶
func (*Store) GetStakeByPool ¶
func (*Store) GetStakeByPools ¶
func (*Store) GetStakeByPoolsAtSlot ¶
func (*Store) GetStakeRegistrationsByCredential ¶
func (*Store) GetSyncState ¶
func (*Store) GetTotalActiveStake ¶
func (*Store) GetTransactionByHash ¶
func (*Store) GetTransactionHashesAfterSlot ¶
func (*Store) GetTransactionIDByHash ¶
func (*Store) GetTransactionMetadataByHash ¶
func (*Store) GetTransactionSlotByHash ¶
func (*Store) GetTransactionsByAddress ¶
func (*Store) GetTransactionsByBlockHash ¶
func (*Store) GetTransactionsByHashes ¶
func (*Store) GetTransactionsByMetadataLabel ¶
func (*Store) GetUtxoBalanceByAddress ¶
func (s *Store) GetUtxoBalanceByAddress( address lcommon.Address, mode models.UtxoAddressMatchMode, txn types.Txn, ) (models.AddressBalance, error)
func (*Store) GetUtxoIncludingSpent ¶
func (*Store) GetUtxoPaymentScriptByCredential ¶
func (*Store) GetUtxosAddedAfterSlot ¶
func (*Store) GetUtxosByAddress ¶
func (*Store) GetUtxosByAddressAtSlot ¶
func (*Store) GetUtxosByAddressWithOrdering ¶
func (s *Store) GetUtxosByAddressWithOrdering( query *models.UtxoWithOrderingQuery, txn types.Txn, ) ([]models.UtxoWithOrdering, error)
func (*Store) GetUtxosByAssets ¶
func (*Store) GetUtxosBySlot ¶
func (*Store) GetUtxosDeletedBeforeSlot ¶
func (*Store) HasDeferredIndexesPending ¶
HasDeferredIndexesPending reports whether a prior drop/rebuild cycle still owns the durable recovery marker.
func (*Store) ImportAccount ¶
func (*Store) ImportDrep ¶
func (*Store) ImportPool ¶
func (*Store) ImportUtxos ¶
func (*Store) InsertDrepIfAbsent ¶
func (*Store) InsertMidnightCommitteeCandidateRegistration ¶
func (*Store) InsertMidnightGovernanceDatum ¶
func (*Store) InsertNodeSettingsGateIfAbsent ¶
func (s *Store) InsertNodeSettingsGateIfAbsent( name string, value string, recordedEpoch uint64, recordedSlot uint64, ) (bool, error)
InsertNodeSettingsGateIfAbsent persists a single gate only if no row for name exists yet, reporting whether this call is what created it. Unlike SetNodeSettingsGates's unconditional upsert, this lets a caller detect a concurrent opener's first-ever write to the same gate (see commit_timestamp.go's evaluateAndPersistGates) instead of silently overwriting it -- the loser learns it lost and can re-evaluate against what is now actually persisted rather than assuming its own write landed.
func (*Store) InsertNodeSettingsGatesIfAbsent ¶
func (s *Store) InsertNodeSettingsGatesIfAbsent( gates nodesettings.Values, recordedEpoch uint64, recordedSlot uint64, ) (bool, error)
InsertNodeSettingsGatesIfAbsent inserts a complete first-fill set in one transaction. A concurrent initializer may win the conditional insert for one or more names; in that case the transaction is rolled back so this method never leaves a partially initialized gate set behind.
func (*Store) IsCommitteeMemberResigned ¶
func (*Store) IterateLiveUtxos ¶
func (*Store) LatestPoolOpCertSequence ¶
func (*Store) LatestPoolOpCertSequences ¶
LatestPoolOpCertSequences returns the highest observed op-cert sequence for every pool that has issued a block, keyed by pool key hash.
The issuer table records one row per (pool, slot), so the highest sequence is an aggregate rather than the newest row: a pool that rotated to a lower issue number after a higher one has still had the higher number accepted, and that is the number the chain enforces.
func (*Store) MarkUtxosDeletedAtSlot ¶
func (*Store) NewBatchAccumulator ¶
func (s *Store) NewBatchAccumulator() types.MetadataBatchAccumulator
func (*Store) ReadPoolStats ¶
ReadPoolStats exposes read-pool telemetry. SQLite file stores use this to report their independently-sized WAL reader pool.
func (*Store) ReadTransaction ¶
ReadTransaction begins a repeatable, read-only transaction on the read pool.
func (*Store) RebuildRewardLiveStake ¶
func (*Store) RecomputeGapCollateralFee ¶
func (*Store) ReleaseFallbackRewardSnapshotGuard ¶
func (*Store) RenewAccountExpirations ¶
func (*Store) ResetAccountExpirationActivation ¶
func (*Store) RestoreAccountStateAtSlot ¶
func (*Store) RestoreDrepStateAtSlot ¶
func (*Store) RestoreNormalPragmas ¶
RestoreNormalPragmas restores safe backend defaults.
func (*Store) RestorePoolStateAtSlot ¶
func (*Store) RetirePools ¶
func (*Store) RewardLiveStakeNeedsBackfill ¶
func (*Store) SaveEpochSummary ¶
func (*Store) SavePoolStakeSnapshot ¶
func (*Store) SavePoolStakeSnapshots ¶
func (*Store) SaveRewardAccountOutputs ¶
func (*Store) SaveRewardAdaPots ¶
func (*Store) SaveRewardPoolInputs ¶
func (*Store) SaveRewardPoolOutputs ¶
func (*Store) SaveRewardSnapshot ¶
func (*Store) SaveRewardStakeInputs ¶
func (*Store) SetBackfillCheckpoint ¶
func (*Store) SetBlockNonce ¶
func (*Store) SetBulkLoadPragmas ¶
SetBulkLoadPragmas enables backend-specific session tuning.
func (*Store) SetCommitTimestamp ¶
func (*Store) SetCommitteeMembers ¶
func (*Store) SetCommitteeQuorum ¶
func (*Store) SetConstitution ¶
func (*Store) SetDrep ¶
func (s *Store) SetDrep( credentialTag uint8, credential []byte, slot uint64, url string, hash []byte, active bool, txn types.Txn, ) error
SetDrep updates all mutable registration state. It remains a concrete store helper because existing callers use it even though it is not part of the public MetadataStore interface.
func (*Store) SetGapBlockTransaction ¶
func (*Store) SetGenesisGovernance ¶
func (s *Store) SetGenesisGovernance( initialDReps conway.ConwayGenesisInitialDReps, delegations conway.ConwayGenesisDelegs, _ []byte, txn types.Txn, ) error
func (*Store) SetGenesisStaking ¶
func (*Store) SetGenesisTransaction ¶
func (*Store) SetGovernanceProposal ¶
func (*Store) SetGovernanceVote ¶
func (*Store) SetImportCheckpoint ¶
func (*Store) SetNetworkState ¶
func (*Store) SetNodeSettings ¶
func (s *Store) SetNodeSettings(settings *types.NodeSettings) error
func (*Store) SetNodeSettingsGates ¶
func (s *Store) SetNodeSettingsGates( gates nodesettings.Values, recordedEpoch uint64, recordedSlot uint64, ) error
SetNodeSettingsGates persists gates, upserting one row per entry so a later call can overwrite an earlier one. recordedEpoch and recordedSlot are stamped on every row in this call; callers pass zero for both when the write happens before the first block. A nil or empty gates is a no-op.
func (*Store) SetOffchainMetadataFetchResult ¶
func (*Store) SetPParamUpdate ¶
func (*Store) SetPParams ¶
func (*Store) SetSyncState ¶
func (*Store) SetTransaction ¶
func (*Store) SetTransactionBatched ¶
func (*Store) SetUtxoDeletedAtSlot ¶
func (*Store) SetUtxosNotDeletedAfterSlot ¶
func (*Store) SoftDeleteAllCommitteeMembers ¶
func (*Store) SoftDeleteCommitteeMembers ¶
func (*Store) StaleConsensusStakeSnapshotsExist ¶
func (*Store) StampAllActiveAccountExpirations ¶
func (*Store) Start ¶
Start verifies connectivity and completes every offline migration before making the store available to normal readers or writers.
func (*Store) SumNetworkDonationsForEpoch ¶
func (*Store) SumTransactionFeesInSlotRange ¶
func (*Store) Transaction ¶
Transaction begins a write transaction. Begin failures are retained on the returned transaction because the historical MetadataStore contract cannot return an error from this method.
func (*Store) UpdateDRepActivity ¶
func (*Store) UpdatePlannerStats ¶
UpdatePlannerStats refreshes backend planner statistics.
func (*Store) UpdatePoolOpCertSequence ¶
func (*Store) UpsertMidnightAriadneParams ¶
func (*Store) UpsertMidnightEpochCandidates ¶
func (*Store) WritePoolStats ¶
WritePoolStats exposes database/sql pool telemetry without exposing the underlying database handle.
Source Files
¶
- account.go
- account_history.go
- amounts.go
- asset.go
- certificates.go
- deferred_indexes.go
- dialect.go
- dialect_queryer.go
- drep.go
- genesis.go
- governance.go
- historical_stake.go
- live_stake.go
- management.go
- management_queries.go
- midnight.go
- offchain_metadata.go
- open.go
- operational.go
- pool.go
- reward_state.go
- stake_snapshot.go
- state_primitives.go
- store.go
- transaction_api.go
- transaction_associations.go
- transaction_certificates.go
- transaction_read.go
- transaction_write.go
- utxo.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
Package migrations implements offline, forward-only metadata upgrades.
|
Package migrations implements offline, forward-only metadata upgrades. |