permanent

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0, BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commitments

type Commitments struct {
	module.Module
	// contains filtered or unexported fields
}

func NewCommitments

func NewCommitments(path string) (newCommitment *Commitments)

func (*Commitments) Close

func (c *Commitments) Close() (err error)

func (*Commitments) Export

func (c *Commitments) Export(writer io.WriteSeeker, targetSlot slot.Index) (err error)

func (*Commitments) FilePath

func (c *Commitments) FilePath() (filePath string)

FilePath returns the path that this is associated to.

func (*Commitments) Import

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

func (*Commitments) Load

func (c *Commitments) Load(index slot.Index) (commitment *commitment.Commitment, err error)

func (*Commitments) Store

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

type Permanent

type Permanent struct {
	Settings       *Settings
	Commitments    *Commitments
	UnspentOutputs kvstore.KVStore
	// contains filtered or unexported fields
}

func New

func New(dir *utils.Directory, db *database.Manager) (p *Permanent)

New returns a new permanent storage instance.

func (*Permanent) Attestations

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

Attestations returns the "attestations" storage (or a specialized sub-storage if a realm is provided).

func (*Permanent) SettingsAndCommitmentsSize

func (p *Permanent) SettingsAndCommitmentsSize() int64

SettingsAndCommitmentsSize returns the total size of the binary files.

func (*Permanent) SybilProtection

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

SybilProtection returns the sybil protection storage (or a specialized sub-storage if a realm is provided).

func (*Permanent) ThroughputQuota

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

ThroughputQuota returns the throughput quota storage (or a specialized sub-storage if a realm is provided).

func (*Permanent) UnspentOutputIDs

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

UnspentOutputIDs returns the "unspent outputs ids" storage (or a specialized sub-storage if a realm is provided).

type Settings

type Settings struct {
	module.Module
	// contains filtered or unexported fields
}

func NewSettings

func NewSettings(path string) (settings *Settings)

func (Settings) Bytes

func (s Settings) Bytes() ([]byte, error)

func (*Settings) ChainID

func (s *Settings) ChainID() commitment.ID

func (*Settings) Export

func (s *Settings) Export(writer io.WriteSeeker) (err error)

func (Settings) FromBytes

func (s Settings) FromBytes(bytes []byte) (int, error)

func (*Settings) GenesisUnixTime

func (s *Settings) GenesisUnixTime() int64

func (*Settings) Import

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

func (*Settings) LatestCommitment

func (s *Settings) LatestCommitment() (latestCommitment *commitment.Commitment)

func (*Settings) LatestConfirmedSlot

func (s *Settings) LatestConfirmedSlot() slot.Index

func (*Settings) LatestStateMutationSlot

func (s *Settings) LatestStateMutationSlot() slot.Index

func (*Settings) SetChainID

func (s *Settings) SetChainID(id commitment.ID) (err error)

func (*Settings) SetGenesisUnixTime

func (s *Settings) SetGenesisUnixTime(unixTime int64) (err error)

func (*Settings) SetLatestCommitment

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

func (*Settings) SetLatestConfirmedSlot

func (s *Settings) SetLatestConfirmedSlot(latestConfirmedSlot slot.Index) (err error)

func (*Settings) SetLatestStateMutationSlot

func (s *Settings) SetLatestStateMutationSlot(latestStateMutationSlot slot.Index) (err error)

func (*Settings) SetSlotDuration

func (s *Settings) SetSlotDuration(duration int64) (err error)

func (*Settings) SetSnapshotImported

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

func (*Settings) SlotDuration

func (s *Settings) SlotDuration() int64

func (*Settings) SlotTimeProvider

func (s *Settings) SlotTimeProvider() *slot.TimeProvider

func (*Settings) SnapshotImported

func (s *Settings) SnapshotImported() (initialized bool)

func (*Settings) String

func (s *Settings) String() string

func (*Settings) UpdateSlotTimeProvider

func (s *Settings) UpdateSlotTimeProvider()

Jump to

Keyboard shortcuts

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