Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfIndexation(msg *Message) (indexation *iotago.Indexation)
- func MessageCaller(handler interface{}, params ...interface{})
- 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 PadIndexationIndex(index []byte) []byte
- type CachedChild
- type CachedChildren
- type CachedIndexation
- type CachedIndexationConsumer
- type CachedMessage
- 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) GetCachedMetadata() *CachedMetadata
- func (c *CachedMessage) GetMessage() *Message
- func (c *CachedMessage) GetMetadata() *MessageMetadata
- func (c *CachedMessage) Release(force ...bool)
- func (c *CachedMessage) Retain() *CachedMessage
- type CachedMessages
- type CachedMetadata
- type CachedMilestone
- type CachedMilestones
- type CachedUnreferencedMessage
- type CachedUnreferencedMessages
- type Child
- type ChildConsumer
- type Conflict
- type CoordinatorPublicKey
- type ErrDatabaseError
- type IndexConsumer
- type Indexation
- type IteratorOption
- type Message
- func (msg *Message) GetData() []byte
- func (msg *Message) GetIndexation() *iotago.Indexation
- func (msg *Message) GetMessage() *iotago.Message
- func (msg *Message) GetMessageID() hornet.MessageID
- func (msg *Message) GetMilestone() (ms *iotago.Milestone)
- func (msg *Message) GetNetworkID() uint64
- func (msg *Message) GetParents() hornet.MessageIDs
- func (msg *Message) GetSignatureForInputIndex(inputIndex uint16) *iotago.Ed25519Signature
- func (msg *Message) GetTransaction() *iotago.Transaction
- func (msg *Message) GetTransactionEssence() *iotago.TransactionEssence
- func (msg *Message) GetTransactionEssenceIndexation() *iotago.Indexation
- func (msg *Message) GetTransactionEssenceUTXOInputs() []*iotago.UTXOInputID
- func (msg *Message) IsMilestone() bool
- func (msg *Message) IsTransaction() bool
- func (msg *Message) ObjectStorageKey() []byte
- func (msg *Message) ObjectStorageValue() (_ []byte)
- func (msg *Message) Update(_ objectstorage.StorableObject)
- type MessageIDConsumer
- type MessageMetadata
- func (m *MessageMetadata) GetConeRootIndexes() (ycri milestone.Index, ocri milestone.Index, ci milestone.Index)
- func (m *MessageMetadata) GetConflict() Conflict
- func (m *MessageMetadata) GetMessageID() hornet.MessageID
- func (m *MessageMetadata) GetMetadata() byte
- func (m *MessageMetadata) GetParents() hornet.MessageIDs
- func (m *MessageMetadata) GetReferenced() (bool, milestone.Index)
- func (m *MessageMetadata) GetSolidificationTimestamp() int32
- 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) ObjectStorageKey() []byte
- func (m *MessageMetadata) ObjectStorageValue() (data []byte)
- 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) Update(_ objectstorage.StorableObject)
- type MessagesMemcache
- type MetadataMemcache
- type Milestone
- type MilestoneIndexConsumer
- type ReadOption
- type SnapshotInfo
- type SolidEntryPoints
- func (s *SolidEntryPoints) Add(messageID hornet.MessageID, milestoneIndex milestone.Index)
- func (s *SolidEntryPoints) Clear()
- func (s *SolidEntryPoints) Contains(messageID hornet.MessageID) bool
- func (s *SolidEntryPoints) GetBytes() []byte
- func (s *SolidEntryPoints) Hashes() hornet.MessageIDs
- func (s *SolidEntryPoints) Index(messageID hornet.MessageID) (milestone.Index, bool)
- func (s *SolidEntryPoints) IsModified() bool
- func (s *SolidEntryPoints) SetModified(modified bool)
- type Storage
- func (s *Storage) AddMessageToStorage(message *Message, latestMilestoneIndex milestone.Index, requested bool, ...) (cachedMessage *CachedMessage, alreadyAdded bool)
- func (s *Storage) CleanupDatabases() error
- 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) DatabaseSupportsCleanup() 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) FindClosestNextMilestoneOrNil(index milestone.Index) *CachedMilestone
- 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) ForEachUnreferencedMessage(consumer UnreferencedMessageConsumer, iteratorOptions ...IteratorOption)
- func (s *Storage) GetCachedChildrenOfMessageID(messageID hornet.MessageID, iteratorOptions ...IteratorOption) CachedChildren
- func (s *Storage) GetCachedMessageMetadataOrNil(messageID hornet.MessageID) *CachedMetadata
- func (s *Storage) GetCachedMessageOrNil(messageID hornet.MessageID) *CachedMessage
- func (s *Storage) GetCachedMilestoneOrNil(milestoneIndex milestone.Index) *CachedMilestone
- func (s *Storage) GetChildrenMessageIDs(messageID hornet.MessageID, iteratorOptions ...IteratorOption) hornet.MessageIDs
- func (s *Storage) GetChildrenStorageSize() int
- func (s *Storage) GetConfirmedMilestoneIndex() milestone.Index
- func (s *Storage) GetDatabaseSize() (int64, error)
- func (s *Storage) GetIndexMessageIDs(index []byte, iteratorOptions ...IteratorOption) hornet.MessageIDs
- func (s *Storage) GetIndexationStorageSize() int
- func (s *Storage) GetLatestMilestoneIndex() milestone.Index
- func (s *Storage) GetMessageMetadataStorageSize() int
- func (s *Storage) GetMessageStorageSize() int
- func (s *Storage) GetMilestoneCachedMessageOrNil(milestoneIndex milestone.Index) *CachedMessage
- func (s *Storage) GetMilestoneStorageSize() int
- func (s *Storage) GetSnapshotInfo() *SnapshotInfo
- func (s *Storage) GetStoredMetadataOrNil(messageID hornet.MessageID) *MessageMetadata
- func (s *Storage) GetUnreferencedMessageIDs(msIndex milestone.Index, iteratorOptions ...IteratorOption) hornet.MessageIDs
- func (s *Storage) GetUnreferencedMessageStorageSize() int
- func (s *Storage) IsCorrectDatabaseVersion() bool
- func (s *Storage) IsDatabaseCorrupted() bool
- func (s *Storage) IsDatabaseTainted() bool
- func (s *Storage) IsNodeAlmostSynced() bool
- func (s *Storage) IsNodeSynced() bool
- func (s *Storage) IsNodeSyncedWithThreshold(threshold milestone.Index) bool
- func (s *Storage) IsNodeSyncedWithinBelowMaxDepth() bool
- func (s *Storage) KVStore() kvstore.KVStore
- func (s *Storage) KeyManager() *keymanager.KeyManager
- func (s *Storage) MarkDatabaseCorrupted()
- func (s *Storage) MarkDatabaseHealthy()
- func (s *Storage) MarkDatabaseTainted()
- func (s *Storage) MessageExistsInStore(messageID hornet.MessageID) bool
- func (s *Storage) MessageMetadataExistsInStore(messageID hornet.MessageID) bool
- func (s *Storage) OverwriteConfirmedMilestoneIndex(index milestone.Index)
- func (s *Storage) ReadLockSolidEntryPoints()
- func (s *Storage) ReadUnlockSolidEntryPoints()
- func (s *Storage) ResetMilestoneIndexes()
- func (s *Storage) ResetSolidEntryPoints()
- func (s *Storage) SearchLatestMilestoneIndexInStore() milestone.Index
- func (s *Storage) SetConfirmedMilestoneIndex(index milestone.Index, updateSynced ...bool)
- func (s *Storage) SetLatestMilestoneIndex(index milestone.Index, updateSynced ...bool) bool
- func (s *Storage) SetSnapshotInfo(sn *SnapshotInfo)
- func (s *Storage) SetSnapshotMilestone(networkID uint64, snapshotIndex milestone.Index, ...)
- 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) SolidEntryPointsAdd(messageID hornet.MessageID, milestoneIndex milestone.Index)
- func (s *Storage) SolidEntryPointsContain(messageID hornet.MessageID) bool
- func (s *Storage) SolidEntryPointsIndex(messageID hornet.MessageID) (milestone.Index, bool)
- 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) StoreMilestone(cachedMessage *CachedMessage, ms *iotago.Milestone, requested bool)
- func (s *Storage) StoreSolidEntryPoints()
- func (s *Storage) StoreUnreferencedMessage(msIndex milestone.Index, messageID hornet.MessageID) *CachedUnreferencedMessage
- func (s *Storage) UTXO() *utxo.Manager
- func (s *Storage) UpdateDatabaseVersion() bool
- func (s *Storage) VerifyMilestone(message *Message) *iotago.Milestone
- func (s *Storage) WaitForNodeSynced(timeout time.Duration) bool
- func (s *Storage) WriteLockSolidEntryPoints()
- func (s *Storage) WriteUnlockSolidEntryPoints()
- type UnreferencedMessage
- func (t *UnreferencedMessage) GetLatestMilestoneIndex() milestone.Index
- func (t *UnreferencedMessage) GetMessageID() 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 (
ErrInvalidMilestone = errors.New("invalid milestone")
)
var ( // ErrNothingToCleanUp is returned when nothing is there to clean up in the database. ErrNothingToCleanUp = errors.New("Nothing to clean up in the databases") )
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 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 PadIndexationIndex ¶
PadIndexationIndex returns a padded indexation index.
Types ¶
type CachedChild ¶
type CachedChild struct {
objectstorage.CachedObject
}
func (*CachedChild) GetChild ¶
func (c *CachedChild) GetChild() *Child
func (*CachedChild) Retain ¶
func (c *CachedChild) Retain() *CachedChild
type CachedChildren ¶
type CachedChildren []*CachedChild
func (CachedChildren) Release ¶
func (cachedChildren CachedChildren) Release(force ...bool)
func (CachedChildren) Retain ¶
func (cachedChildren CachedChildren) Retain() CachedChildren
type CachedIndexation ¶
type CachedIndexation struct {
objectstorage.CachedObject
}
func (*CachedIndexation) GetIndexation ¶
func (c *CachedIndexation) GetIndexation() *Indexation
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 (*CachedMessage) ConsumeMessage ¶
func (c *CachedMessage) ConsumeMessage(consumer func(*Message))
msg -1 meta -1
func (*CachedMessage) ConsumeMessageAndMetadata ¶
func (c *CachedMessage) ConsumeMessageAndMetadata(consumer func(*Message, *MessageMetadata))
msg -1 meta -1
func (*CachedMessage) ConsumeMetadata ¶
func (c *CachedMessage) ConsumeMetadata(consumer func(*MessageMetadata))
msg -1 meta -1
func (*CachedMessage) Exists ¶
func (c *CachedMessage) Exists() bool
func (*CachedMessage) GetCachedMetadata ¶
func (c *CachedMessage) GetCachedMetadata() *CachedMetadata
meta +1
func (*CachedMessage) GetMessage ¶
func (c *CachedMessage) GetMessage() *Message
func (*CachedMessage) GetMetadata ¶
func (c *CachedMessage) GetMetadata() *MessageMetadata
type CachedMessages ¶
type CachedMessages []*CachedMessage
type CachedMetadata ¶
type CachedMetadata struct {
objectstorage.CachedObject
}
CachedMetadata contains the cached object only for metadata.
func (*CachedMetadata) ConsumeMetadata ¶
func (c *CachedMetadata) ConsumeMetadata(consumer func(*MessageMetadata))
meta -1
func (*CachedMetadata) GetMetadata ¶
func (c *CachedMetadata) GetMetadata() *MessageMetadata
func (*CachedMetadata) Retain ¶
func (c *CachedMetadata) Retain() *CachedMetadata
type CachedMilestone ¶
type CachedMilestone struct {
objectstorage.CachedObject
}
Cached Object
func (*CachedMilestone) GetMilestone ¶
func (c *CachedMilestone) GetMilestone() *Milestone
type CachedMilestones ¶
type CachedMilestones []*CachedMilestone
type CachedUnreferencedMessage ¶
type CachedUnreferencedMessage struct {
objectstorage.CachedObject
}
func (*CachedUnreferencedMessage) GetUnreferencedMessage ¶
func (c *CachedUnreferencedMessage) GetUnreferencedMessage() *UnreferencedMessage
type CachedUnreferencedMessages ¶
type CachedUnreferencedMessages []*CachedUnreferencedMessage
func (CachedUnreferencedMessages) Release ¶
func (cachedUnreferencedMessages CachedUnreferencedMessages) Release(force ...bool)
type Child ¶
type Child struct { objectstorage.StorableObjectFlags // contains filtered or unexported fields }
func (*Child) GetChildMessageID ¶
func (*Child) GetParentMessageID ¶
func (*Child) ObjectStorageKey ¶
func (*Child) ObjectStorageValue ¶
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 CoordinatorPublicKey ¶
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) GetHash ¶
func (i *Indexation) GetHash() hornet.MessageID
func (*Indexation) GetMessageID ¶
func (i *Indexation) GetMessageID() 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 = objectstorage.IteratorOption
type Message ¶
type Message struct { objectstorage.StorableObjectFlags // contains filtered or unexported fields }
Storable Object
func MessageFromBytes ¶
func MessageFromBytes(data []byte, deSeriMode iotago.DeSerializationMode) (*Message, error)
func NewMessage ¶
func (*Message) GetIndexation ¶
func (msg *Message) GetIndexation() *iotago.Indexation
func (*Message) GetMessage ¶
func (*Message) GetMessageID ¶
func (*Message) GetMilestone ¶
func (*Message) GetNetworkID ¶
func (*Message) GetParents ¶
func (msg *Message) GetParents() hornet.MessageIDs
func (*Message) GetSignatureForInputIndex ¶
func (msg *Message) GetSignatureForInputIndex(inputIndex uint16) *iotago.Ed25519Signature
func (*Message) GetTransaction ¶
func (msg *Message) GetTransaction() *iotago.Transaction
func (*Message) GetTransactionEssence ¶
func (msg *Message) GetTransactionEssence() *iotago.TransactionEssence
func (*Message) GetTransactionEssenceIndexation ¶
func (msg *Message) GetTransactionEssenceIndexation() *iotago.Indexation
func (*Message) GetTransactionEssenceUTXOInputs ¶
func (msg *Message) GetTransactionEssenceUTXOInputs() []*iotago.UTXOInputID
func (*Message) IsMilestone ¶
func (*Message) IsTransaction ¶
func (*Message) ObjectStorageKey ¶
func (*Message) ObjectStorageValue ¶
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 (*MessageMetadata) GetConeRootIndexes ¶
func (*MessageMetadata) GetConflict ¶
func (m *MessageMetadata) GetConflict() Conflict
func (*MessageMetadata) GetMessageID ¶
func (m *MessageMetadata) GetMessageID() hornet.MessageID
func (*MessageMetadata) GetMetadata ¶
func (m *MessageMetadata) GetMetadata() byte
func (*MessageMetadata) GetParents ¶
func (m *MessageMetadata) GetParents() hornet.MessageIDs
func (*MessageMetadata) GetReferenced ¶
func (m *MessageMetadata) GetReferenced() (bool, milestone.Index)
func (*MessageMetadata) GetSolidificationTimestamp ¶
func (m *MessageMetadata) GetSolidificationTimestamp() int32
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) ObjectStorageKey ¶
func (m *MessageMetadata) ObjectStorageKey() []byte
func (*MessageMetadata) ObjectStorageValue ¶
func (m *MessageMetadata) ObjectStorageValue() (data []byte)
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) Update ¶
func (m *MessageMetadata) Update(_ objectstorage.StorableObject)
type MessagesMemcache ¶
type MessagesMemcache struct {
// contains filtered or unexported fields
}
func NewMessagesMemcache ¶
func NewMessagesMemcache(storage *Storage) *MessagesMemcache
NewMessagesMemcache creates a new MessagesMemcache instance.
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.
func (*MessagesMemcache) GetCachedMessageOrNil ¶
func (c *MessagesMemcache) GetCachedMessageOrNil(messageID hornet.MessageID) *CachedMessage
msg +1
type MetadataMemcache ¶
type MetadataMemcache struct {
// contains filtered or unexported fields
}
func NewMetadataMemcache ¶
func NewMetadataMemcache(storage *Storage) *MetadataMemcache
NewMetadataMemcache creates a new NewMetadataMemcache instance.
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.
func (*MetadataMemcache) GetCachedMetadataOrNil ¶
func (c *MetadataMemcache) GetCachedMetadataOrNil(messageID hornet.MessageID) *CachedMetadata
metadata +1
type Milestone ¶
type Milestone struct { objectstorage.StorableObjectFlags Index milestone.Index MessageID hornet.MessageID Timestamp time.Time }
Storable Object
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 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) GetBytes ¶
func (i *SnapshotInfo) GetBytes() []byte
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) Clear ¶
func (s *SolidEntryPoints) Clear()
func (*SolidEntryPoints) Contains ¶
func (s *SolidEntryPoints) Contains(messageID hornet.MessageID) bool
func (*SolidEntryPoints) GetBytes ¶
func (s *SolidEntryPoints) GetBytes() []byte
func (*SolidEntryPoints) Hashes ¶
func (s *SolidEntryPoints) Hashes() hornet.MessageIDs
func (*SolidEntryPoints) IsModified ¶
func (s *SolidEntryPoints) IsModified() bool
func (*SolidEntryPoints) SetModified ¶
func (s *SolidEntryPoints) SetModified(modified bool)
type Storage ¶
type Storage struct { // events Events *packageEvents // contains filtered or unexported fields }
func New ¶
func New(databaseDirectory string, store kvstore.KVStore, cachesProfile *profile.Caches, belowMaxDepth int, keyManager *keymanager.KeyManager, milestonePublicKeyCount int) *Storage
func (*Storage) AddMessageToStorage ¶
func (s *Storage) AddMessageToStorage(message *Message, latestMilestoneIndex milestone.Index, requested bool, forceRelease bool, reapply bool) (cachedMessage *CachedMessage, alreadyAdded bool)
msg +1
func (*Storage) CleanupDatabases ¶
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
milestone +-0
func (*Storage) DatabaseSupportsCleanup ¶
func (*Storage) DeleteChild ¶
child +-0
func (*Storage) DeleteChildren ¶
func (s *Storage) DeleteChildren(messageID hornet.MessageID, iteratorOptions ...IteratorOption)
child +-0
func (*Storage) DeleteIndexation ¶
indexation +-0
func (*Storage) DeleteIndexationByKey ¶
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 ¶
+-0
func (*Storage) DeleteUnreferencedMessages ¶
func (s *Storage) DeleteUnreferencedMessages(msIndex milestone.Index, iteratorOptions ...IteratorOption) int
DeleteUnreferencedMessages deletes unreferenced message entries.
func (*Storage) FindClosestNextMilestoneOrNil ¶
func (s *Storage) FindClosestNextMilestoneOrNil(index milestone.Index) *CachedMilestone
message +1
func (*Storage) FlushChildrenStorage ¶
func (s *Storage) FlushChildrenStorage()
func (*Storage) FlushIndexationStorage ¶
func (s *Storage) FlushIndexationStorage()
func (*Storage) FlushMessagesStorage ¶
func (s *Storage) FlushMessagesStorage()
func (*Storage) FlushMilestoneStorage ¶
func (s *Storage) FlushMilestoneStorage()
func (*Storage) FlushStorages ¶
func (s *Storage) FlushStorages()
func (*Storage) FlushUnreferencedMessagesStorage ¶
func (s *Storage) FlushUnreferencedMessagesStorage()
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) ForEachUnreferencedMessage ¶
func (s *Storage) ForEachUnreferencedMessage(consumer UnreferencedMessageConsumer, iteratorOptions ...IteratorOption)
ForEachUnreferencedMessage loops over all unreferenced messages.
func (*Storage) GetCachedChildrenOfMessageID ¶
func (s *Storage) GetCachedChildrenOfMessageID(messageID hornet.MessageID, iteratorOptions ...IteratorOption) CachedChildren
GetCachedChildrenOfMessageID returns the cached children of a message. children +1
func (*Storage) GetCachedMessageMetadataOrNil ¶
func (s *Storage) GetCachedMessageMetadataOrNil(messageID hornet.MessageID) *CachedMetadata
metadata +1
func (*Storage) GetCachedMessageOrNil ¶
func (s *Storage) GetCachedMessageOrNil(messageID hornet.MessageID) *CachedMessage
msg +1
func (*Storage) GetCachedMilestoneOrNil ¶
func (s *Storage) GetCachedMilestoneOrNil(milestoneIndex milestone.Index) *CachedMilestone
milestone +1
func (*Storage) GetChildrenMessageIDs ¶
func (s *Storage) GetChildrenMessageIDs(messageID hornet.MessageID, iteratorOptions ...IteratorOption) hornet.MessageIDs
children +-0
func (*Storage) GetChildrenStorageSize ¶
func (*Storage) GetConfirmedMilestoneIndex ¶
GetConfirmedMilestoneIndex returns the confirmed milestone index.
func (*Storage) GetDatabaseSize ¶
GetDatabaseSize returns the size of the database.
func (*Storage) GetIndexMessageIDs ¶
func (s *Storage) GetIndexMessageIDs(index []byte, iteratorOptions ...IteratorOption) hornet.MessageIDs
indexation +-0
func (*Storage) GetIndexationStorageSize ¶
func (*Storage) GetLatestMilestoneIndex ¶
GetLatestMilestoneIndex returns the latest milestone index.
func (*Storage) GetMessageMetadataStorageSize ¶
func (*Storage) GetMessageStorageSize ¶
func (*Storage) GetMilestoneCachedMessageOrNil ¶
func (s *Storage) GetMilestoneCachedMessageOrNil(milestoneIndex milestone.Index) *CachedMessage
GetMilestoneOrNil returns the CachedMessage of a milestone index or nil if it doesn't exist. message +1
func (*Storage) GetMilestoneStorageSize ¶
func (*Storage) GetSnapshotInfo ¶
func (s *Storage) GetSnapshotInfo() *SnapshotInfo
func (*Storage) GetStoredMetadataOrNil ¶
func (s *Storage) GetStoredMetadataOrNil(messageID hornet.MessageID) *MessageMetadata
GetStoredMetadataOrNil returns a metadata object without accessing the cache layer.
func (*Storage) GetUnreferencedMessageIDs ¶
func (s *Storage) GetUnreferencedMessageIDs(msIndex milestone.Index, iteratorOptions ...IteratorOption) hornet.MessageIDs
GetUnreferencedMessageIDs returns all message IDs of unreferenced messages for that milestone.
func (*Storage) GetUnreferencedMessageStorageSize ¶
func (*Storage) IsCorrectDatabaseVersion ¶
func (*Storage) IsDatabaseCorrupted ¶
func (*Storage) IsDatabaseTainted ¶
func (*Storage) IsNodeAlmostSynced ¶
IsNodeAlmostSynced returns whether the node is synced within "isNodeAlmostSyncedThreshold".
func (*Storage) IsNodeSynced ¶
IsNodeSynced returns whether the node is synced.
func (*Storage) IsNodeSyncedWithThreshold ¶
IsNodeSyncedWithThreshold returns whether the node is synced within a given threshold.
func (*Storage) IsNodeSyncedWithinBelowMaxDepth ¶
IsNodeSyncedWithinBelowMaxDepth returns whether the node is synced within "belowMaxDepth".
func (*Storage) KeyManager ¶
func (s *Storage) KeyManager() *keymanager.KeyManager
func (*Storage) MarkDatabaseCorrupted ¶
func (s *Storage) MarkDatabaseCorrupted()
func (*Storage) MarkDatabaseHealthy ¶
func (s *Storage) MarkDatabaseHealthy()
func (*Storage) MarkDatabaseTainted ¶
func (s *Storage) MarkDatabaseTainted()
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) OverwriteConfirmedMilestoneIndex ¶
OverwriteConfirmedMilestoneIndex is used to set older confirmed milestones (revalidation).
func (*Storage) ReadLockSolidEntryPoints ¶
func (s *Storage) ReadLockSolidEntryPoints()
func (*Storage) ReadUnlockSolidEntryPoints ¶
func (s *Storage) ReadUnlockSolidEntryPoints()
func (*Storage) ResetMilestoneIndexes ¶
func (s *Storage) ResetMilestoneIndexes()
func (*Storage) ResetSolidEntryPoints ¶
func (s *Storage) ResetSolidEntryPoints()
WriteLockSolidEntryPoints must be held while entering this function
func (*Storage) SearchLatestMilestoneIndexInStore ¶
SearchLatestMilestoneIndexInStore searches the latest milestone without accessing the cache layer.
func (*Storage) SetConfirmedMilestoneIndex ¶
SetConfirmedMilestoneIndex sets the confirmed milestone index.
func (*Storage) SetLatestMilestoneIndex ¶
SetLatestMilestoneIndex sets the latest milestone index.
func (*Storage) SetSnapshotInfo ¶
func (s *Storage) SetSnapshotInfo(sn *SnapshotInfo)
func (*Storage) SetSnapshotMilestone ¶
func (*Storage) ShutdownChildrenStorage ¶
func (s *Storage) ShutdownChildrenStorage()
func (*Storage) ShutdownIndexationStorage ¶
func (s *Storage) ShutdownIndexationStorage()
func (*Storage) ShutdownMessagesStorage ¶
func (s *Storage) ShutdownMessagesStorage()
func (*Storage) ShutdownMilestoneStorage ¶
func (s *Storage) ShutdownMilestoneStorage()
func (*Storage) ShutdownStorages ¶
func (s *Storage) ShutdownStorages()
func (*Storage) ShutdownUnreferencedMessagesStorage ¶
func (s *Storage) ShutdownUnreferencedMessagesStorage()
func (*Storage) SolidEntryPointsAdd ¶
WriteLockSolidEntryPoints must be held while entering this function
func (*Storage) SolidEntryPointsContain ¶
func (*Storage) SolidEntryPointsIndex ¶
func (*Storage) StoreChild ¶
func (s *Storage) StoreChild(parentMessageID hornet.MessageID, childMessageID hornet.MessageID) *CachedChild
child +1
func (*Storage) StoreIndexation ¶
func (s *Storage) StoreIndexation(index []byte, messageID hornet.MessageID) *CachedIndexation
indexation +1
func (*Storage) StoreMessageIfAbsent ¶
func (s *Storage) StoreMessageIfAbsent(message *Message) (cachedMsg *CachedMessage, newlyAdded bool)
msg +1
func (*Storage) StoreMilestone ¶
func (s *Storage) StoreMilestone(cachedMessage *CachedMessage, ms *iotago.Milestone, requested bool)
StoreMilestone stores the milestone in the storage layer and triggers the ReceivedValidMilestone event.
func (*Storage) StoreSolidEntryPoints ¶
func (s *Storage) StoreSolidEntryPoints()
WriteLockSolidEntryPoints must be held while entering this function
func (*Storage) StoreUnreferencedMessage ¶
func (s *Storage) StoreUnreferencedMessage(msIndex milestone.Index, messageID hornet.MessageID) *CachedUnreferencedMessage
unreferencedTx +1
func (*Storage) UpdateDatabaseVersion ¶
UpdateDatabaseVersion tries to migrate the existing data to the new database version.
func (*Storage) VerifyMilestone ¶
VerifyMilestone checks if the message contains a valid milestone payload. Returns a milestone payload if the signature is valid.
func (*Storage) WaitForNodeSynced ¶
WaitForNodeSynced waits at most "timeout" duration for the node to become fully sync. if it is not at least synced within threshold, it will return false immediately. this is used to avoid small glitches of IsNodeSynced when the sync state is important, but a new milestone came in lately.
func (*Storage) WriteLockSolidEntryPoints ¶
func (s *Storage) WriteLockSolidEntryPoints()
func (*Storage) WriteUnlockSolidEntryPoints ¶
func (s *Storage) WriteUnlockSolidEntryPoints()
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) GetLatestMilestoneIndex ¶
func (t *UnreferencedMessage) GetLatestMilestoneIndex() milestone.Index
func (*UnreferencedMessage) GetMessageID ¶
func (t *UnreferencedMessage) GetMessageID() 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_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