Documentation ¶
Index ¶
- func WithAllowedDBEngines(optsAllowedDBEngines []hivedb.Engine) options.Option[Storage]
- func WithBucketManagerOptions(opts ...options.Option[prunable.BucketManager]) options.Option[Storage]
- func WithDBEngine(optsDBEngine hivedb.Engine) options.Option[Storage]
- func WithPermanentOptions(opts ...options.Option[permanent.Permanent]) options.Option[Storage]
- func WithPruningDelay(optsPruningDelay iotago.EpochIndex) options.Option[Storage]
- func WithPruningSizeCooldownTime(cooldown time.Duration) options.Option[Storage]
- func WithPruningSizeEnable(pruningSizeEnabled bool) options.Option[Storage]
- func WithPruningSizeMaxTargetSizeBytes(pruningSizeTargetSizeBytes int64) options.Option[Storage]
- func WithPruningSizeReductionPercentage(pruningSizeReductionPercentage float64) options.Option[Storage]
- type Storage
- func (s *Storage) AccountDiffs(slot iotago.SlotIndex) (*slotstore.AccountDiffs, error)
- func (s *Storage) Accounts(optRealm ...byte) kvstore.KVStore
- func (s *Storage) Attestations(slot iotago.SlotIndex) (kvstore.KVStore, error)
- func (s *Storage) Blocks(slot iotago.SlotIndex) (*slotstore.Blocks, error)
- func (s *Storage) Commitments() *permanent.Commitments
- func (s *Storage) Committee() *epochstore.Store[*account.Accounts]
- func (s *Storage) CommitteeCandidates(epoch iotago.EpochIndex) (*kvstore.TypedStore[iotago.AccountID, iotago.SlotIndex], error)
- func (s *Storage) DecidedUpgradeSignals() *epochstore.Store[model.VersionAndHash]
- func (s *Storage) Directory() string
- func (s *Storage) Flush()
- func (s *Storage) GenesisRootBlockID() iotago.BlockID
- func (s *Storage) IsPruning() bool
- func (s *Storage) LastPrunedEpoch() (epoch iotago.EpochIndex, hasPruned bool)
- func (s *Storage) Ledger() *utxoledger.Manager
- func (s *Storage) Mutations(slot iotago.SlotIndex) (kvstore.KVStore, error)
- func (s *Storage) PermanentDatabaseSize() int64
- func (s *Storage) PoolStats() *epochstore.Store[*model.PoolsStats]
- func (s *Storage) PrunableDatabaseSize() int64
- func (s *Storage) PruneByDepth(epochDepth iotago.EpochIndex) (firstPruned iotago.EpochIndex, lastPruned iotago.EpochIndex, err error)
- func (s *Storage) PruneByEpochIndex(epoch iotago.EpochIndex) error
- func (s *Storage) PruneBySize(targetSizeMaxBytes ...int64) error
- func (s *Storage) Reset()
- func (s *Storage) RestoreFromDisk()
- func (s *Storage) Retainer(slot iotago.SlotIndex) (*slotstore.Retainer, error)
- func (s *Storage) Rewards() *epochstore.EpochKVStore
- func (s *Storage) RewardsForEpoch(epoch iotago.EpochIndex) (kvstore.KVStore, error)
- func (s *Storage) Rollback(targetSlot iotago.SlotIndex) error
- func (s *Storage) RootBlocks(slot iotago.SlotIndex) (*slotstore.Store[iotago.BlockID, iotago.CommitmentID], error)
- func (s *Storage) Roots(slot iotago.SlotIndex) (*slotstore.Store[iotago.CommitmentID, *iotago.Roots], error)
- func (s *Storage) Settings() *permanent.Settings
- func (s *Storage) Shutdown()
- func (s *Storage) Size() int64
- func (s *Storage) TryPrune() error
- func (s *Storage) UpgradeSignals(slot iotago.SlotIndex) (*slotstore.Store[account.SeatIndex, *model.SignaledBlock], error)
- func (s *Storage) ValidatorPerformances(slot iotago.SlotIndex) (*slotstore.Store[iotago.AccountID, *model.ValidatorPerformance], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAllowedDBEngines ¶
func WithPermanentOptions ¶
func WithPruningDelay ¶
func WithPruningDelay(optsPruningDelay iotago.EpochIndex) options.Option[Storage]
func WithPruningSizeEnable ¶
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is an abstraction around the storage layer of the node.
func Clone ¶
func Clone(source *Storage, directory string, dbVersion byte, errorHandler func(error), opts ...options.Option[Storage]) (*Storage, error)
Clone creates a new storage instance with the named database version in the given directory and cloning the permannent and prunable counterparts from the given source storage.
func Create ¶
func Create(directory string, dbVersion byte, errorHandler func(error), opts ...options.Option[Storage]) *Storage
Create creates a new storage instance with the named database version in the given directory and initializes its permanent and prunable counterparts.
func New ¶
New creates a new storage instance with the named database version in the given directory.
func (*Storage) AccountDiffs ¶
func (*Storage) Accounts ¶
Accounts returns the Accounts storage (or a specialized sub-storage if a realm is provided).
func (*Storage) Attestations ¶
func (*Storage) Commitments ¶
func (s *Storage) Commitments() *permanent.Commitments
func (*Storage) CommitteeCandidates ¶
func (s *Storage) CommitteeCandidates(epoch iotago.EpochIndex) (*kvstore.TypedStore[iotago.AccountID, iotago.SlotIndex], error)
func (*Storage) DecidedUpgradeSignals ¶
func (s *Storage) DecidedUpgradeSignals() *epochstore.Store[model.VersionAndHash]
func (*Storage) GenesisRootBlockID ¶
func (*Storage) LastPrunedEpoch ¶
func (s *Storage) LastPrunedEpoch() (epoch iotago.EpochIndex, hasPruned bool)
func (*Storage) Ledger ¶
func (s *Storage) Ledger() *utxoledger.Manager
Ledger returns the ledger storage (or a specialized sub-storage if a realm is provided).
func (*Storage) PermanentDatabaseSize ¶
PermanentDatabaseSize returns the size of the underlying permanent database and files.
func (*Storage) PoolStats ¶
func (s *Storage) PoolStats() *epochstore.Store[*model.PoolsStats]
func (*Storage) PrunableDatabaseSize ¶
PrunableDatabaseSize returns the size of the underlying prunable databases.
func (*Storage) PruneByDepth ¶
func (s *Storage) PruneByDepth(epochDepth iotago.EpochIndex) (firstPruned iotago.EpochIndex, lastPruned iotago.EpochIndex, err error)
func (*Storage) PruneByEpochIndex ¶
func (s *Storage) PruneByEpochIndex(epoch iotago.EpochIndex) error
PruneByEpochIndex prunes the database until the given epoch. It returns an error if the epoch is too old or too new. It is to be called by the user e.g. via the WebAPI.
func (*Storage) PruneBySize ¶
func (*Storage) Reset ¶
func (s *Storage) Reset()
Reset resets the component to a clean state as if it was created at the last commitment.
func (*Storage) RestoreFromDisk ¶
func (s *Storage) RestoreFromDisk()
func (*Storage) Rewards ¶
func (s *Storage) Rewards() *epochstore.EpochKVStore