Versions in this module Expand all Collapse all v0 v0.5.10 Aug 9, 2023 v0.5.9 Aug 4, 2023 Changes in this version + const BundleTxIsTail + const DbVersion + const MetadataConfirmed + const MetadataConflicting + const MetadataInvalidPastCone + const MetadataIsMilestone + const MetadataIsValueSpam + const MetadataSolid + const MetadataValid + const MetadataValidStrictSemantics + const SnapshotDbFilename + const SnapshotMetadataSpentAddressesEnabled + const SpentAddressesDbFilename + const StorePrefixAddresses + const StorePrefixApprovers + const StorePrefixAutopeering + const StorePrefixBundleTransactions + const StorePrefixBundles + const StorePrefixHealth + const StorePrefixLedgerBalance + const StorePrefixLedgerDiff + const StorePrefixLedgerState + const StorePrefixMilestones + const StorePrefixSnapshot + const StorePrefixSnapshotLedger + const StorePrefixSpentAddresses + const StorePrefixTags + const StorePrefixTransactionMetadata + const StorePrefixTransactions + const StorePrefixUnconfirmedTransactions + const StorePrefixWhiteFlag + const TangleDbFilename + var ErrBundleNotFound = errors.New("bundle not found") + var ErrInvalidAuditPathLength = errors.New("invalid audit path length") + var ErrInvalidMilestone = errors.New("invalid milestone") + var ErrNodeLoadTooHigh = errors.New("node load is too high") + var ErrNodeNotSynced = errors.New("node is not synchronized") + var ErrNothingToCleanUp = errors.New("Nothing to clean up in the databases") + var ErrOperationAborted = errors.New("operation was aborted") + var ErrParseSnapshotInfoFailed = errors.New("Parsing of snapshot info failed") + var ErrSolidEntryPointsAlreadyInitialized = errors.New("solidEntryPoints already initialized") + var ErrSolidEntryPointsNotInitialized = errors.New("solidEntryPoints not initialized") + var ErrTransactionNotFound = errors.New("transaction not found") + var ErrWFConfirmationAlreadyStored = errors.New("wf-confirmation already stored") + var ErrWFMustContainMutations = errors.New("wf-confirmation must contain mutations struct") + var Events = packageEvents + func ApplyLedgerDiffWithoutLocking(diff map[string]int64, index milestone.Index) error + func BundleCaller(handler interface{}, params ...interface{}) + func CheckIfMilestone(bndl *Bundle) (result bool, err error) + func CleanupDatabases() error + func CloseDatabases() error + func ConfigureDatabases(directory string) + func ConfigureMilestones(cooAddr hornet.Hash, cooSecLvl int, cooMerkleTreeDepth uint64, ...) + func ConfigureStorages(tangleStore kvstore.KVStore, snapshotStore kvstore.KVStore, ...) + func ContainsAddress(address hornet.Hash, txHash hornet.Hash, valueOnly bool) bool + func ContainsApprover(txHash hornet.Hash, approverHash hornet.Hash) bool + func ContainsBundle(tailTxHash hornet.Hash) bool + func ContainsBundleTransaction(bundleHash hornet.Hash, txHash hornet.Hash, isTail bool) bool + func ContainsMilestone(milestoneIndex milestone.Index) bool + func ContainsTag(txTag hornet.Hash, txHash hornet.Hash) bool + func ContainsTransaction(txHash hornet.Hash) bool + func DatabaseSupportsCleanup() bool + func DeleteAddress(address hornet.Hash, txHash hornet.Hash) + func DeleteApprover(txHash hornet.Hash, approverHash hornet.Hash) + func DeleteApprovers(txHash hornet.Hash) + func DeleteBundle(tailTxHash hornet.Hash) + func DeleteBundleTransaction(bundleHash hornet.Hash, txHash hornet.Hash, isTail bool) + func DeleteLedgerDiffForMilestone(index milestone.Index) error + func DeleteMilestone(milestoneIndex milestone.Index) + func DeleteTag(txTag hornet.Hash, txHash hornet.Hash) + func DeleteTransaction(txHash hornet.Hash) + func DeleteTransactionMetadata(txHash hornet.Hash) + func DeleteUnconfirmedTxs(msIndex milestone.Index) int + func FlushAddressStorage() + func FlushApproversStorage() + func FlushBundleStorage() + func FlushBundleTransactionsStorage() + func FlushMilestoneStorage() + func FlushSpentAddressesStorage() + func FlushStorages() + func FlushTagsStorage() + func FlushTransactionStorage() + func FlushUnconfirmedTxsStorage() + func ForEachAddress(consumer AddressConsumer, skipCache bool) + func ForEachApprover(consumer ApproverConsumer, skipCache bool) + func ForEachBundle(bundleHash hornet.Hash, consumer func(*Bundle) bool, maxFind ...int) + func ForEachBundleHash(consumer BundleHashConsumer, skipCache bool) + func ForEachBundleTailTransactionHash(bundleHash hornet.Hash, consumer func(txTailHash hornet.Hash) bool, ...) + func ForEachBundleTransaction(consumer BundleTransactionConsumer, skipCache bool) + func ForEachLedgerDiffHash(consumer LedgerDiffHashConsumer, skipCache bool) + func ForEachMilestoneIndex(consumer MilestoneIndexConsumer, skipCache bool) + func ForEachTag(consumer TagConsumer, skipCache bool) + func ForEachTransactionHash(consumer TransactionHashConsumer, skipCache bool) + func ForEachTransactionMetadataHash(consumer TransactionHashConsumer, skipCache bool) + func ForEachUnconfirmedTx(consumer UnconfirmedTxConsumer, skipCache bool) + func GetAddressesStorageSize() int + func GetAllBundleTransactionHashes(maxFind ...int) hornet.Hashes + func GetAllSnapshotBalances(abortSignal <-chan struct{}) (map[string]uint64, milestone.Index, error) + func GetApproverHashes(txHash hornet.Hash, maxFind ...int) hornet.Hashes + func GetApproversStorageSize() int + func GetBalanceForAddress(address hornet.Hash) (uint64, milestone.Index, error) + func GetBalanceForAddressWithoutLocking(address hornet.Hash) (uint64, milestone.Index, error) + func GetBundleStorageSize() int + func GetBundleTailTransactionHashes(bundleHash hornet.Hash, forceRelease bool, maxFind ...int) hornet.Hashes + func GetBundleTransactionHashes(bundleHash hornet.Hash, forceRelease bool, maxFind ...int) hornet.Hashes + func GetBundleTransactionsStorageSize() int + func GetDatabaseSizes() (tangle int64, snapshot int64, spent int64) + func GetLatestMilestoneIndex() milestone.Index + func GetLatestSeenMilestoneIndexFromSnapshot() milestone.Index + func GetLedgerDiffForMilestone(ctx context.Context, index milestone.Index) (map[string]int64, error) + func GetLedgerDiffForMilestoneWithoutLocking(ctx context.Context, index milestone.Index) (map[string]int64, error) + func GetLedgerStateForLSMI(ctx context.Context) (map[string]uint64, milestone.Index, error) + func GetLedgerStateForLSMIWithoutLocking(ctx context.Context) (map[string]uint64, milestone.Index, error) + func GetLedgerStateForMilestone(ctx context.Context, targetIndex milestone.Index) (map[string]uint64, milestone.Index, error) + func GetLedgerStateForMilestoneWithoutLocking(ctx context.Context, targetIndex milestone.Index) (map[string]uint64, milestone.Index, error) + func GetMilestoneMerkleHashFunc() crypto.Hash + func GetMilestoneStorageSize() int + func GetMilestoneTimestamp(milestoneIndex milestone.Index) (uint64, error) + func GetSolidMilestoneIndex() milestone.Index + func GetSpentAddressesStorageSize() int + func GetStoredMetadataOrNil(txHash hornet.Hash) *hornet.TransactionMetadata + func GetTagHashes(txTag hornet.Hash, forceRelease bool, maxFind ...int) hornet.Hashes + func GetTagsStorageSize() int + func GetTransactionHashesForAddress(address hornet.Hash, valueOnly bool, forceRelease bool, maxFind ...int) hornet.Hashes + func GetTransactionStorageSize() int + func GetUnconfirmedTxHashes(msIndex milestone.Index, forceRelease bool) hornet.Hashes + func GetUnconfirmedTxStorageSize() int + func IsCorrectDatabaseVersion() bool + func IsDatabaseCorrupted() bool + func IsDatabaseTainted() bool + func IsMaybeMilestone(cachedTx *CachedTransaction) bool + func IsMaybeMilestoneTx(cachedTx *CachedTransaction) bool + func IsNodeSynced() bool + func IsNodeSyncedWithThreshold() bool + func LoadInitialValuesFromDatabase() + func MarkAddressAsSpent(address hornet.Hash) bool + func MarkAddressAsSpentWithoutLocking(address hornet.Hash) bool + func MarkDatabaseCorrupted() + func MarkDatabaseHealthy() + func MarkDatabaseTainted() + func NewTransactionCaller(handler interface{}, params ...interface{}) + func OnTailTransactionSolid(cachedTx *CachedTransaction) + func OverwriteSolidMilestoneIndex(index milestone.Index) + func ReadLockLedger() + func ReadLockSolidEntryPoints() + func ReadLockSpentAddresses() + func ReadUnlockLedger() + func ReadUnlockSolidEntryPoints() + func ReadUnlockSpentAddresses() + func RemoveTransactionFromBundle(txMeta *hornet.TransactionMetadata) map[string]struct + func ResetMilestoneIndexes() + func ResetSolidEntryPoints() + func SearchLatestMilestoneIndexInStore() milestone.Index + func SetLatestMilestoneIndex(index milestone.Index, updateSynced ...bool) bool + func SetLatestSeenMilestoneIndexFromSnapshot(milestoneIndex milestone.Index) + func SetSnapshotInfo(sn *SnapshotInfo) + func SetSnapshotMilestone(coordinatorAddress hornet.Hash, milestoneHash hornet.Hash, ...) + func SetSolidMilestoneIndex(index milestone.Index, updateSynced ...bool) + func ShutdownAddressStorage() + func ShutdownApproversStorage() + func ShutdownBundleStorage() + func ShutdownBundleTransactionsStorage() + func ShutdownMilestoneStorage() + func ShutdownSpentAddressesStorage() + func ShutdownStorages() + func ShutdownTagsStorage() + func ShutdownTransactionStorage() + func ShutdownUnconfirmedTxsStorage() + func SolidEntryPointsAdd(txHash hornet.Hash, milestoneIndex milestone.Index) + func SolidEntryPointsContain(txHash hornet.Hash) bool + func SolidEntryPointsIndex(txHash hornet.Hash) (milestone.Index, bool) + func StoreLedgerBalancesInDatabase(balances map[string]uint64, index milestone.Index) error + func StoreSnapshotBalancesInDatabase(balances map[string]uint64, index milestone.Index) error + func StoreSolidEntryPoints() + func StoreWhiteFlagConfirmation(conf *WhiteFlagConfirmation) error + func StreamSpentAddressesToWriter(ctx context.Context, buf io.Writer) (int32, error) + func TransactionCaller(handler interface{}, params ...interface{}) + func TransactionConfirmedCaller(handler interface{}, params ...interface{}) + func TransactionExistsInStore(txHash hornet.Hash) bool + func TransactionHashCaller(handler interface{}, params ...interface{}) + func UpdateDatabaseVersion() bool + func WaitForNodeSynced(timeout time.Duration) bool + func WasAddressSpentFrom(address hornet.Hash) bool + func WriteLockLedger() + func WriteLockSolidEntryPoints() + func WriteLockSpentAddresses() + func WriteUnlockLedger() + func WriteUnlockSolidEntryPoints() + func WriteUnlockSpentAddresses() + type AddressConsumer func(address hornet.Hash, txHash hornet.Hash, isValue bool) bool + type ApproverConsumer func(txHash hornet.Hash, approverHash hornet.Hash) bool + type Bundle struct + func GetStoredBundleOrNil(tailTxHash hornet.Hash) *Bundle + func (bundle *Bundle) ApplySpentAddresses() + func (bundle *Bundle) GetBranchHash(forceRelease bool) hornet.Hash + func (bundle *Bundle) GetBundleHash() hornet.Hash + func (bundle *Bundle) GetHead() *CachedTransaction + func (bundle *Bundle) GetHeadMetadata() *CachedMetadata + func (bundle *Bundle) GetLedgerChanges() map[string]int64 + func (bundle *Bundle) GetMetadata() byte + func (bundle *Bundle) GetMilestoneHash() hornet.Hash + func (bundle *Bundle) GetMilestoneIndex() milestone.Index + func (bundle *Bundle) GetMilestoneMerkleTreeHash() ([]byte, error) + func (bundle *Bundle) GetTail() *CachedTransaction + func (bundle *Bundle) GetTailHash() hornet.Hash + func (bundle *Bundle) GetTailMetadata() *CachedMetadata + func (bundle *Bundle) GetTransactions() CachedTransactions + func (bundle *Bundle) GetTrunkHash(forceRelease bool) hornet.Hash + func (bundle *Bundle) GetTxHashes() hornet.Hashes + func (bundle *Bundle) IsConfirmed() bool + func (bundle *Bundle) IsConflicting() bool + func (bundle *Bundle) IsInvalidPastCone() bool + func (bundle *Bundle) IsMilestone() bool + func (bundle *Bundle) IsSolid() bool + func (bundle *Bundle) IsValid() bool + func (bundle *Bundle) IsValueSpam() bool + func (bundle *Bundle) ObjectStorageKey() []byte + func (bundle *Bundle) ObjectStorageValue() (data []byte) + func (bundle *Bundle) SetInvalidPastCone(invalidPastCone bool) + func (bundle *Bundle) UnmarshalObjectStorageValue(data []byte) (err error) + func (bundle *Bundle) Update(_ objectstorage.StorableObject) + func (bundle *Bundle) ValidStrictSemantics() bool + type BundleHashConsumer func(txHash hornet.Hash) bool + type BundleTransaction struct + BundleHash hornet.Hash + IsTail bool + TxHash hornet.Hash + func (bt *BundleTransaction) GetBundleHash() hornet.Hash + func (bt *BundleTransaction) GetTxHash() hornet.Hash + func (bt *BundleTransaction) ObjectStorageKey() []byte + func (bt *BundleTransaction) ObjectStorageValue() (_ []byte) + func (bt *BundleTransaction) Update(_ objectstorage.StorableObject) + type BundleTransactionConsumer func(bundleHash hornet.Hash, txHash hornet.Hash, isTail bool) bool + type CachedAddress struct + func StoreAddress(address hornet.Hash, txHash hornet.Hash, isValue bool) *CachedAddress + func (c *CachedAddress) GetAddress() *hornet.Address + type CachedAddresses []*CachedAddress + func (cachedAddresses CachedAddresses) Release(force ...bool) + type CachedAppprovers []*CachedApprover + func (cachedApprovers CachedAppprovers) Release(force ...bool) + type CachedApprover struct + func StoreApprover(txHash hornet.Hash, approverHash hornet.Hash) *CachedApprover + func (c *CachedApprover) GetApprover() *hornet.Approver + type CachedBundle struct + func FindClosestNextMilestoneOrNil(index milestone.Index) *CachedBundle + func GetCachedBundleOrNil(tailTxHash hornet.Hash) *CachedBundle + func GetMilestoneOrNil(milestoneIndex milestone.Index) *CachedBundle + func (c *CachedBundle) ConsumeBundle(consumer func(*Bundle)) + func (c *CachedBundle) GetBundle() *Bundle + func (c *CachedBundle) Retain() *CachedBundle + type CachedBundleTransaction struct + func GetCachedBundleTransactionOrNil(bundleHash hornet.Hash, txHash hornet.Hash, isTail bool) *CachedBundleTransaction + func StoreBundleTransaction(bundleHash hornet.Hash, txHash hornet.Hash, isTail bool) *CachedBundleTransaction + func (c *CachedBundleTransaction) GetBundleTransaction() *BundleTransaction + type CachedBundleTransactions []*CachedBundleTransaction + func (cachedBundleTransactions CachedBundleTransactions) Release(force ...bool) + func (cachedBundleTransactions CachedBundleTransactions) Retain() CachedBundleTransactions + type CachedBundles []*CachedBundle + func GetBundles(bundleHash hornet.Hash, forceRelease bool, maxFind ...int) CachedBundles + func GetBundlesOfTransactionOrNil(txHash hornet.Hash, forceRelease bool) CachedBundles + func (cachedBundles CachedBundles) Release(force ...bool) + func (cachedBundles CachedBundles) Retain() CachedBundles + type CachedMetadata struct + func GetCachedTxMetadataOrNil(txHash hornet.Hash) *CachedMetadata + func (c *CachedMetadata) ConsumeMetadata(consumer func(*hornet.TransactionMetadata)) + func (c *CachedMetadata) GetMetadata() *hornet.TransactionMetadata + func (c *CachedMetadata) Retain() *CachedMetadata + type CachedMilestone struct + func GetCachedMilestoneOrNil(milestoneIndex milestone.Index) *CachedMilestone + func StoreMilestoneIfAbsent(bndl *Bundle) (cachedMilestone *CachedMilestone, newlyAdded bool) + func (c *CachedMilestone) GetMilestone() *Milestone + type CachedSpentAddress struct + func (c *CachedSpentAddress) GetSpentAddress() *hornet.SpentAddress + type CachedTag struct + func StoreTag(txTag hornet.Hash, txHash hornet.Hash) *CachedTag + func (c *CachedTag) GetTag() *hornet.Tag + type CachedTags []*CachedTag + func (cachedTags CachedTags) Release(force ...bool) + type CachedTransaction struct + func AddTransactionToStorage(hornetTx *hornet.Transaction, latestMilestoneIndex milestone.Index, ...) (cachedTx *CachedTransaction, alreadyAdded bool) + func GetCachedTransactionOrNil(txHash hornet.Hash) *CachedTransaction + func StoreTransactionIfAbsent(transaction *hornet.Transaction) (cachedTx *CachedTransaction, newlyAdded bool) + func (c *CachedTransaction) ConsumeMetadata(consumer func(*hornet.TransactionMetadata)) + func (c *CachedTransaction) ConsumeTransaction(consumer func(*hornet.Transaction)) + func (c *CachedTransaction) ConsumeTransactionAndMetadata(consumer func(*hornet.Transaction, *hornet.TransactionMetadata)) + func (c *CachedTransaction) Exists() bool + func (c *CachedTransaction) GetCachedMetadata() *CachedMetadata + 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 []*CachedTransaction + func (cachedTxs CachedTransactions) Release(force ...bool) + func (cachedTxs CachedTransactions) Retain() CachedTransactions + type CachedUnconfirmedTx struct + func StoreUnconfirmedTx(msIndex milestone.Index, txHash hornet.Hash) *CachedUnconfirmedTx + func (c *CachedUnconfirmedTx) GetUnconfirmedTx() *hornet.UnconfirmedTx + type CachedUnconfirmedTxs []*CachedUnconfirmedTx + func (cachedUnconfirmedTxs CachedUnconfirmedTxs) Release(force ...bool) + type ErrDatabaseError struct + Inner error + func NewDatabaseError(cause error) *ErrDatabaseError + func (e ErrDatabaseError) Cause() error + func (e ErrDatabaseError) Error() string + type LedgerDiffHashConsumer func(msIndex milestone.Index, address hornet.Hash) bool + type Milestone struct + Hash hornet.Hash + Index milestone.Index + func (ms *Milestone) ObjectStorageKey() []byte + func (ms *Milestone) ObjectStorageValue() (data []byte) + func (ms *Milestone) Update(_ objectstorage.StorableObject) + type MilestoneIndexConsumer func(index milestone.Index) bool + type SnapshotInfo struct + CoordinatorAddress hornet.Hash + EntryPointIndex milestone.Index + Hash hornet.Hash + Metadata bitmask.BitMask + PruningIndex milestone.Index + SnapshotIndex milestone.Index + Timestamp int64 + func GetSnapshotInfo() *SnapshotInfo + func SnapshotInfoFromBytes(bytes []byte) (*SnapshotInfo, error) + func (i *SnapshotInfo) GetBytes() []byte + func (i *SnapshotInfo) IsSpentAddressesEnabled() bool + func (i *SnapshotInfo) SetSpentAddressesEnabled(enabled bool) + type TagConsumer func(txTag hornet.Hash, txHash hornet.Hash) bool + type TransactionHashConsumer func(txHash hornet.Hash) bool + type UnconfirmedTxConsumer func(msIndex milestone.Index, txHash hornet.Hash) bool + type WhiteFlagConfirmation struct + MilestoneHash hornet.Hash + MilestoneIndex milestone.Index + Mutations *WhiteFlagMutations + func GetWhiteFlagConfirmation(index milestone.Index) (*WhiteFlagConfirmation, error) + func (w *WhiteFlagConfirmation) MarshalBinary() (data []byte, err error) + func (w *WhiteFlagConfirmation) UnmarshalBinary(data []byte) error + type WhiteFlagMutations struct + AddressMutations map[string]int64 + MerkleTreeHash []byte + NewAddressState map[string]int64 + TailsExcludedConflicting hornet.Hashes + TailsExcludedZeroValue hornet.Hashes + TailsIncluded hornet.Hashes + TailsReferenced hornet.Hashes