Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyLedgerDiffWithoutLocking(diff map[trinary.Hash]int64, index milestone_index.MilestoneIndex) error
- func BundleCaller(handler interface{}, params ...interface{})
- func CheckIfMilestone(bndl *Bundle) (result bool, err error)
- func ConfigureDatabases(directory string, badgerOpts *profile.BadgerOpts)
- func ConfigureMilestones(cooAddr string, cooSecLvl int, numOfKeysInMS uint64)
- func ContainsBundle(tailTxHash trinary.Hash) bool
- func ContainsBundleTransaction(bundleHash trinary.Hash, transactionHash trinary.Hash, isTail bool) bool
- func ContainsMilestone(milestoneIndex milestone_index.MilestoneIndex) bool
- func ContainsTransaction(transactionHash trinary.Hash) bool
- func DeleteAddress(address trinary.Hash, txHash trinary.Hash)
- func DeleteApprovers(transactionHash trinary.Hash)
- func DeleteBundle(tailTxHash trinary.Hash)
- func DeleteBundleTransaction(bundleHash trinary.Hash, transactionHash trinary.Hash, isTail bool)
- func DeleteFirstSeenTxs(msIndex milestone_index.MilestoneIndex)
- func DeleteLedgerBalancesInDatabase() error
- func DeleteLedgerDiffForMilestone(index milestone_index.MilestoneIndex) error
- func DeleteMilestone(milestoneIndex milestone_index.MilestoneIndex)
- func DeleteTag(txTag trinary.Trytes, txHash trinary.Hash)
- func DeleteTags(txTag trinary.Trytes)
- func DeleteTransaction(transactionHash trinary.Hash)
- func FixFirstSeenTxs(msIndex milestone_index.MilestoneIndex)
- func GetAddressesStorageSize() int
- func GetAllLedgerBalances(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
- func GetAllLedgerBalancesWithoutLocking(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
- func GetAllSnapshotBalances(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
- func GetAllSnapshotBalancesWithoutLocking(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
- func GetApproverHashes(transactionHash trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
- func GetApproversStorageSize() int
- func GetBalanceForAddress(address trinary.Hash) (uint64, milestone_index.MilestoneIndex, error)
- func GetBalanceForAddressWithoutLocking(address trinary.Hash) (uint64, milestone_index.MilestoneIndex, error)
- func GetBundleStorageSize() int
- func GetBundleTailTransactionHashes(bundleHash trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
- func GetBundleTransactionHashes(bundleHash trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
- func GetBundleTransactionsStorageSize() int
- func GetFirstSeenTxHashes(msIndex milestone_index.MilestoneIndex, forceRelease bool, maxFind ...int) []trinary.Hash
- func GetFirstSeenTxStorageSize() int
- func GetLatestMilestoneIndex() milestone_index.MilestoneIndex
- func GetLatestSeenMilestoneIndexFromSnapshot() milestone_index.MilestoneIndex
- func GetLedgerDiffForMilestone(index milestone_index.MilestoneIndex, abortSignal <-chan struct{}) (map[trinary.Hash]int64, error)
- func GetLedgerDiffForMilestoneWithoutLocking(index milestone_index.MilestoneIndex, abortSignal <-chan struct{}) (map[trinary.Hash]int64, error)
- func GetMilestoneStorageSize() int
- func GetSolidEntryPointsHashes() []trinary.Hash
- func GetSolidMilestoneIndex() milestone_index.MilestoneIndex
- func GetSpentAddressesStorageSize() int
- func GetTagHashes(txTag trinary.Trytes, forceRelease bool, maxFind ...int) []trinary.Hash
- func GetTagsStorageSize() int
- func GetTransactionHashesForAddress(address trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
- func GetTransactionStorageSize() int
- func IsCorrectDatabaseVersion() bool
- func IsDatabaseCorrupted() bool
- func IsMaybeMilestone(cachedTx *CachedTransaction) bool
- func IsMaybeMilestoneTx(cachedTx *CachedTransaction) bool
- func IsNodeSynced() bool
- func IsNodeSyncedWithThreshold() bool
- func LoadInitialValuesFromDatabase()
- func MarkAddressAsSpent(address trinary.Trytes) bool
- func MarkAddressAsSpentBinaryWithoutLocking(address []byte) bool
- func MarkDatabaseCorrupted()
- func MarkDatabaseHealthy()
- func NewTransactionCaller(handler interface{}, params ...interface{})
- func OnTailTransactionSolid(cachedTx *CachedTransaction)
- func ReadLockLedger()
- func ReadLockSolidEntryPoints()
- func ReadLockSpentAddresses()
- func ReadUnlockLedger()
- func ReadUnlockSolidEntryPoints()
- func ReadUnlockSpentAddresses()
- func RemoveTransactionFromBundle(tx *transaction.Transaction) map[trinary.Hash]struct{}
- func ResetSolidEntryPoints()
- func SearchLatestMilestoneIndex() milestone_index.MilestoneIndex
- func SetLatestMilestone(cachedBndl *CachedBundle) error
- func SetLatestSeenMilestoneIndexFromSnapshot(milestoneIndex milestone_index.MilestoneIndex)
- func SetSnapshotInfo(sn *SnapshotInfo)
- func SetSnapshotMilestone(milestoneHash trinary.Hash, snapshotIndex milestone_index.MilestoneIndex, ...)
- func SetSolidMilestone(cachedBndl *CachedBundle)
- func SetSolidMilestoneIndex(index milestone_index.MilestoneIndex)
- func ShutdownAddressStorage()
- func ShutdownApproversStorage()
- func ShutdownBundleStorage()
- func ShutdownBundleTransactionsStorage()
- func ShutdownFirstSeenTxsStorage()
- func ShutdownMilestoneStorage()
- func ShutdownSpentAddressesStorage()
- func ShutdownTagsStorage()
- func ShutdownTransactionStorage()
- func SolidEntryPointsAdd(transactionHash trinary.Hash, milestoneIndex milestone_index.MilestoneIndex)
- func SolidEntryPointsContain(transactionHash trinary.Hash) bool
- func StoreLedgerBalancesInDatabase(balances map[trinary.Hash]uint64, index milestone_index.MilestoneIndex) error
- func StoreSnapshotBalancesInDatabase(balances map[trinary.Hash]uint64, index milestone_index.MilestoneIndex) error
- func StoreSolidEntryPoints()
- func StreamSpentAddressesToWriter(buf io.Writer, abortSignal <-chan struct{}) (int32, error)
- func TransactionCaller(handler interface{}, params ...interface{})
- func TransactionConfirmedCaller(handler interface{}, params ...interface{})
- func TryConstructBundle(cachedTx *CachedTransaction, isSolidTail bool)
- func WasAddressSpentFrom(address trinary.Trytes) bool
- func WriteLockLedger()
- func WriteLockSolidEntryPoints()
- func WriteLockSpentAddresses()
- func WriteUnlockLedger()
- func WriteUnlockSolidEntryPoints()
- func WriteUnlockSpentAddresses()
- type Bundle
- func (bundle *Bundle) ApplySpentAddresses()
- func (bundle *Bundle) GetBranch(forceRelease bool) trinary.Hash
- func (bundle *Bundle) GetHash() trinary.Hash
- func (bundle *Bundle) GetHead() *CachedTransaction
- func (bundle *Bundle) GetLedgerChanges() map[trinary.Trytes]int64
- func (bundle *Bundle) GetMetadata() byte
- func (bundle *Bundle) GetMilestoneHash() trinary.Hash
- func (bundle *Bundle) GetMilestoneIndex() milestone_index.MilestoneIndex
- func (bundle *Bundle) GetStorageKey() []byte
- func (bundle *Bundle) GetTail() *CachedTransaction
- func (bundle *Bundle) GetTailHash() trinary.Hash
- func (bundle *Bundle) GetTransactionHashes() []trinary.Hash
- func (bundle *Bundle) GetTransactions() CachedTransactions
- func (bundle *Bundle) GetTrunk(forceRelease bool) trinary.Hash
- func (bundle *Bundle) IsConfirmed() bool
- func (bundle *Bundle) IsMilestone() bool
- func (bundle *Bundle) IsSolid() bool
- func (bundle *Bundle) IsValid() bool
- func (bundle *Bundle) IsValueSpam() bool
- func (bundle *Bundle) MarshalBinary() (data []byte, err error)
- func (bundle *Bundle) ResetSolidAndConfirmed()
- func (bundle *Bundle) UnmarshalBinary(data []byte) error
- func (bundle *Bundle) Update(other objectstorage.StorableObject)
- func (bundle *Bundle) ValidStrictSemantics() bool
- type BundleTransaction
- func (bt *BundleTransaction) GetBundleHash() trinary.Hash
- func (bt *BundleTransaction) GetStorageKey() []byte
- func (bt *BundleTransaction) GetTransactionHash() trinary.Hash
- func (bt *BundleTransaction) MarshalBinary() (data []byte, err error)
- func (bt *BundleTransaction) UnmarshalBinary(data []byte) error
- func (bt *BundleTransaction) Update(other objectstorage.StorableObject)
- type CachedAddress
- type CachedAddresses
- type CachedAppprovers
- type CachedApprover
- type CachedBundle
- type CachedBundleTransaction
- type CachedBundleTransactions
- type CachedBundles
- type CachedFirstSeenTx
- type CachedFirstSeenTxs
- type CachedMilestone
- type CachedSpentAddress
- type CachedTag
- type CachedTags
- type CachedTransaction
- func AddTransactionToStorage(hornetTx *hornet.Transaction, ...) (cachedTx *CachedTransaction, alreadyAdded bool)
- func GetCachedTransactionOrNil(transactionHash trinary.Hash) *CachedTransaction
- func StoreTransactionIfAbsent(transaction *hornet.Transaction) (cachedTx *CachedTransaction, newlyAdded bool)
- func (c *CachedTransaction) ConsumeTransaction(consumer func(*hornet.Transaction, *hornet.TransactionMetadata))
- func (c *CachedTransaction) Exists() bool
- func (c *CachedTransaction) GetMetadata() *hornet.TransactionMetadata
- func (c *CachedTransaction) GetTransaction() *hornet.Transaction
- func (c *CachedTransaction) Release(force ...bool)
- func (c *CachedTransaction) Retain() *CachedTransaction
- type CachedTransactions
- type ErrDatabaseError
- type Milestone
- type SnapshotInfo
Constants ¶
const ( HORNET_BUNDLE_METADATA_SOLID = 0 HORNET_BUNDLE_METADATA_VALID = 1 HORNET_BUNDLE_METADATA_CONFIRMED = 2 HORNET_BUNDLE_METADATA_IS_MILESTONE = 3 HORNET_BUNDLE_METADATA_IS_VALUE_SPAM = 4 HORNET_BUNDLE_METADATA_VALID_STRICT_SEMANTICS = 5 )
const ( DBPrefixHealth byte = 0 DBPrefixTransactions byte = 1 DBPrefixTransactionMetadata byte = 2 DBPrefixBundleTransactions byte = 3 DBPrefixBundles byte = 4 DBPrefixAddresses byte = 5 DBPrefixMilestones byte = 6 DBPrefixLedgerState byte = 7 DBPrefixApprovers byte = 8 DBPrefixTags byte = 9 DBPrefixSnapshot byte = 10 DBPrefixFirstSeenTransactions byte = 11 DBPrefixSpentAddresses byte = 12 DBPrefixAutopeering byte = 13 )
const (
BUNDLE_TX_IS_TAIL = 1
)
const (
DbVersion = 5
)
const (
NodeSyncedThreshold = 2
)
const (
SNAPSHOT_METADATA_SPENTADDRESSES_ENABLED = 0
)
Variables ¶
var ( ErrSolidEntryPointsAlreadyInitialized = errors.New("solidEntryPoints already initialized") ErrSolidEntryPointsNotInitialized = errors.New("solidEntryPoints not initialized") )
var (
ErrInvalidMilestone = errors.New("invalid milestone")
)
var (
ErrOperationAborted = errors.New("operation was aborted")
)
var (
ErrParseSnapshotInfoFailed = errors.New("Parsing of snapshot info failed")
)
var Events = packageEvents{ ReceivedValidMilestone: events.NewEvent(BundleCaller), ReceivedInvalidMilestone: events.NewEvent(events.ErrorCaller), AddressSpent: events.NewEvent(events.StringCaller), }
Functions ¶
func ApplyLedgerDiffWithoutLocking ¶ added in v0.3.0
func ApplyLedgerDiffWithoutLocking(diff map[trinary.Hash]int64, index milestone_index.MilestoneIndex) error
ApplyLedgerDiffWithoutLocking applies the changes to the ledger. WriteLockLedger must be held while entering this function.
func BundleCaller ¶
func BundleCaller(handler interface{}, params ...interface{})
func CheckIfMilestone ¶
func ConfigureDatabases ¶
func ConfigureDatabases(directory string, badgerOpts *profile.BadgerOpts)
func ConfigureMilestones ¶
func ContainsBundleTransaction ¶
func ContainsBundleTransaction(bundleHash trinary.Hash, transactionHash trinary.Hash, isTail bool) bool
bundleTx +-0
func ContainsMilestone ¶
func ContainsMilestone(milestoneIndex milestone_index.MilestoneIndex) bool
milestone +-0
func DeleteBundleTransaction ¶
bundleTx +-0
func DeleteFirstSeenTxs ¶
func DeleteFirstSeenTxs(msIndex milestone_index.MilestoneIndex)
firstSeenTx +-0
func DeleteLedgerBalancesInDatabase ¶
func DeleteLedgerBalancesInDatabase() error
func DeleteLedgerDiffForMilestone ¶
func DeleteLedgerDiffForMilestone(index milestone_index.MilestoneIndex) error
func FixFirstSeenTxs ¶
func FixFirstSeenTxs(msIndex milestone_index.MilestoneIndex)
func GetAddressesStorageSize ¶
func GetAddressesStorageSize() int
func GetAllLedgerBalances ¶
func GetAllLedgerBalances(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
GetAllLedgerBalances returns all balances for the current solid milestone.
func GetAllLedgerBalancesWithoutLocking ¶
func GetAllLedgerBalancesWithoutLocking(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
GetAllLedgerBalancesWithoutLocking returns all balances for the current solid milestone. ReadLockLedger must be held while entering this function.
func GetAllSnapshotBalances ¶
func GetAllSnapshotBalances(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
GetAllSnapshotBalances returns all balances for the snapshot milestone.
func GetAllSnapshotBalancesWithoutLocking ¶
func GetAllSnapshotBalancesWithoutLocking(abortSignal <-chan struct{}) (map[trinary.Hash]uint64, milestone_index.MilestoneIndex, error)
GetAllSnapshotBalancesWithoutLocking returns all balances for the snapshot milestone. ReadLockLedger must be held while entering this function.
func GetApproverHashes ¶
func GetApproverHashes(transactionHash trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
approvers +-0
func GetApproversStorageSize ¶
func GetApproversStorageSize() int
func GetBalanceForAddress ¶
func GetBalanceForAddress(address trinary.Hash) (uint64, milestone_index.MilestoneIndex, error)
func GetBalanceForAddressWithoutLocking ¶
func GetBalanceForAddressWithoutLocking(address trinary.Hash) (uint64, milestone_index.MilestoneIndex, error)
func GetBundleStorageSize ¶
func GetBundleStorageSize() int
func GetBundleTailTransactionHashes ¶
func GetBundleTailTransactionHashes(bundleHash trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
bundleTx +1
func GetBundleTransactionHashes ¶
func GetBundleTransactionHashes(bundleHash trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
bundleTx +-0
func GetBundleTransactionsStorageSize ¶
func GetBundleTransactionsStorageSize() int
func GetFirstSeenTxHashes ¶
func GetFirstSeenTxHashes(msIndex milestone_index.MilestoneIndex, forceRelease bool, maxFind ...int) []trinary.Hash
firstSeenTx +-0
func GetFirstSeenTxStorageSize ¶
func GetFirstSeenTxStorageSize() int
func GetLatestMilestoneIndex ¶
func GetLatestMilestoneIndex() milestone_index.MilestoneIndex
func GetLatestSeenMilestoneIndexFromSnapshot ¶
func GetLatestSeenMilestoneIndexFromSnapshot() milestone_index.MilestoneIndex
func GetLedgerDiffForMilestone ¶
func GetLedgerDiffForMilestone(index milestone_index.MilestoneIndex, abortSignal <-chan struct{}) (map[trinary.Hash]int64, error)
func GetLedgerDiffForMilestoneWithoutLocking ¶ added in v0.3.0
func GetLedgerDiffForMilestoneWithoutLocking(index milestone_index.MilestoneIndex, abortSignal <-chan struct{}) (map[trinary.Hash]int64, error)
GetLedgerDiffForMilestoneWithoutLocking returns the ledger changes of that specific milestone. ReadLockLedger must be held while entering this function.
func GetMilestoneStorageSize ¶
func GetMilestoneStorageSize() int
func GetSolidMilestoneIndex ¶
func GetSolidMilestoneIndex() milestone_index.MilestoneIndex
func GetSpentAddressesStorageSize ¶
func GetSpentAddressesStorageSize() int
func GetTagHashes ¶
tag +-0
func GetTagsStorageSize ¶
func GetTagsStorageSize() int
func GetTransactionHashesForAddress ¶
func GetTransactionHashesForAddress(address trinary.Hash, forceRelease bool, maxFind ...int) []trinary.Hash
address +-0
func GetTransactionStorageSize ¶
func GetTransactionStorageSize() int
func IsCorrectDatabaseVersion ¶ added in v0.2.0
func IsCorrectDatabaseVersion() bool
func IsDatabaseCorrupted ¶
func IsDatabaseCorrupted() bool
func IsMaybeMilestone ¶
func IsMaybeMilestone(cachedTx *CachedTransaction) bool
Checks if the the tx could be part of a milestone
func IsMaybeMilestoneTx ¶
func IsMaybeMilestoneTx(cachedTx *CachedTransaction) bool
Checks if the the tx could be part of a milestone
func IsNodeSynced ¶
func IsNodeSynced() bool
func IsNodeSyncedWithThreshold ¶
func IsNodeSyncedWithThreshold() bool
func LoadInitialValuesFromDatabase ¶
func LoadInitialValuesFromDatabase()
func MarkAddressAsSpentBinaryWithoutLocking ¶
spentAddress +-0
func MarkDatabaseCorrupted ¶
func MarkDatabaseCorrupted()
func MarkDatabaseHealthy ¶
func MarkDatabaseHealthy()
func NewTransactionCaller ¶
func NewTransactionCaller(handler interface{}, params ...interface{})
func OnTailTransactionSolid ¶
func OnTailTransactionSolid(cachedTx *CachedTransaction)
Create a new bundle instance as soon as a tailTx gets solid
func ReadLockLedger ¶
func ReadLockLedger()
func ReadLockSolidEntryPoints ¶ added in v0.3.0
func ReadLockSolidEntryPoints()
func ReadLockSpentAddresses ¶ added in v0.3.0
func ReadLockSpentAddresses()
func ReadUnlockLedger ¶
func ReadUnlockLedger()
func ReadUnlockSolidEntryPoints ¶ added in v0.3.0
func ReadUnlockSolidEntryPoints()
func ReadUnlockSpentAddresses ¶ added in v0.3.0
func ReadUnlockSpentAddresses()
func RemoveTransactionFromBundle ¶
func RemoveTransactionFromBundle(tx *transaction.Transaction) map[trinary.Hash]struct{}
RemoveTransactionFromBundle removes the transaction if non-tail and not associated to a bundle instance or if tail, it removes all the transactions of the bundle from the storage that are not used in another bundle instance.
func ResetSolidEntryPoints ¶
func ResetSolidEntryPoints()
WriteLockSolidEntryPoints must be held while entering this function
func SearchLatestMilestoneIndex ¶
func SearchLatestMilestoneIndex() milestone_index.MilestoneIndex
milestone +-0
func SetLatestMilestone ¶
func SetLatestMilestone(cachedBndl *CachedBundle) error
func SetLatestSeenMilestoneIndexFromSnapshot ¶
func SetLatestSeenMilestoneIndexFromSnapshot(milestoneIndex milestone_index.MilestoneIndex)
func SetSnapshotInfo ¶ added in v0.3.0
func SetSnapshotInfo(sn *SnapshotInfo)
func SetSnapshotMilestone ¶
func SetSnapshotMilestone(milestoneHash trinary.Hash, snapshotIndex milestone_index.MilestoneIndex, pruningIndex milestone_index.MilestoneIndex, timestamp int64, spentAddressesEnabled bool)
func SetSolidMilestone ¶
func SetSolidMilestone(cachedBndl *CachedBundle)
func SetSolidMilestoneIndex ¶
func SetSolidMilestoneIndex(index milestone_index.MilestoneIndex)
SetSolidMilestoneIndex sets the solid milestone index at node startup Do not use this function during normal node operation
func ShutdownAddressStorage ¶
func ShutdownAddressStorage()
func ShutdownApproversStorage ¶
func ShutdownApproversStorage()
func ShutdownBundleStorage ¶
func ShutdownBundleStorage()
func ShutdownBundleTransactionsStorage ¶
func ShutdownBundleTransactionsStorage()
func ShutdownFirstSeenTxsStorage ¶
func ShutdownFirstSeenTxsStorage()
func ShutdownMilestoneStorage ¶
func ShutdownMilestoneStorage()
func ShutdownSpentAddressesStorage ¶
func ShutdownSpentAddressesStorage()
func ShutdownTagsStorage ¶
func ShutdownTagsStorage()
func ShutdownTransactionStorage ¶
func ShutdownTransactionStorage()
func SolidEntryPointsAdd ¶
func SolidEntryPointsAdd(transactionHash trinary.Hash, milestoneIndex milestone_index.MilestoneIndex)
WriteLockSolidEntryPoints must be held while entering this function
func SolidEntryPointsContain ¶
func StoreLedgerBalancesInDatabase ¶
func StoreLedgerBalancesInDatabase(balances map[trinary.Hash]uint64, index milestone_index.MilestoneIndex) error
func StoreSnapshotBalancesInDatabase ¶
func StoreSnapshotBalancesInDatabase(balances map[trinary.Hash]uint64, index milestone_index.MilestoneIndex) error
StoreSnapshotBalancesInDatabase deletes all old entries and stores the ledger state of the snapshot index
func StoreSolidEntryPoints ¶
func StoreSolidEntryPoints()
WriteLockSolidEntryPoints must be held while entering this function
func StreamSpentAddressesToWriter ¶ added in v0.2.6
StreamSpentAddressesToWriter streams all spent addresses directly to an io.Writer.
func TransactionCaller ¶
func TransactionCaller(handler interface{}, params ...interface{})
func TransactionConfirmedCaller ¶
func TransactionConfirmedCaller(handler interface{}, params ...interface{})
func TryConstructBundle ¶
func TryConstructBundle(cachedTx *CachedTransaction, isSolidTail bool)
TryConstructBundle tries to construct a bundle (maybe txs are still missing in the DB) isSolidTail should only be false for possible milestone txs
func WriteLockLedger ¶
func WriteLockLedger()
func WriteLockSolidEntryPoints ¶ added in v0.3.0
func WriteLockSolidEntryPoints()
func WriteLockSpentAddresses ¶ added in v0.3.0
func WriteLockSpentAddresses()
func WriteUnlockLedger ¶
func WriteUnlockLedger()
func WriteUnlockSolidEntryPoints ¶ added in v0.3.0
func WriteUnlockSolidEntryPoints()
func WriteUnlockSpentAddresses ¶ added in v0.3.0
func WriteUnlockSpentAddresses()
Types ¶
type Bundle ¶
type Bundle struct { objectstorage.StorableObjectFlags syncutils.RWMutex // contains filtered or unexported fields }
Storable Object
func GetLatestMilestone ¶
func GetLatestMilestone() *Bundle
func (*Bundle) ApplySpentAddresses ¶
func (bundle *Bundle) ApplySpentAddresses()
func (*Bundle) GetHead ¶
func (bundle *Bundle) GetHead() *CachedTransaction
func (*Bundle) GetMetadata ¶
func (*Bundle) GetMilestoneHash ¶
func (*Bundle) GetMilestoneIndex ¶
func (bundle *Bundle) GetMilestoneIndex() milestone_index.MilestoneIndex
func (*Bundle) GetStorageKey ¶
func (*Bundle) GetTail ¶
func (bundle *Bundle) GetTail() *CachedTransaction
func (*Bundle) GetTailHash ¶
func (*Bundle) GetTransactionHashes ¶
func (*Bundle) GetTransactions ¶
func (bundle *Bundle) GetTransactions() CachedTransactions
func (*Bundle) IsConfirmed ¶
func (*Bundle) IsMilestone ¶
func (*Bundle) IsValueSpam ¶
func (*Bundle) MarshalBinary ¶
func (*Bundle) ResetSolidAndConfirmed ¶
func (bundle *Bundle) ResetSolidAndConfirmed()
func (*Bundle) UnmarshalBinary ¶
func (*Bundle) Update ¶
func (bundle *Bundle) Update(other objectstorage.StorableObject)
ObjectStorage interface
func (*Bundle) ValidStrictSemantics ¶
type BundleTransaction ¶
type BundleTransaction struct { objectstorage.StorableObjectFlags // Key BundleHash []byte IsTail bool TxHash []byte }
Storable Object
func (*BundleTransaction) GetBundleHash ¶
func (bt *BundleTransaction) GetBundleHash() trinary.Hash
func (*BundleTransaction) GetStorageKey ¶
func (bt *BundleTransaction) GetStorageKey() []byte
func (*BundleTransaction) GetTransactionHash ¶
func (bt *BundleTransaction) GetTransactionHash() trinary.Hash
func (*BundleTransaction) MarshalBinary ¶
func (bt *BundleTransaction) MarshalBinary() (data []byte, err error)
func (*BundleTransaction) UnmarshalBinary ¶
func (bt *BundleTransaction) UnmarshalBinary(data []byte) error
func (*BundleTransaction) Update ¶
func (bt *BundleTransaction) Update(other objectstorage.StorableObject)
ObjectStorage interface
type CachedAddress ¶
type CachedAddress struct {
objectstorage.CachedObject
}
func StoreAddress ¶
func StoreAddress(address trinary.Hash, txHash trinary.Hash) *CachedAddress
address +1
func (*CachedAddress) GetAddress ¶
func (c *CachedAddress) GetAddress() *hornet.Address
type CachedAddresses ¶
type CachedAddresses []*CachedAddress
func (CachedAddresses) Release ¶
func (cachedAddresses CachedAddresses) Release(force ...bool)
type CachedAppprovers ¶
type CachedAppprovers []*CachedApprover
func (CachedAppprovers) Release ¶
func (cachedApprovers CachedAppprovers) Release(force ...bool)
type CachedApprover ¶
type CachedApprover struct {
objectstorage.CachedObject
}
func StoreApprover ¶
func StoreApprover(transactionHash trinary.Hash, approverHash trinary.Hash) *CachedApprover
approvers +1
func (*CachedApprover) GetApprover ¶
func (c *CachedApprover) GetApprover() *hornet.Approver
type CachedBundle ¶
type CachedBundle struct {
objectstorage.CachedObject
}
Cached Object
func FindClosestNextMilestoneOrNil ¶
func FindClosestNextMilestoneOrNil(index milestone_index.MilestoneIndex) *CachedBundle
bundle +1
func GetCachedBundleOrNil ¶
func GetCachedBundleOrNil(tailTxHash trinary.Hash) *CachedBundle
bundle +1
func GetMilestoneOrNil ¶
func GetMilestoneOrNil(milestoneIndex milestone_index.MilestoneIndex) *CachedBundle
bundle +1
func (*CachedBundle) ConsumeBundle ¶
func (c *CachedBundle) ConsumeBundle(consumer func(*Bundle))
func (*CachedBundle) GetBundle ¶
func (c *CachedBundle) GetBundle() *Bundle
func (*CachedBundle) Retain ¶
func (c *CachedBundle) Retain() *CachedBundle
type CachedBundleTransaction ¶
type CachedBundleTransaction struct {
objectstorage.CachedObject
}
Cached Object
func GetCachedBundleTransactionOrNil ¶
func GetCachedBundleTransactionOrNil(bundleHash trinary.Hash, transactionHash trinary.Hash, isTail bool) *CachedBundleTransaction
bundleTx +1
func StoreBundleTransaction ¶
func StoreBundleTransaction(bundleHash trinary.Hash, transactionHash trinary.Hash, isTail bool) *CachedBundleTransaction
bundleTx +1
func (*CachedBundleTransaction) GetBundleTransaction ¶
func (c *CachedBundleTransaction) GetBundleTransaction() *BundleTransaction
type CachedBundleTransactions ¶
type CachedBundleTransactions []*CachedBundleTransaction
func (CachedBundleTransactions) Release ¶
func (cachedBundleTransactions CachedBundleTransactions) Release(force ...bool)
func (CachedBundleTransactions) Retain ¶
func (cachedBundleTransactions CachedBundleTransactions) Retain() CachedBundleTransactions
type CachedBundles ¶
type CachedBundles []*CachedBundle
func GetBundles ¶
func GetBundles(bundleHash trinary.Hash, forceRelease bool) CachedBundles
GetBundles returns all existing bundle instances for that bundle hash bundle +1
func GetBundlesOfTransactionOrNil ¶
func GetBundlesOfTransactionOrNil(txHash trinary.Hash, forceRelease bool) CachedBundles
GetBundlesOfTransactionOrNil gets all bundle instances in which this transaction is present. A transaction can be in multiple bundle instances simultaneously due to the nature of reattached transactions being able to form infinite amount of bundles which attach to the same underlying bundle transaction. For example it is possible to reattach a bundle's tail transaction directly "on top" of the origin one. bundle +1
func (CachedBundles) Release ¶
func (cachedBundles CachedBundles) Release(force ...bool)
func (CachedBundles) Retain ¶
func (cachedBundles CachedBundles) Retain() CachedBundles
type CachedFirstSeenTx ¶
type CachedFirstSeenTx struct {
objectstorage.CachedObject
}
func StoreFirstSeenTx ¶
func StoreFirstSeenTx(msIndex milestone_index.MilestoneIndex, txHash trinary.Hash) *CachedFirstSeenTx
firstSeenTx +1
func (*CachedFirstSeenTx) GetFirstSeenTx ¶
func (c *CachedFirstSeenTx) GetFirstSeenTx() *hornet.FirstSeenTx
type CachedFirstSeenTxs ¶
type CachedFirstSeenTxs []*CachedFirstSeenTx
func (CachedFirstSeenTxs) Release ¶
func (cachedFirstSeenTxs CachedFirstSeenTxs) Release(force ...bool)
type CachedMilestone ¶
type CachedMilestone struct {
objectstorage.CachedObject
}
Cached Object
func GetCachedMilestoneOrNil ¶
func GetCachedMilestoneOrNil(milestoneIndex milestone_index.MilestoneIndex) *CachedMilestone
milestone +1
func (*CachedMilestone) GetMilestone ¶
func (c *CachedMilestone) GetMilestone() *Milestone
type CachedSpentAddress ¶
type CachedSpentAddress struct {
objectstorage.CachedObject
}
func (*CachedSpentAddress) GetSpentAddress ¶
func (c *CachedSpentAddress) GetSpentAddress() *hornet.SpentAddress
type CachedTag ¶
type CachedTag struct {
objectstorage.CachedObject
}
type CachedTags ¶
type CachedTags []*CachedTag
type CachedTransaction ¶
type CachedTransaction struct {
// contains filtered or unexported fields
}
func AddTransactionToStorage ¶
func AddTransactionToStorage(hornetTx *hornet.Transaction, firstSeenLatestMilestoneIndex milestone_index.MilestoneIndex, requested bool, forceRelease bool, reapply bool) (cachedTx *CachedTransaction, alreadyAdded bool)
tx +1
func GetCachedTransactionOrNil ¶
func GetCachedTransactionOrNil(transactionHash trinary.Hash) *CachedTransaction
tx +1
func StoreTransactionIfAbsent ¶
func StoreTransactionIfAbsent(transaction *hornet.Transaction) (cachedTx *CachedTransaction, newlyAdded bool)
tx +1
func (*CachedTransaction) ConsumeTransaction ¶
func (c *CachedTransaction) ConsumeTransaction(consumer func(*hornet.Transaction, *hornet.TransactionMetadata))
tx -1
func (*CachedTransaction) Exists ¶
func (c *CachedTransaction) Exists() bool
func (*CachedTransaction) GetMetadata ¶
func (c *CachedTransaction) GetMetadata() *hornet.TransactionMetadata
func (*CachedTransaction) GetTransaction ¶
func (c *CachedTransaction) GetTransaction() *hornet.Transaction
type CachedTransactions ¶
type CachedTransactions []*CachedTransaction
func (CachedTransactions) Release ¶
func (cachedTxs CachedTransactions) Release(force ...bool)
tx -1
func (CachedTransactions) Retain ¶
func (cachedTxs CachedTransactions) Retain() CachedTransactions
tx +1
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 Milestone ¶
type Milestone struct { objectstorage.StorableObjectFlags Index milestone_index.MilestoneIndex Hash trinary.Hash }
Storable Object
func (*Milestone) GetStorageKey ¶
func (*Milestone) MarshalBinary ¶
func (*Milestone) UnmarshalBinary ¶
func (*Milestone) Update ¶
func (ms *Milestone) Update(other objectstorage.StorableObject)
type SnapshotInfo ¶
type SnapshotInfo struct { Hash trinary.Hash SnapshotIndex milestone_index.MilestoneIndex PruningIndex milestone_index.MilestoneIndex RevalidationIndex milestone_index.MilestoneIndex Timestamp int64 Metadata bitmask.BitMask }
func GetSnapshotInfo ¶
func GetSnapshotInfo() *SnapshotInfo
func SnapshotInfoFromBytes ¶
func SnapshotInfoFromBytes(bytes []byte) (*SnapshotInfo, error)
func (*SnapshotInfo) GetBytes ¶
func (i *SnapshotInfo) GetBytes() []byte
func (*SnapshotInfo) IsSpentAddressesEnabled ¶
func (i *SnapshotInfo) IsSpentAddressesEnabled() bool
func (*SnapshotInfo) SetSpentAddressesEnabled ¶
func (i *SnapshotInfo) SetSpentAddressesEnabled(enabled bool)
Source Files
¶
- address_storage.go
- approvers_storage.go
- bundle.go
- bundle_milestone.go
- bundle_storage.go
- bundle_transaction_storage.go
- database_prefixes.go
- errors.go
- events.go
- first_seen_tx_storage.go
- health_db.go
- ledger_db.go
- milestones.go
- milestones_storage.go
- misc.go
- snapshot.go
- snapshot_db.go
- solid_entry_points.go
- spent_addresses_storage.go
- tags_storage.go
- tangle.go
- transaction_storage.go