permanent

package
v1.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommitmentBeforeGenesis = ierrors.New("commitment is before genesis")
)

Functions

func WithEpochBasedProviderOptions

func WithEpochBasedProviderOptions(opts ...options.Option[iotago.EpochBasedProvider]) options.Option[Permanent]

Types

type Commitments

type Commitments struct {
	// contains filtered or unexported fields
}

func NewCommitments

func NewCommitments(store kvstore.KVStore, apiProvider iotago.APIProvider) *Commitments

func (*Commitments) Export

func (c *Commitments) Export(writer io.WriteSeeker, targetSlot iotago.SlotIndex) (err error)

func (*Commitments) Import

func (c *Commitments) Import(reader io.ReadSeeker) (err error)

func (*Commitments) Load

func (c *Commitments) Load(slot iotago.SlotIndex) (commitment *model.Commitment, err error)

func (*Commitments) Rollback

func (c *Commitments) Rollback(targetSlot iotago.SlotIndex, lastCommittedSlot iotago.SlotIndex) error

func (*Commitments) Store

func (c *Commitments) Store(commitment *model.Commitment) error

type Permanent

type Permanent struct {
	// contains filtered or unexported fields
}

func Clone

func Clone(source *Permanent, dbConfig database.Config, errorHandler func(error), opts ...options.Option[Permanent]) (*Permanent, error)

func New

func New(dbConfig database.Config, errorHandler func(error), opts ...options.Option[Permanent]) *Permanent

New returns a new permanent storage instance.

func (*Permanent) Accounts

func (p *Permanent) Accounts(optRealm ...byte) kvstore.KVStore

Accounts returns the Accounts storage (or a specialized sub-storage if a realm is provided).

func (*Permanent) Commitments

func (p *Permanent) Commitments() *Commitments

func (*Permanent) Flush

func (p *Permanent) Flush()

func (*Permanent) PruneUTXOLedger

func (p *Permanent) PruneUTXOLedger(epoch iotago.EpochIndex) error

func (*Permanent) Settings

func (p *Permanent) Settings() *Settings

func (*Permanent) Shutdown

func (p *Permanent) Shutdown()

func (*Permanent) Size

func (p *Permanent) Size() int64

Size returns the size of the permanent storage.

func (*Permanent) UTXOLedger

func (p *Permanent) UTXOLedger() *utxoledger.Manager

type Settings

type Settings struct {
	// contains filtered or unexported fields
}

func NewSettings

func NewSettings(store kvstore.KVStore, opts ...options.Option[iotago.EpochBasedProvider]) (settings *Settings)

func (*Settings) APIProvider

func (s *Settings) APIProvider() *iotago.EpochBasedProvider

func (*Settings) AdvanceLatestNonEmptySlot

func (s *Settings) AdvanceLatestNonEmptySlot(slot iotago.SlotIndex) (err error)

func (*Settings) AdvanceLatestStoredSlot

func (s *Settings) AdvanceLatestStoredSlot(slot iotago.SlotIndex) (err error)

func (*Settings) Export

func (s *Settings) Export(writer io.WriteSeeker, targetCommitment *iotago.Commitment) error

func (*Settings) Import

func (s *Settings) Import(reader io.ReadSeeker) (err error)

func (*Settings) IsSnapshotImported

func (s *Settings) IsSnapshotImported() bool

func (*Settings) LatestCommitment

func (s *Settings) LatestCommitment() *model.Commitment

LatestCommitment returns the last created commitment. This method should not be called often as it reads data from the underlying KVStore. For frequent access, use SyncManager.

func (*Settings) LatestFinalizedSlot

func (s *Settings) LatestFinalizedSlot() iotago.SlotIndex

LatestFinalizedSlot returns the last finalized slot. This method should not be called often as it reads data from the underlying KVStore. For frequent access, use SyncManager.

func (*Settings) LatestIssuedValidationBlock

func (s *Settings) LatestIssuedValidationBlock() *model.Block

func (*Settings) LatestNonEmptySlot

func (s *Settings) LatestNonEmptySlot() iotago.SlotIndex

func (*Settings) LatestStoredSlot

func (s *Settings) LatestStoredSlot() iotago.SlotIndex

func (*Settings) Rollback

func (s *Settings) Rollback(targetCommitment *model.Commitment) error

func (*Settings) SetLatestCommitment

func (s *Settings) SetLatestCommitment(latestCommitment *model.Commitment) (err error)

func (*Settings) SetLatestFinalizedSlot

func (s *Settings) SetLatestFinalizedSlot(slot iotago.SlotIndex) (err error)

func (*Settings) SetLatestIssuedValidationBlock

func (s *Settings) SetLatestIssuedValidationBlock(block *model.Block) (err error)

func (*Settings) SetLatestNonEmptySlot

func (s *Settings) SetLatestNonEmptySlot(slot iotago.SlotIndex) (err error)

func (*Settings) SetLatestStoredSlot

func (s *Settings) SetLatestStoredSlot(slot iotago.SlotIndex) (err error)

func (*Settings) SetSnapshotImported

func (s *Settings) SetSnapshotImported() (err error)

func (*Settings) StoreFutureProtocolParametersHash

func (s *Settings) StoreFutureProtocolParametersHash(version iotago.Version, hash iotago.Identifier, epoch iotago.EpochIndex) error

func (*Settings) StoreProtocolParameters

func (s *Settings) StoreProtocolParameters(params iotago.ProtocolParameters) error

func (*Settings) StoreProtocolParametersForStartEpoch

func (s *Settings) StoreProtocolParametersForStartEpoch(params iotago.ProtocolParameters, startEpoch iotago.EpochIndex) error

func (*Settings) String

func (s *Settings) String() string

Jump to

Keyboard shortcuts

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