Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfIndexation(msg *Message) (indexation *iotago.Indexation)
- func MessageCaller(handler interface{}, params ...interface{})
- func MessageFactory(key []byte, data []byte) (objectstorage.StorableObject, error)
- func MessageIDCaller(handler interface{}, params ...interface{})
- func MessageMetadataCaller(handler interface{}, params ...interface{})
- func MessageReferencedCaller(handler interface{}, params ...interface{})
- func MetadataFactory(key []byte, data []byte) (objectstorage.StorableObject, error)
- func MilestoneCaller(handler interface{}, params ...interface{})
- func MilestoneWithRequestedCaller(handler interface{}, params ...interface{})
- func NewMessageCaller(handler interface{}, params ...interface{})
- func ObjectStorageIteratorOptions(iteratorOptions ...IteratorOption) []objectstorage.IteratorOption
- func PadIndexationIndex(index []byte) []byte
- type CachedChild
- type CachedChildren
- type CachedIndexation
- type CachedIndexationConsumer
- type CachedMessage
- func (c *CachedMessage) CachedMetadata() *CachedMetadata
- func (c *CachedMessage) ConsumeMessage(consumer func(*Message))
- func (c *CachedMessage) ConsumeMessageAndMetadata(consumer func(*Message, *MessageMetadata))
- func (c *CachedMessage) ConsumeMetadata(consumer func(*MessageMetadata))
- func (c *CachedMessage) Exists() bool
- func (c *CachedMessage) Message() *Message
- func (c *CachedMessage) Metadata() *MessageMetadata
- func (c *CachedMessage) Release(force ...bool)
- func (c *CachedMessage) Retain() *CachedMessage
- type CachedMessageFunc
- type CachedMessageMetadataFunc
- type CachedMessages
- type CachedMetadata
- type CachedMilestone
- type CachedMilestones
- type CachedUnreferencedMessage
- type CachedUnreferencedMessages
- type Child
- type ChildConsumer
- type Conflict
- type ErrDatabaseError
- type IndexConsumer
- type Indexation
- type IteratorOption
- type IteratorOptions
- type LexicalOrderedSolidEntryPoints
- type Message
- func (msg *Message) Data() []byte
- func (msg *Message) Indexation() *iotago.Indexation
- func (msg *Message) IsMilestone() bool
- func (msg *Message) IsTransaction() bool
- func (msg *Message) Message() *iotago.Message
- func (msg *Message) MessageID() hornet.MessageID
- func (msg *Message) Milestone() (ms *iotago.Milestone)
- func (msg *Message) NetworkID() uint64
- func (msg *Message) ObjectStorageKey() []byte
- func (msg *Message) ObjectStorageValue() (_ []byte)
- func (msg *Message) Parents() hornet.MessageIDs
- func (msg *Message) SignatureForInputIndex(inputIndex uint16) *iotago.Ed25519Signature
- func (msg *Message) Transaction() *iotago.Transaction
- func (msg *Message) TransactionEssence() *iotago.TransactionEssence
- func (msg *Message) TransactionEssenceIndexation() *iotago.Indexation
- func (msg *Message) TransactionEssenceUTXOInputs() []*iotago.UTXOInputID
- func (msg *Message) Update(_ objectstorage.StorableObject)
- type MessageIDConsumer
- type MessageMetadata
- func (m *MessageMetadata) ConeRootIndexes() (ycri milestone.Index, ocri milestone.Index, ci milestone.Index)
- func (m *MessageMetadata) Conflict() Conflict
- func (m *MessageMetadata) IsConflictingTx() bool
- func (m *MessageMetadata) IsIncludedTxInLedger() bool
- func (m *MessageMetadata) IsMilestone() bool
- func (m *MessageMetadata) IsNoTransaction() bool
- func (m *MessageMetadata) IsReferenced() bool
- func (m *MessageMetadata) IsSolid() bool
- func (m *MessageMetadata) MessageID() hornet.MessageID
- func (m *MessageMetadata) Metadata() byte
- func (m *MessageMetadata) ObjectStorageKey() []byte
- func (m *MessageMetadata) ObjectStorageValue() (data []byte)
- func (m *MessageMetadata) Parents() hornet.MessageIDs
- func (m *MessageMetadata) ReferencedWithIndex() (bool, milestone.Index)
- func (m *MessageMetadata) SetConeRootIndexes(ycri milestone.Index, ocri milestone.Index, ci milestone.Index)
- func (m *MessageMetadata) SetConflictingTx(conflict Conflict)
- func (m *MessageMetadata) SetIsNoTransaction(noTx bool)
- func (m *MessageMetadata) SetMilestone(milestone bool)
- func (m *MessageMetadata) SetReferenced(referenced bool, referencedIndex milestone.Index)
- func (m *MessageMetadata) SetSolid(solid bool)
- func (m *MessageMetadata) SolidificationTimestamp() int32
- func (m *MessageMetadata) Update(_ objectstorage.StorableObject)
- type MessagesMemcache
- type MetadataMemcache
- type Milestone
- type MilestoneIndexConsumer
- type NonCachedStorage
- func (ns *NonCachedStorage) ForEachChild(consumer ChildConsumer, iteratorOptions ...IteratorOption)
- func (ns *NonCachedStorage) ForEachIndexation(consumer CachedIndexationConsumer, iteratorOptions ...IteratorOption)
- func (ns *NonCachedStorage) ForEachMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
- func (ns *NonCachedStorage) ForEachMessageMetadataMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
- func (ns *NonCachedStorage) ForEachMilestoneIndex(consumer MilestoneIndexConsumer, iteratorOptions ...IteratorOption)
- func (ns *NonCachedStorage) ForEachUnreferencedMessage(consumer UnreferencedMessageConsumer, iteratorOptions ...IteratorOption)
- type ReadOption
- type SnapshotInfo
- type SolidEntryPoint
- type SolidEntryPointConsumer
- type SolidEntryPoints
- func (s *SolidEntryPoints) Add(messageID hornet.MessageID, milestoneIndex milestone.Index)
- func (s *SolidEntryPoints) Bytes() []byte
- func (s *SolidEntryPoints) Clear()
- func (s *SolidEntryPoints) Contains(messageID hornet.MessageID) bool
- func (s *SolidEntryPoints) Index(messageID hornet.MessageID) (milestone.Index, bool)
- func (s *SolidEntryPoints) IsModified() bool
- func (s *SolidEntryPoints) SHA256Sum() ([]byte, error)
- func (s *SolidEntryPoints) SetModified(modified bool)
- func (s *SolidEntryPoints) Sorted() []*SolidEntryPoint
- type Storage
- func (s *Storage) AreDatabasesCorrupted() (bool, error)
- func (s *Storage) AreDatabasesTainted() (bool, error)
- func (s *Storage) CachedChildrenOfMessageID(messageID hornet.MessageID, iteratorOptions ...IteratorOption) CachedChildren
- func (s *Storage) CachedMessage(messageID hornet.MessageID) (*CachedMessage, error)
- func (s *Storage) CachedMessageMetadata(messageID hornet.MessageID) (*CachedMetadata, error)
- func (s *Storage) CachedMessageMetadataOrNil(messageID hornet.MessageID) *CachedMetadata
- func (s *Storage) CachedMessageOrNil(messageID hornet.MessageID) *CachedMessage
- func (s *Storage) CachedMilestoneOrNil(milestoneIndex milestone.Index) *CachedMilestone
- func (s *Storage) CheckCorrectDatabasesVersion() (bool, error)
- func (s *Storage) ChildrenMessageIDs(messageID hornet.MessageID, iteratorOptions ...IteratorOption) (hornet.MessageIDs, error)
- func (s *Storage) ChildrenStorageSize() int
- func (s *Storage) ContainsChild(messageID hornet.MessageID, childMessageID hornet.MessageID, ...) bool
- func (s *Storage) ContainsMessage(messageID hornet.MessageID, readOptions ...ReadOption) bool
- func (s *Storage) ContainsMilestone(milestoneIndex milestone.Index, readOptions ...ReadOption) bool
- func (s *Storage) DeleteChild(messageID hornet.MessageID, childMessageID hornet.MessageID)
- func (s *Storage) DeleteChildren(messageID hornet.MessageID, iteratorOptions ...IteratorOption)
- func (s *Storage) DeleteIndexation(index []byte, messageID hornet.MessageID)
- func (s *Storage) DeleteIndexationByKey(key []byte)
- func (s *Storage) DeleteMessage(messageID hornet.MessageID)
- func (s *Storage) DeleteMessageMetadata(messageID hornet.MessageID)
- func (s *Storage) DeleteMilestone(milestoneIndex milestone.Index)
- func (s *Storage) DeleteUnreferencedMessages(msIndex milestone.Index, iteratorOptions ...IteratorOption) int
- func (s *Storage) FlushAndCloseStores() error
- func (s *Storage) FlushChildrenStorage()
- func (s *Storage) FlushIndexationStorage()
- func (s *Storage) FlushMessagesStorage()
- func (s *Storage) FlushMilestoneStorage()
- func (s *Storage) FlushStorages()
- func (s *Storage) FlushUnreferencedMessagesStorage()
- func (s *Storage) ForEachChild(consumer ChildConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) ForEachIndexation(consumer CachedIndexationConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) ForEachMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) ForEachMessageIDWithIndex(index []byte, consumer IndexConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) ForEachMessageMetadataMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) ForEachMilestoneIndex(consumer MilestoneIndexConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) ForEachSolidEntryPointWithoutLocking(consumer SolidEntryPointConsumer)
- func (s *Storage) ForEachUnreferencedMessage(consumer UnreferencedMessageConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) IndexMessageIDs(index []byte, iteratorOptions ...IteratorOption) hornet.MessageIDs
- func (s *Storage) IndexationStorageSize() int
- func (s *Storage) MarkDatabasesCorrupted() error
- func (s *Storage) MarkDatabasesHealthy() error
- func (s *Storage) MarkDatabasesTainted() error
- func (s *Storage) Message(messageID hornet.MessageID) (*iotago.Message, error)
- func (s *Storage) MessageExistsInStore(messageID hornet.MessageID) bool
- func (s *Storage) MessageMetadataExistsInStore(messageID hornet.MessageID) bool
- func (s *Storage) MessageMetadataStorageSize() int
- func (s *Storage) MessageStorageSize() int
- func (s *Storage) MilestoneCachedMessageOrNil(milestoneIndex milestone.Index) *CachedMessage
- func (s *Storage) MilestoneStorageSize() int
- func (s *Storage) MilestoneTimestampByIndex(milestoneIndex milestone.Index) (time.Time, error)
- func (s *Storage) MilestoneTimestampUnixByIndex(milestoneIndex milestone.Index) (int64, error)
- func (s *Storage) NonCachedStorage() *NonCachedStorage
- func (s *Storage) PrintSnapshotInfo()
- func (s *Storage) ReadLockSolidEntryPoints()
- func (s *Storage) ReadUnlockSolidEntryPoints()
- func (s *Storage) ResetSolidEntryPointsWithoutLocking()
- func (s *Storage) SearchLatestMilestoneIndexInStore() milestone.Index
- func (s *Storage) SetSnapshotInfo(sn *SnapshotInfo) error
- func (s *Storage) SetSnapshotMilestone(networkID uint64, snapshotIndex milestone.Index, ...) error
- func (s *Storage) ShutdownChildrenStorage()
- func (s *Storage) ShutdownIndexationStorage()
- func (s *Storage) ShutdownMessagesStorage()
- func (s *Storage) ShutdownMilestoneStorage()
- func (s *Storage) ShutdownStorages()
- func (s *Storage) ShutdownUnreferencedMessagesStorage()
- func (s *Storage) SnapshotInfo() *SnapshotInfo
- func (s *Storage) SolidEntryPoints() *SolidEntryPoints
- func (s *Storage) SolidEntryPointsAddWithoutLocking(messageID hornet.MessageID, milestoneIndex milestone.Index)
- func (s *Storage) SolidEntryPointsContain(messageID hornet.MessageID) (bool, error)
- func (s *Storage) SolidEntryPointsIndex(messageID hornet.MessageID) (milestone.Index, bool, error)
- func (s *Storage) StoreChild(parentMessageID hornet.MessageID, childMessageID hornet.MessageID) *CachedChild
- func (s *Storage) StoreIndexation(index []byte, messageID hornet.MessageID) *CachedIndexation
- func (s *Storage) StoreMessageIfAbsent(message *Message) (cachedMsg *CachedMessage, newlyAdded bool)
- func (s *Storage) StoreMilestoneIfAbsent(index milestone.Index, messageID hornet.MessageID, timestamp time.Time) (*CachedMilestone, bool)
- func (s *Storage) StoreSolidEntryPointsWithoutLocking() error
- func (s *Storage) StoreUnreferencedMessage(msIndex milestone.Index, messageID hornet.MessageID) *CachedUnreferencedMessage
- func (s *Storage) StoredMetadataOrNil(messageID hornet.MessageID) *MessageMetadata
- func (s *Storage) TangleStore() kvstore.KVStore
- func (s *Storage) UTXOManager() *utxo.Manager
- func (s *Storage) UTXOStore() kvstore.KVStore
- func (s *Storage) UnreferencedMessageIDs(msIndex milestone.Index, iteratorOptions ...IteratorOption) hornet.MessageIDs
- func (s *Storage) UnreferencedMessageStorageSize() int
- func (s *Storage) UpdateDatabasesVersion() (bool, error)
- func (s *Storage) WriteLockSolidEntryPoints()
- func (s *Storage) WriteUnlockSolidEntryPoints()
- type StoreHealthTracker
- func (s *StoreHealthTracker) CheckCorrectDatabaseVersion() (bool, error)
- func (s *StoreHealthTracker) DatabaseVersion() (int, error)
- func (s *StoreHealthTracker) IsCorrupted() (bool, error)
- func (s *StoreHealthTracker) IsTainted() (bool, error)
- func (s *StoreHealthTracker) MarkCorrupted() error
- func (s *StoreHealthTracker) MarkHealthy() error
- func (s *StoreHealthTracker) MarkTainted() error
- func (s *StoreHealthTracker) UpdateDatabaseVersion() (bool, error)
- type UnreferencedMessage
- func (t *UnreferencedMessage) LatestMilestoneIndex() milestone.Index
- func (t *UnreferencedMessage) MessageID() hornet.MessageID
- func (t *UnreferencedMessage) ObjectStorageKey() []byte
- func (t *UnreferencedMessage) ObjectStorageValue() (_ []byte)
- func (t *UnreferencedMessage) Update(_ objectstorage.StorableObject)
- type UnreferencedMessageConsumer
Constants ¶
const ( MessageMetadataSolid = 0 MessageMetadataReferenced = 1 MessageMetadataNoTx = 2 MessageMetadataConflictingTx = 3 MessageMetadataMilestone = 4 )
const ( //ConflictNone the message has no conflict. ConflictNone Conflict = iota // ConflictInputUTXOAlreadySpent the referenced UTXO was already spent. ConflictInputUTXOAlreadySpent = 1 // ConflictInputUTXOAlreadySpentInThisMilestone the referenced UTXO was already spent while confirming this milestone ConflictInputUTXOAlreadySpentInThisMilestone = 2 // ConflictInputUTXONotFound the referenced UTXO cannot be found. ConflictInputUTXONotFound = 3 // ConflictInputOutputSumMismatch the sum of the inputs and output values does not match. ConflictInputOutputSumMismatch = 4 // ConflictInvalidSignature the unlock block signature is invalid. ConflictInvalidSignature = 5 // ConflictInvalidDustAllowance the dust allowance for the address is invalid. ConflictInvalidDustAllowance = 6 // ConflictSemanticValidationFailed the semantic validation failed. ConflictSemanticValidationFailed = 255 )
const (
DBVersion = 1
)
const (
IndexationIndexLength = 64
)
Variables ¶
var ( ErrSolidEntryPointsAlreadyInitialized = errors.New("solidEntryPoints already initialized") ErrSolidEntryPointsNotInitialized = errors.New("solidEntryPoints not initialized") )
var (
ErrMilestoneNotFound = errors.New("milestone not found")
)
var (
ErrParseSnapshotInfoFailed = errors.New("Parsing of snapshot info failed")
)
Functions ¶
func CheckIfIndexation ¶
func CheckIfIndexation(msg *Message) (indexation *iotago.Indexation)
func MessageCaller ¶
func MessageCaller(handler interface{}, params ...interface{})
func MessageFactory ¶
func MessageFactory(key []byte, data []byte) (objectstorage.StorableObject, error)
func MessageIDCaller ¶
func MessageIDCaller(handler interface{}, params ...interface{})
func MessageMetadataCaller ¶
func MessageMetadataCaller(handler interface{}, params ...interface{})
func MessageReferencedCaller ¶
func MessageReferencedCaller(handler interface{}, params ...interface{})
func MetadataFactory ¶
func MetadataFactory(key []byte, data []byte) (objectstorage.StorableObject, error)
func MilestoneCaller ¶
func MilestoneCaller(handler interface{}, params ...interface{})
func MilestoneWithRequestedCaller ¶
func MilestoneWithRequestedCaller(handler interface{}, params ...interface{})
func NewMessageCaller ¶
func NewMessageCaller(handler interface{}, params ...interface{})
func ObjectStorageIteratorOptions ¶
func ObjectStorageIteratorOptions(iteratorOptions ...IteratorOption) []objectstorage.IteratorOption
func PadIndexationIndex ¶
PadIndexationIndex returns a padded indexation index.
Types ¶
type CachedChild ¶
type CachedChild struct {
objectstorage.CachedObject
}
CachedChild represents a cached Child.
func (*CachedChild) Child ¶
func (c *CachedChild) Child() *Child
Child retrieves the child, that is cached in this container.
func (*CachedChild) Retain ¶
func (c *CachedChild) Retain() *CachedChild
Retain registers a new consumer for the cached child. child +1
type CachedChildren ¶
type CachedChildren []*CachedChild
func (CachedChildren) Release ¶
func (cachedChildren CachedChildren) Release(force ...bool)
Release releases the cached children, to be picked up by the persistence layer (as soon as all consumers are done).
func (CachedChildren) Retain ¶
func (cachedChildren CachedChildren) Retain() CachedChildren
Retain registers a new consumer for the cached children. child +1
type CachedIndexation ¶
type CachedIndexation struct {
objectstorage.CachedObject
}
CachedIndexation represents a cached indexation.
func (*CachedIndexation) Indexation ¶
func (c *CachedIndexation) Indexation() *Indexation
Indexation retrieves the indexation, that is cached in this container.
type CachedIndexationConsumer ¶
type CachedIndexationConsumer func(indexation *CachedIndexation) bool
CachedIndexationConsumer consumes the given indexation during looping through all indexations.
type CachedMessage ¶
type CachedMessage struct {
// contains filtered or unexported fields
}
CachedMessage contains two cached objects, one for message data and one for metadata.
func NewCachedMessage ¶
func NewCachedMessage(msg objectstorage.CachedObject, metadata objectstorage.CachedObject) *CachedMessage
func (*CachedMessage) CachedMetadata ¶
func (c *CachedMessage) CachedMetadata() *CachedMetadata
CachedMetadata returns the underlying cached metadata. meta +1
func (*CachedMessage) ConsumeMessage ¶
func (c *CachedMessage) ConsumeMessage(consumer func(*Message))
ConsumeMessage consumes the underlying message. message -1 meta -1
func (*CachedMessage) ConsumeMessageAndMetadata ¶
func (c *CachedMessage) ConsumeMessageAndMetadata(consumer func(*Message, *MessageMetadata))
ConsumeMessageAndMetadata consumes the underlying message and metadata. message -1 meta -1
func (*CachedMessage) ConsumeMetadata ¶
func (c *CachedMessage) ConsumeMetadata(consumer func(*MessageMetadata))
ConsumeMetadata consumes the underlying metadata. message -1 meta -1
func (*CachedMessage) Exists ¶
func (c *CachedMessage) Exists() bool
Exists returns true if the message in this container does exist (could be found in the database and was not marked as deleted).
func (*CachedMessage) Message ¶
func (c *CachedMessage) Message() *Message
Message retrieves the message, that is cached in this container.
func (*CachedMessage) Metadata ¶
func (c *CachedMessage) Metadata() *MessageMetadata
Metadata retrieves the metadata, that is cached in this container.
func (*CachedMessage) Release ¶
func (c *CachedMessage) Release(force ...bool)
Release releases the cached message and metadata, to be picked up by the persistence layer (as soon as all consumers are done). message -1
func (*CachedMessage) Retain ¶
func (c *CachedMessage) Retain() *CachedMessage
Retain registers a new consumer for the cached message and metadata. message +1
type CachedMessageFunc ¶
type CachedMessageFunc func(messageID hornet.MessageID) (*CachedMessage, error)
type CachedMessageMetadataFunc ¶
type CachedMessageMetadataFunc func(messageID hornet.MessageID) (*CachedMetadata, error)
type CachedMessages ¶
type CachedMessages []*CachedMessage
func (CachedMessages) Release ¶
func (cachedMsgs CachedMessages) Release(force ...bool)
Release releases the cached messages, to be picked up by the persistence layer (as soon as all consumers are done). message -1
func (CachedMessages) Retain ¶
func (cachedMsgs CachedMessages) Retain() CachedMessages
Retain registers a new consumer for the cached messages. message +1
type CachedMetadata ¶
type CachedMetadata struct {
objectstorage.CachedObject
}
CachedMetadata contains the cached object only for metadata.
func NewCachedMetadata ¶
func NewCachedMetadata(metadata objectstorage.CachedObject) *CachedMetadata
func (*CachedMetadata) ConsumeMetadata ¶
func (c *CachedMetadata) ConsumeMetadata(consumer func(*MessageMetadata))
ConsumeMetadata consumes the metadata. meta -1
func (*CachedMetadata) Metadata ¶
func (c *CachedMetadata) Metadata() *MessageMetadata
Metadata retrieves the metadata, that is cached in this container.
func (*CachedMetadata) Retain ¶
func (c *CachedMetadata) Retain() *CachedMetadata
Retain registers a new consumer for the cached metadata. meta +1
type CachedMilestone ¶
type CachedMilestone struct {
objectstorage.CachedObject
}
CachedMilestone represents a cached milestone.
func (*CachedMilestone) Milestone ¶
func (c *CachedMilestone) Milestone() *Milestone
Milestone retrieves the milestone, that is cached in this container.
func (*CachedMilestone) Retain ¶
func (c *CachedMilestone) Retain() *CachedMilestone
Retain registers a new consumer for the cached milestone. milestone +1
type CachedMilestones ¶
type CachedMilestones []*CachedMilestone
func (CachedMilestones) Release ¶
func (c CachedMilestones) Release(force ...bool)
Release releases the cached milestones, to be picked up by the persistence layer (as soon as all consumers are done). milestone -1
func (CachedMilestones) Retain ¶
func (c CachedMilestones) Retain() CachedMilestones
Retain registers a new consumer for the cached milestones. milestone +1
type CachedUnreferencedMessage ¶
type CachedUnreferencedMessage struct {
objectstorage.CachedObject
}
CachedUnreferencedMessage represents a cached unreferenced message.
func (*CachedUnreferencedMessage) UnreferencedMessage ¶
func (c *CachedUnreferencedMessage) UnreferencedMessage() *UnreferencedMessage
UnreferencedMessage retrieves the unreferenced message, that is cached in this container.
type CachedUnreferencedMessages ¶
type CachedUnreferencedMessages []*CachedUnreferencedMessage
func (CachedUnreferencedMessages) Release ¶
func (cachedUnreferencedMessages CachedUnreferencedMessages) Release(force ...bool)
Release releases the cached unreferenced messages, to be picked up by the persistence layer (as soon as all consumers are done).
type Child ¶
type Child struct { objectstorage.StorableObjectFlags // contains filtered or unexported fields }
func (*Child) ChildMessageID ¶
func (*Child) ObjectStorageKey ¶
func (*Child) ObjectStorageValue ¶
func (*Child) ParentMessageID ¶
func (*Child) Update ¶
func (a *Child) Update(_ objectstorage.StorableObject)
type ChildConsumer ¶
ChildConsumer consumes the given child during looping through all children.
type Conflict ¶
type Conflict uint8
Conflict defines the reason why a message is marked as conflicting.
type ErrDatabaseError ¶
type ErrDatabaseError struct {
Inner error
}
func NewDatabaseError ¶
func NewDatabaseError(cause error) *ErrDatabaseError
func (ErrDatabaseError) Cause ¶
func (e ErrDatabaseError) Cause() error
func (ErrDatabaseError) Error ¶
func (e ErrDatabaseError) Error() string
type IndexConsumer ¶
IndexConsumer consumes the messageID during looping through all messages with given index.
type Indexation ¶
type Indexation struct { objectstorage.StorableObjectFlags // contains filtered or unexported fields }
func NewIndexation ¶
func NewIndexation(index []byte, messageID hornet.MessageID) *Indexation
func (*Indexation) Index ¶
func (i *Indexation) Index() []byte
func (*Indexation) MessageID ¶
func (i *Indexation) MessageID() hornet.MessageID
func (*Indexation) ObjectStorageKey ¶
func (i *Indexation) ObjectStorageKey() []byte
func (*Indexation) ObjectStorageValue ¶
func (i *Indexation) ObjectStorageValue() (_ []byte)
func (*Indexation) Update ¶
func (i *Indexation) Update(_ objectstorage.StorableObject)
type IteratorOption ¶
type IteratorOption func(opts *IteratorOptions)
IteratorOption is a function setting an iterator option.
func WithIteratorMaxIterations ¶
func WithIteratorMaxIterations(maxIterations int) IteratorOption
WithIteratorMaxIterations is used to stop the iteration after a certain amount of iterations. 0 disables the limit.
func WithIteratorPrefix ¶
func WithIteratorPrefix(prefix []byte) IteratorOption
WithIteratorPrefix is used to iterate a subset of elements with a defined prefix.
type IteratorOptions ¶
type IteratorOptions struct {
// contains filtered or unexported fields
}
IteratorOptions define options for iterations in the object storage.
type LexicalOrderedSolidEntryPoints ¶
type LexicalOrderedSolidEntryPoints []*SolidEntryPoint
LexicalOrderedSolidEntryPoints are solid entry points ordered in lexical order by their MessageID.
func (LexicalOrderedSolidEntryPoints) Len ¶
func (l LexicalOrderedSolidEntryPoints) Len() int
func (LexicalOrderedSolidEntryPoints) Less ¶
func (l LexicalOrderedSolidEntryPoints) Less(i, j int) bool
func (LexicalOrderedSolidEntryPoints) Swap ¶
func (l LexicalOrderedSolidEntryPoints) Swap(i, j int)
type Message ¶
type Message struct { objectstorage.StorableObjectFlags // contains filtered or unexported fields }
func MessageFromBytes ¶
func MessageFromBytes(data []byte, deSeriMode serializer.DeSerializationMode) (*Message, error)
func NewMessage ¶
func NewMessage(iotaMsg *iotago.Message, deSeriMode serializer.DeSerializationMode) (*Message, error)
func (*Message) Indexation ¶
func (msg *Message) Indexation() *iotago.Indexation
func (*Message) IsMilestone ¶
func (*Message) IsTransaction ¶
func (*Message) ObjectStorageKey ¶
func (*Message) ObjectStorageValue ¶
func (*Message) Parents ¶
func (msg *Message) Parents() hornet.MessageIDs
func (*Message) SignatureForInputIndex ¶
func (msg *Message) SignatureForInputIndex(inputIndex uint16) *iotago.Ed25519Signature
func (*Message) Transaction ¶
func (msg *Message) Transaction() *iotago.Transaction
func (*Message) TransactionEssence ¶
func (msg *Message) TransactionEssence() *iotago.TransactionEssence
func (*Message) TransactionEssenceIndexation ¶
func (msg *Message) TransactionEssenceIndexation() *iotago.Indexation
func (*Message) TransactionEssenceUTXOInputs ¶
func (msg *Message) TransactionEssenceUTXOInputs() []*iotago.UTXOInputID
func (*Message) Update ¶
func (msg *Message) Update(_ objectstorage.StorableObject)
type MessageIDConsumer ¶
MessageIDConsumer consumes the given message ID during looping through all messages.
type MessageMetadata ¶
type MessageMetadata struct { objectstorage.StorableObjectFlags syncutils.RWMutex // contains filtered or unexported fields }
func NewMessageMetadata ¶
func NewMessageMetadata(messageID hornet.MessageID, parents hornet.MessageIDs) *MessageMetadata
func (*MessageMetadata) ConeRootIndexes ¶
func (*MessageMetadata) Conflict ¶
func (m *MessageMetadata) Conflict() Conflict
func (*MessageMetadata) IsConflictingTx ¶
func (m *MessageMetadata) IsConflictingTx() bool
func (*MessageMetadata) IsIncludedTxInLedger ¶
func (m *MessageMetadata) IsIncludedTxInLedger() bool
func (*MessageMetadata) IsMilestone ¶
func (m *MessageMetadata) IsMilestone() bool
func (*MessageMetadata) IsNoTransaction ¶
func (m *MessageMetadata) IsNoTransaction() bool
func (*MessageMetadata) IsReferenced ¶
func (m *MessageMetadata) IsReferenced() bool
func (*MessageMetadata) IsSolid ¶
func (m *MessageMetadata) IsSolid() bool
func (*MessageMetadata) MessageID ¶
func (m *MessageMetadata) MessageID() hornet.MessageID
func (*MessageMetadata) Metadata ¶
func (m *MessageMetadata) Metadata() byte
func (*MessageMetadata) ObjectStorageKey ¶
func (m *MessageMetadata) ObjectStorageKey() []byte
func (*MessageMetadata) ObjectStorageValue ¶
func (m *MessageMetadata) ObjectStorageValue() (data []byte)
func (*MessageMetadata) Parents ¶
func (m *MessageMetadata) Parents() hornet.MessageIDs
func (*MessageMetadata) ReferencedWithIndex ¶
func (m *MessageMetadata) ReferencedWithIndex() (bool, milestone.Index)
func (*MessageMetadata) SetConeRootIndexes ¶
func (*MessageMetadata) SetConflictingTx ¶
func (m *MessageMetadata) SetConflictingTx(conflict Conflict)
func (*MessageMetadata) SetIsNoTransaction ¶
func (m *MessageMetadata) SetIsNoTransaction(noTx bool)
func (*MessageMetadata) SetMilestone ¶
func (m *MessageMetadata) SetMilestone(milestone bool)
func (*MessageMetadata) SetReferenced ¶
func (m *MessageMetadata) SetReferenced(referenced bool, referencedIndex milestone.Index)
func (*MessageMetadata) SetSolid ¶
func (m *MessageMetadata) SetSolid(solid bool)
func (*MessageMetadata) SolidificationTimestamp ¶
func (m *MessageMetadata) SolidificationTimestamp() int32
func (*MessageMetadata) Update ¶
func (m *MessageMetadata) Update(_ objectstorage.StorableObject)
type MessagesMemcache ¶
type MessagesMemcache struct {
// contains filtered or unexported fields
}
func NewMessagesMemcache ¶
func NewMessagesMemcache(cachedMessageFunc CachedMessageFunc) *MessagesMemcache
NewMessagesMemcache creates a new MessagesMemcache instance.
func (*MessagesMemcache) CachedMessage ¶
func (c *MessagesMemcache) CachedMessage(messageID hornet.MessageID) (*CachedMessage, error)
CachedMessage returns a cached message object. message +1
func (*MessagesMemcache) Cleanup ¶
func (c *MessagesMemcache) Cleanup(forceRelease bool)
Cleanup releases all the cached objects that have been used. This MUST be called by the user at the end.
type MetadataMemcache ¶
type MetadataMemcache struct {
// contains filtered or unexported fields
}
func NewMetadataMemcache ¶
func NewMetadataMemcache(cachedMessageMetadataFunc CachedMessageMetadataFunc) *MetadataMemcache
NewMetadataMemcache creates a new NewMetadataMemcache instance.
func (*MetadataMemcache) CachedMessageMetadata ¶
func (c *MetadataMemcache) CachedMessageMetadata(messageID hornet.MessageID) (*CachedMetadata, error)
CachedMessageMetadata returns a cached metadata object. meta +1
func (*MetadataMemcache) Cleanup ¶
func (c *MetadataMemcache) Cleanup(forceRelease bool)
Cleanup releases all the cached objects that have been used. This MUST be called by the user at the end.
type Milestone ¶
type Milestone struct { objectstorage.StorableObjectFlags Index milestone.Index MessageID hornet.MessageID Timestamp time.Time }
func (*Milestone) ObjectStorageKey ¶
func (*Milestone) ObjectStorageValue ¶
func (*Milestone) Update ¶
func (ms *Milestone) Update(_ objectstorage.StorableObject)
type MilestoneIndexConsumer ¶
MilestoneIndexConsumer consumes the given index during looping through all milestones.
type NonCachedStorage ¶
type NonCachedStorage struct {
// contains filtered or unexported fields
}
NonCachedStorage is a Storage without a cache.
func (*NonCachedStorage) ForEachChild ¶
func (ns *NonCachedStorage) ForEachChild(consumer ChildConsumer, iteratorOptions ...IteratorOption)
ForEachChild loops over all children.
func (*NonCachedStorage) ForEachIndexation ¶
func (ns *NonCachedStorage) ForEachIndexation(consumer CachedIndexationConsumer, iteratorOptions ...IteratorOption)
ForEachIndexation loops over all indexations. indexation +1
func (*NonCachedStorage) ForEachMessageID ¶
func (ns *NonCachedStorage) ForEachMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
ForEachMessageID loops over all message IDs.
func (*NonCachedStorage) ForEachMessageMetadataMessageID ¶
func (ns *NonCachedStorage) ForEachMessageMetadataMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
ForEachMessageMetadataMessageID loops over all message metadata message IDs.
func (*NonCachedStorage) ForEachMilestoneIndex ¶
func (ns *NonCachedStorage) ForEachMilestoneIndex(consumer MilestoneIndexConsumer, iteratorOptions ...IteratorOption)
ForEachMilestoneIndex loops through all milestones.
func (*NonCachedStorage) ForEachUnreferencedMessage ¶
func (ns *NonCachedStorage) ForEachUnreferencedMessage(consumer UnreferencedMessageConsumer, iteratorOptions ...IteratorOption)
ForEachUnreferencedMessage loops over all unreferenced messages.
type ReadOption ¶
type ReadOption = objectstorage.ReadOption
type SnapshotInfo ¶
type SnapshotInfo struct { NetworkID uint64 SnapshotIndex milestone.Index EntryPointIndex milestone.Index PruningIndex milestone.Index Timestamp time.Time Metadata bitmask.BitMask }
func SnapshotInfoFromBytes ¶
func SnapshotInfoFromBytes(bytes []byte) (*SnapshotInfo, error)
func (*SnapshotInfo) Bytes ¶
func (i *SnapshotInfo) Bytes() []byte
type SolidEntryPoint ¶
type SolidEntryPointConsumer ¶
type SolidEntryPointConsumer func(solidEntryPoint *SolidEntryPoint) bool
SolidEntryPointConsumer consumes the solid entry point during looping through all solid entry points.
type SolidEntryPoints ¶
type SolidEntryPoints struct {
// contains filtered or unexported fields
}
func NewSolidEntryPoints ¶
func NewSolidEntryPoints() *SolidEntryPoints
func SolidEntryPointsFromBytes ¶
func SolidEntryPointsFromBytes(solidEntryPointsBytes []byte) (*SolidEntryPoints, error)
func (*SolidEntryPoints) Add ¶
func (s *SolidEntryPoints) Add(messageID hornet.MessageID, milestoneIndex milestone.Index)
func (*SolidEntryPoints) Bytes ¶
func (s *SolidEntryPoints) Bytes() []byte
func (*SolidEntryPoints) Clear ¶
func (s *SolidEntryPoints) Clear()
func (*SolidEntryPoints) Contains ¶
func (s *SolidEntryPoints) Contains(messageID hornet.MessageID) bool
func (*SolidEntryPoints) IsModified ¶
func (s *SolidEntryPoints) IsModified() bool
func (*SolidEntryPoints) SHA256Sum ¶
func (s *SolidEntryPoints) SHA256Sum() ([]byte, error)
func (*SolidEntryPoints) SetModified ¶
func (s *SolidEntryPoints) SetModified(modified bool)
func (*SolidEntryPoints) Sorted ¶
func (s *SolidEntryPoints) Sorted() []*SolidEntryPoint
sort the solid entry points lexicographically by their MessageID
type Storage ¶
type Storage struct { // events Events *packageEvents // contains filtered or unexported fields }
Storage is the access layer to the node databases (partially cached).
func (*Storage) AreDatabasesCorrupted ¶
func (*Storage) AreDatabasesTainted ¶
func (*Storage) CachedChildrenOfMessageID ¶
func (s *Storage) CachedChildrenOfMessageID(messageID hornet.MessageID, iteratorOptions ...IteratorOption) CachedChildren
CachedChildrenOfMessageID returns the cached children of a message. children +1
func (*Storage) CachedMessage ¶
func (s *Storage) CachedMessage(messageID hornet.MessageID) (*CachedMessage, error)
CachedMessage returns a cached message object. message +1
func (*Storage) CachedMessageMetadata ¶
func (s *Storage) CachedMessageMetadata(messageID hornet.MessageID) (*CachedMetadata, error)
CachedMessageMetadata returns a cached metadata object. meta +1
func (*Storage) CachedMessageMetadataOrNil ¶
func (s *Storage) CachedMessageMetadataOrNil(messageID hornet.MessageID) *CachedMetadata
CachedMessageMetadataOrNil returns a cached metadata object. meta +1
func (*Storage) CachedMessageOrNil ¶
func (s *Storage) CachedMessageOrNil(messageID hornet.MessageID) *CachedMessage
CachedMessageOrNil returns a cached message object. message +1
func (*Storage) CachedMilestoneOrNil ¶
func (s *Storage) CachedMilestoneOrNil(milestoneIndex milestone.Index) *CachedMilestone
CachedMilestoneOrNil returns a cached milestone object. milestone +1
func (*Storage) CheckCorrectDatabasesVersion ¶
func (*Storage) ChildrenMessageIDs ¶
func (s *Storage) ChildrenMessageIDs(messageID hornet.MessageID, iteratorOptions ...IteratorOption) (hornet.MessageIDs, error)
ChildrenMessageIDs returns the message IDs of the children of the given message. children +-0
func (*Storage) ChildrenStorageSize ¶
func (*Storage) ContainsChild ¶
func (s *Storage) ContainsChild(messageID hornet.MessageID, childMessageID hornet.MessageID, readOptions ...ReadOption) bool
ContainsChild returns if the given child exists in the cache/persistence layer.
func (*Storage) ContainsMessage ¶
func (s *Storage) ContainsMessage(messageID hornet.MessageID, readOptions ...ReadOption) bool
ContainsMessage returns if the given message exists in the cache/persistence layer.
func (*Storage) ContainsMilestone ¶
func (s *Storage) ContainsMilestone(milestoneIndex milestone.Index, readOptions ...ReadOption) bool
ContainsMilestone returns if the given milestone exists in the cache/persistence layer.
func (*Storage) DeleteChild ¶
DeleteChild deletes the child in the cache/persistence layer. child +-0
func (*Storage) DeleteChildren ¶
func (s *Storage) DeleteChildren(messageID hornet.MessageID, iteratorOptions ...IteratorOption)
DeleteChildren deletes the children of the given message in the cache/persistence layer. child +-0
func (*Storage) DeleteIndexation ¶
DeleteIndexation deletes the indexation in the cache/persistence layer. indexation +-0
func (*Storage) DeleteIndexationByKey ¶
DeleteIndexationByKey deletes the indexation by key in the cache/persistence layer. indexation +-0
func (*Storage) DeleteMessage ¶
DeleteMessage deletes the message and metadata in the cache/persistence layer.
func (*Storage) DeleteMessageMetadata ¶
DeleteMessageMetadata deletes the metadata in the cache/persistence layer.
func (*Storage) DeleteMilestone ¶
DeleteMilestone deletes the milestone in the cache/persistence layer. +-0
func (*Storage) DeleteUnreferencedMessages ¶
func (s *Storage) DeleteUnreferencedMessages(msIndex milestone.Index, iteratorOptions ...IteratorOption) int
DeleteUnreferencedMessages deletes unreferenced message entries in the cache/persistence layer.
func (*Storage) FlushAndCloseStores ¶
func (*Storage) FlushChildrenStorage ¶
func (s *Storage) FlushChildrenStorage()
FlushChildrenStorage flushes the children storage.
func (*Storage) FlushIndexationStorage ¶
func (s *Storage) FlushIndexationStorage()
FlushIndexationStorage flushes the indexation storage.
func (*Storage) FlushMessagesStorage ¶
func (s *Storage) FlushMessagesStorage()
FlushMessagesStorage flushes the messages storage.
func (*Storage) FlushMilestoneStorage ¶
func (s *Storage) FlushMilestoneStorage()
FlushMilestoneStorage flushes the milestones storage.
func (*Storage) FlushStorages ¶
func (s *Storage) FlushStorages()
FlushStorages flushes all storages.
func (*Storage) FlushUnreferencedMessagesStorage ¶
func (s *Storage) FlushUnreferencedMessagesStorage()
FlushUnreferencedMessagesStorage flushes the unreferenced messages storage.
func (*Storage) ForEachChild ¶
func (s *Storage) ForEachChild(consumer ChildConsumer, iteratorOptions ...IteratorOption)
ForEachChild loops over all children.
func (*Storage) ForEachIndexation ¶
func (s *Storage) ForEachIndexation(consumer CachedIndexationConsumer, iteratorOptions ...IteratorOption)
ForEachIndexation loops over all indexations. indexation +1
func (*Storage) ForEachMessageID ¶
func (s *Storage) ForEachMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
ForEachMessageID loops over all message IDs.
func (*Storage) ForEachMessageIDWithIndex ¶
func (s *Storage) ForEachMessageIDWithIndex(index []byte, consumer IndexConsumer, iteratorOptions ...IteratorOption)
ForEachMessageIDWithIndex loops over all messages with the given index.
func (*Storage) ForEachMessageMetadataMessageID ¶
func (s *Storage) ForEachMessageMetadataMessageID(consumer MessageIDConsumer, iteratorOptions ...IteratorOption)
ForEachMessageMetadataMessageID loops over all message metadata message IDs.
func (*Storage) ForEachMilestoneIndex ¶
func (s *Storage) ForEachMilestoneIndex(consumer MilestoneIndexConsumer, iteratorOptions ...IteratorOption)
ForEachMilestoneIndex loops through all milestones.
func (*Storage) ForEachSolidEntryPointWithoutLocking ¶
func (s *Storage) ForEachSolidEntryPointWithoutLocking(consumer SolidEntryPointConsumer)
ForEachSolidEntryPointWithoutLocking loops over all solid entry points in the persistence layer. WriteLockSolidEntryPoints must be held while entering this function.
func (*Storage) ForEachUnreferencedMessage ¶
func (s *Storage) ForEachUnreferencedMessage(consumer UnreferencedMessageConsumer, iteratorOptions ...IteratorOption)
ForEachUnreferencedMessage loops over all unreferenced messages.
func (*Storage) IndexMessageIDs ¶
func (s *Storage) IndexMessageIDs(index []byte, iteratorOptions ...IteratorOption) hornet.MessageIDs
IndexMessageIDs returns all known message IDs for the given index. indexation +-0
func (*Storage) IndexationStorageSize ¶
func (*Storage) MarkDatabasesCorrupted ¶
func (*Storage) MarkDatabasesHealthy ¶
func (*Storage) MarkDatabasesTainted ¶
func (*Storage) MessageExistsInStore ¶
MessageExistsInStore returns if the given message exists in the persistence layer.
func (*Storage) MessageMetadataExistsInStore ¶
MessageMetadataExistsInStore returns if the given message metadata exists in the persistence layer.
func (*Storage) MessageMetadataStorageSize ¶
func (*Storage) MessageStorageSize ¶
func (*Storage) MilestoneCachedMessageOrNil ¶
func (s *Storage) MilestoneCachedMessageOrNil(milestoneIndex milestone.Index) *CachedMessage
MilestoneCachedMessageOrNil returns the cached message of a milestone index or nil if it doesn't exist. message +1
func (*Storage) MilestoneStorageSize ¶
func (*Storage) MilestoneTimestampByIndex ¶
MilestoneTimestampByIndex returns the timestamp of a milestone.
func (*Storage) MilestoneTimestampUnixByIndex ¶
MilestoneTimestampUnixByIndex returns the unix timestamp of a milestone.
func (*Storage) NonCachedStorage ¶
func (s *Storage) NonCachedStorage() *NonCachedStorage
func (*Storage) PrintSnapshotInfo ¶
func (s *Storage) PrintSnapshotInfo()
func (*Storage) ReadLockSolidEntryPoints ¶
func (s *Storage) ReadLockSolidEntryPoints()
func (*Storage) ReadUnlockSolidEntryPoints ¶
func (s *Storage) ReadUnlockSolidEntryPoints()
func (*Storage) ResetSolidEntryPointsWithoutLocking ¶
func (s *Storage) ResetSolidEntryPointsWithoutLocking()
ResetSolidEntryPointsWithoutLocking resets the solid entry points. WriteLockSolidEntryPoints must be held while entering this function.
func (*Storage) SearchLatestMilestoneIndexInStore ¶
SearchLatestMilestoneIndexInStore searches the latest milestone without accessing the cache layer.
func (*Storage) SetSnapshotInfo ¶
func (s *Storage) SetSnapshotInfo(sn *SnapshotInfo) error
func (*Storage) SetSnapshotMilestone ¶
func (*Storage) ShutdownChildrenStorage ¶
func (s *Storage) ShutdownChildrenStorage()
ShutdownChildrenStorage shuts down the children storage.
func (*Storage) ShutdownIndexationStorage ¶
func (s *Storage) ShutdownIndexationStorage()
ShutdownIndexationStorage shuts down the indexation storage.
func (*Storage) ShutdownMessagesStorage ¶
func (s *Storage) ShutdownMessagesStorage()
ShutdownMessagesStorage shuts down the messages storage.
func (*Storage) ShutdownMilestoneStorage ¶
func (s *Storage) ShutdownMilestoneStorage()
ShutdownMilestoneStorage shuts down milestones storage.
func (*Storage) ShutdownStorages ¶
func (s *Storage) ShutdownStorages()
ShutdownStorages shuts down all storages.
func (*Storage) ShutdownUnreferencedMessagesStorage ¶
func (s *Storage) ShutdownUnreferencedMessagesStorage()
ShutdownUnreferencedMessagesStorage shuts down the unreferenced messages storage.
func (*Storage) SnapshotInfo ¶
func (s *Storage) SnapshotInfo() *SnapshotInfo
func (*Storage) SolidEntryPoints ¶
func (s *Storage) SolidEntryPoints() *SolidEntryPoints
func (*Storage) SolidEntryPointsAddWithoutLocking ¶
func (s *Storage) SolidEntryPointsAddWithoutLocking(messageID hornet.MessageID, milestoneIndex milestone.Index)
SolidEntryPointsAddWithoutLocking adds a message to the solid entry points. WriteLockSolidEntryPoints must be held while entering this function.
func (*Storage) SolidEntryPointsContain ¶
func (*Storage) SolidEntryPointsIndex ¶
SolidEntryPointsIndex returns the index of a solid entry point and whether the message is a solid entry point or not.
func (*Storage) StoreChild ¶
func (s *Storage) StoreChild(parentMessageID hornet.MessageID, childMessageID hornet.MessageID) *CachedChild
StoreChild stores the child in the persistence layer and returns a cached object. child +1
func (*Storage) StoreIndexation ¶
func (s *Storage) StoreIndexation(index []byte, messageID hornet.MessageID) *CachedIndexation
StoreIndexation stores the indexation in the persistence layer and returns a cached object. indexation +1
func (*Storage) StoreMessageIfAbsent ¶
func (s *Storage) StoreMessageIfAbsent(message *Message) (cachedMsg *CachedMessage, newlyAdded bool)
StoreMessageIfAbsent returns a cached object and stores the message in the persistence layer if it was absent. message +1
func (*Storage) StoreMilestoneIfAbsent ¶
func (s *Storage) StoreMilestoneIfAbsent(index milestone.Index, messageID hornet.MessageID, timestamp time.Time) (*CachedMilestone, bool)
milestone +1
func (*Storage) StoreSolidEntryPointsWithoutLocking ¶
StoreSolidEntryPointsWithoutLocking stores the solid entry points in the persistence layer. WriteLockSolidEntryPoints must be held while entering this function.
func (*Storage) StoreUnreferencedMessage ¶
func (s *Storage) StoreUnreferencedMessage(msIndex milestone.Index, messageID hornet.MessageID) *CachedUnreferencedMessage
StoreUnreferencedMessage stores the unreferenced message in the persistence layer and returns a cached object. unreferencedTx +1
func (*Storage) StoredMetadataOrNil ¶
func (s *Storage) StoredMetadataOrNil(messageID hornet.MessageID) *MessageMetadata
StoredMetadataOrNil returns a metadata object without accessing the cache layer.
func (*Storage) TangleStore ¶
func (*Storage) UTXOManager ¶
func (*Storage) UnreferencedMessageIDs ¶
func (s *Storage) UnreferencedMessageIDs(msIndex milestone.Index, iteratorOptions ...IteratorOption) hornet.MessageIDs
UnreferencedMessageIDs returns all message IDs of unreferenced messages for that milestone.
func (*Storage) UnreferencedMessageStorageSize ¶
func (*Storage) UpdateDatabasesVersion ¶
UpdateDatabasesVersion tries to migrate the existing data to the new database version.
func (*Storage) WriteLockSolidEntryPoints ¶
func (s *Storage) WriteLockSolidEntryPoints()
func (*Storage) WriteUnlockSolidEntryPoints ¶
func (s *Storage) WriteUnlockSolidEntryPoints()
type StoreHealthTracker ¶
type StoreHealthTracker struct {
// contains filtered or unexported fields
}
func NewStoreHealthTracker ¶
func NewStoreHealthTracker(store kvstore.KVStore) (*StoreHealthTracker, error)
func (*StoreHealthTracker) CheckCorrectDatabaseVersion ¶
func (s *StoreHealthTracker) CheckCorrectDatabaseVersion() (bool, error)
func (*StoreHealthTracker) DatabaseVersion ¶
func (s *StoreHealthTracker) DatabaseVersion() (int, error)
DatabaseVersion returns the database version.
func (*StoreHealthTracker) IsCorrupted ¶
func (s *StoreHealthTracker) IsCorrupted() (bool, error)
func (*StoreHealthTracker) IsTainted ¶
func (s *StoreHealthTracker) IsTainted() (bool, error)
func (*StoreHealthTracker) MarkCorrupted ¶
func (s *StoreHealthTracker) MarkCorrupted() error
func (*StoreHealthTracker) MarkHealthy ¶
func (s *StoreHealthTracker) MarkHealthy() error
func (*StoreHealthTracker) MarkTainted ¶
func (s *StoreHealthTracker) MarkTainted() error
func (*StoreHealthTracker) UpdateDatabaseVersion ¶
func (s *StoreHealthTracker) UpdateDatabaseVersion() (bool, error)
UpdateDatabaseVersion tries to migrate the existing data to the new database version.
type UnreferencedMessage ¶
type UnreferencedMessage struct { objectstorage.StorableObjectFlags // contains filtered or unexported fields }
func NewUnreferencedMessage ¶
func NewUnreferencedMessage(msIndex milestone.Index, messageID hornet.MessageID) *UnreferencedMessage
func (*UnreferencedMessage) LatestMilestoneIndex ¶
func (t *UnreferencedMessage) LatestMilestoneIndex() milestone.Index
func (*UnreferencedMessage) MessageID ¶
func (t *UnreferencedMessage) MessageID() hornet.MessageID
func (*UnreferencedMessage) ObjectStorageKey ¶
func (t *UnreferencedMessage) ObjectStorageKey() []byte
func (*UnreferencedMessage) ObjectStorageValue ¶
func (t *UnreferencedMessage) ObjectStorageValue() (_ []byte)
func (*UnreferencedMessage) Update ¶
func (t *UnreferencedMessage) Update(_ objectstorage.StorableObject)
Source Files ¶
- child.go
- children_storage.go
- errors.go
- health.go
- health_db.go
- indexation.go
- indexation_storage.go
- message.go
- message_metadata.go
- messages_memcache.go
- messages_storage.go
- metadata_memcache.go
- milestones.go
- milestones_storage.go
- snapshot.go
- snapshot_db.go
- solid_entry_points.go
- solid_entry_points_store.go
- storage.go
- unreferenced_message.go
- unreferenced_message_storage.go