Documentation ¶
Index ¶
- Constants
- Variables
- type Bundle
- func (bundle *Bundle) Head() *Transaction
- func (bundle *Bundle) IsMilestone() bool
- func (bundle *Bundle) IsValid() bool
- func (bundle *Bundle) IsValueSpam() bool
- func (bundle *Bundle) LedgerChanges() map[string]int64
- func (bundle *Bundle) MilestoneHash() hornet.Hash
- func (bundle *Bundle) MilestoneIndex() milestone.Index
- func (bundle *Bundle) Tail() *Transaction
- func (bundle *Bundle) TailHash() hornet.Hash
- func (bundle *Bundle) Transactions() []*Transaction
- func (bundle *Bundle) Unmarshal(data []byte) error
- type Bundles
- type Database
- func (db *Database) ApproverHashes(txHash hornet.Hash, maxFind ...int) hornet.Hashes
- func (db *Database) BalanceForAddress(address hornet.Hash) (uint64, milestone.Index, error)
- func (db *Database) BundleOrNil(tailTxHash hornet.Hash) *Bundle
- func (db *Database) BundleTransactionHashes(bundleHash hornet.Hash, maxFind ...int) hornet.Hashes
- func (db *Database) CloseDatabases() error
- func (db *Database) ContainsAddress(address hornet.Hash, txHash hornet.Hash, valueOnly bool) bool
- func (db *Database) ContainsApprover(txHash hornet.Hash, approverHash hornet.Hash) bool
- func (db *Database) ContainsTag(txTag hornet.Hash, txHash hornet.Hash) bool
- func (db *Database) LatestSolidMilestoneBundle() *Bundle
- func (db *Database) LatestSyncState() *SyncState
- func (db *Database) LedgerDiffForMilestone(ctx context.Context, targetIndex milestone.Index) (map[string]int64, error)
- func (db *Database) LedgerIndex() milestone.Index
- func (db *Database) LedgerStateForLSMI(ctx context.Context) (map[string]uint64, milestone.Index, error)
- func (db *Database) LedgerStateForMilestone(ctx context.Context, targetIndex milestone.Index) (map[string]uint64, milestone.Index, error)
- func (db *Database) MilestoneBundleOrNil(milestoneIndex milestone.Index) *Bundle
- func (db *Database) MilestoneOrNil(milestoneIndex milestone.Index) *Milestone
- func (db *Database) MilestoneTimestamp(milestoneIndex milestone.Index) (uint64, error)
- func (db *Database) SolidEntryPointsContain(txHash hornet.Hash) bool
- func (db *Database) SolidMilestoneIndex() milestone.Index
- func (db *Database) TagHashes(txTag hornet.Hash, maxFind ...int) hornet.Hashes
- func (db *Database) TransactionHashesForAddress(address hornet.Hash, valueOnly bool, maxFind ...int) hornet.Hashes
- func (db *Database) TransactionOrNil(txHash hornet.Hash) *Transaction
- func (db *Database) TxMetadataOrNil(txHash hornet.Hash) *TransactionMetadata
- func (db *Database) WasAddressSpentFrom(address hornet.Hash) bool
- type Milestone
- type SnapshotInfo
- type SolidEntryPoints
- type SyncState
- type Transaction
- func (tx *Transaction) BranchHash() hornet.Hash
- func (tx *Transaction) BundleHash() hornet.Hash
- func (tx *Transaction) IsHead() bool
- func (tx *Transaction) IsTail() bool
- func (tx *Transaction) IsValue() bool
- func (tx *Transaction) TrunkHash() hornet.Hash
- func (tx *Transaction) Unmarshal(data []byte) error
- type TransactionMetadata
- func (m *TransactionMetadata) BranchHash() hornet.Hash
- func (m *TransactionMetadata) BundleHash() hornet.Hash
- func (m *TransactionMetadata) ConfirmedWithIndex() (bool, milestone.Index)
- func (m *TransactionMetadata) IsConfirmed() bool
- func (m *TransactionMetadata) IsConflicting() bool
- func (m *TransactionMetadata) IsMilestone() bool
- func (m *TransactionMetadata) IsSolid() bool
- func (m *TransactionMetadata) IsTail() bool
- func (m *TransactionMetadata) Marshal() []byte
- func (m *TransactionMetadata) MilestoneIndex() milestone.Index
- func (m *TransactionMetadata) TrunkHash() hornet.Hash
- func (m *TransactionMetadata) TxHash() hornet.Hash
- func (m *TransactionMetadata) Unmarshal(data []byte) error
Constants ¶
const ( MetadataSolid = 0 MetadataValid = 1 MetadataConfirmed = 2 MetadataIsMilestone = 3 MetadataIsValueSpam = 4 MetadataValidStrictSemantics = 5 MetadataConflicting = 6 MetadataInvalidPastCone = 7 )
const ( StorePrefixHealth byte = 0 StorePrefixTransactions byte = 1 StorePrefixTransactionMetadata byte = 2 StorePrefixBundleTransactions byte = 3 StorePrefixBundles byte = 4 StorePrefixAddresses byte = 5 StorePrefixMilestones byte = 6 StorePrefixLedgerState byte = 7 StorePrefixLedgerBalance byte = 8 StorePrefixLedgerDiff byte = 9 StorePrefixApprovers byte = 10 StorePrefixTags byte = 11 StorePrefixSnapshot byte = 12 StorePrefixSnapshotLedger byte = 13 // unused StorePrefixUnconfirmedTransactions byte = 14 // unused StorePrefixSpentAddresses byte = 15 StorePrefixAutopeering byte = 16 // unused StorePrefixWhiteFlag byte = 17 // unused )
const ( TransactionMetadataSolid = 0 TransactionMetadataConfirmed = 1 TransactionMetadataConflicting = 2 TransactionMetadataIsHead = 3 TransactionMetadataIsTail = 4 TransactionMetadataIsValue = 5 TransactionMetadataIsMilestone = 6 // metadata, confirmationIndex, trunkHash, branchHash, bundleHash, milestoneIndex. TransactionMetadataSize = 1 + milestone.IndexByteSize + hornet.HashSize + hornet.HashSize + hornet.HashSize + milestone.IndexByteSize )
const (
AddressTxIsValue = 1
)
const (
BundleTxIsTail = 1
)
const (
DBVersion = 3
)
const (
SnapshotMetadataSpentAddressesEnabled = 0
)
Variables ¶
var ( // ErrOperationAborted is returned when the operation was aborted e.g. by a shutdown signal. ErrOperationAborted = ierrors.New("operation was aborted") )
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func (*Bundle) Head ¶
func (bundle *Bundle) Head() *Transaction
func (*Bundle) IsMilestone ¶
func (*Bundle) IsValueSpam ¶
func (*Bundle) LedgerChanges ¶
func (*Bundle) MilestoneHash ¶
func (*Bundle) MilestoneIndex ¶
func (*Bundle) Tail ¶
func (bundle *Bundle) Tail() *Transaction
func (*Bundle) Transactions ¶
func (bundle *Bundle) Transactions() []*Transaction
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) ApproverHashes ¶
func (*Database) BalanceForAddress ¶
func (*Database) BundleTransactionHashes ¶
func (*Database) CloseDatabases ¶
func (*Database) ContainsAddress ¶
ContainsAddress returns if the given address exists in the cache/persistence layer.
func (*Database) ContainsApprover ¶
ContainsApprover returns if the given approver exists in the cache/persistence layer.
func (*Database) ContainsTag ¶
ContainsTag returns if the given tag exists in the cache/persistence layer.
func (*Database) LatestSolidMilestoneBundle ¶
LatestSolidMilestoneBundle returns the latest solid milestone bundle.
func (*Database) LatestSyncState ¶
func (*Database) LedgerDiffForMilestone ¶
func (db *Database) LedgerDiffForMilestone(ctx context.Context, targetIndex milestone.Index) (map[string]int64, error)
LedgerDiffForMilestone returns the ledger changes of that specific milestone.
func (*Database) LedgerIndex ¶
func (*Database) LedgerStateForLSMI ¶
func (db *Database) LedgerStateForLSMI(ctx context.Context) (map[string]uint64, milestone.Index, error)
LedgerStateForLSMI returns all balances for the current solid milestone.
func (*Database) LedgerStateForMilestone ¶
func (*Database) MilestoneBundleOrNil ¶
MilestoneBundleOrNil returns the Bundle of a milestone index or nil if it doesn't exist.
func (*Database) MilestoneOrNil ¶
func (*Database) MilestoneTimestamp ¶
MilestoneTimestamp returns the timestamp of a milestone.
func (*Database) SolidEntryPointsContain ¶
func (*Database) SolidMilestoneIndex ¶
SolidMilestoneIndex returns the latest solid milestone index.
func (*Database) TransactionHashesForAddress ¶
func (*Database) TransactionOrNil ¶
func (db *Database) TransactionOrNil(txHash hornet.Hash) *Transaction
func (*Database) TxMetadataOrNil ¶
func (db *Database) TxMetadataOrNil(txHash hornet.Hash) *TransactionMetadata
type SnapshotInfo ¶
type SnapshotInfo struct { CoordinatorAddress hornet.Hash Hash hornet.Hash SnapshotIndex milestone.Index EntryPointIndex milestone.Index PruningIndex milestone.Index Timestamp int64 Metadata bitmask.BitMask }
func (*SnapshotInfo) IsSpentAddressesEnabled ¶
func (i *SnapshotInfo) IsSpentAddressesEnabled() bool
type SolidEntryPoints ¶
type SolidEntryPoints struct {
// contains filtered or unexported fields
}
type Transaction ¶
type Transaction struct { // Decompressed iota.go Transaction containing Hash Tx *transaction.Transaction // contains filtered or unexported fields }
func NewTransaction ¶
func NewTransaction(txHash hornet.Hash) *Transaction
func (*Transaction) BranchHash ¶
func (tx *Transaction) BranchHash() hornet.Hash
func (*Transaction) BundleHash ¶
func (tx *Transaction) BundleHash() hornet.Hash
func (*Transaction) IsHead ¶
func (tx *Transaction) IsHead() bool
func (*Transaction) IsTail ¶
func (tx *Transaction) IsTail() bool
func (*Transaction) IsValue ¶
func (tx *Transaction) IsValue() bool
func (*Transaction) TrunkHash ¶
func (tx *Transaction) TrunkHash() hornet.Hash
func (*Transaction) Unmarshal ¶
func (tx *Transaction) Unmarshal(data []byte) error
type TransactionMetadata ¶
type TransactionMetadata struct {
// contains filtered or unexported fields
}
func NewTransactionMetadata ¶
func NewTransactionMetadata(txHash hornet.Hash) *TransactionMetadata
func (*TransactionMetadata) BranchHash ¶
func (m *TransactionMetadata) BranchHash() hornet.Hash
func (*TransactionMetadata) BundleHash ¶
func (m *TransactionMetadata) BundleHash() hornet.Hash
func (*TransactionMetadata) ConfirmedWithIndex ¶
func (m *TransactionMetadata) ConfirmedWithIndex() (bool, milestone.Index)
func (*TransactionMetadata) IsConfirmed ¶
func (m *TransactionMetadata) IsConfirmed() bool
func (*TransactionMetadata) IsConflicting ¶
func (m *TransactionMetadata) IsConflicting() bool
func (*TransactionMetadata) IsMilestone ¶ added in v1.1.0
func (m *TransactionMetadata) IsMilestone() bool
func (*TransactionMetadata) IsSolid ¶
func (m *TransactionMetadata) IsSolid() bool
func (*TransactionMetadata) IsTail ¶
func (m *TransactionMetadata) IsTail() bool
func (*TransactionMetadata) Marshal ¶ added in v1.1.0
func (m *TransactionMetadata) Marshal() []byte
func (*TransactionMetadata) MilestoneIndex ¶ added in v1.1.0
func (m *TransactionMetadata) MilestoneIndex() milestone.Index
func (*TransactionMetadata) TrunkHash ¶
func (m *TransactionMetadata) TrunkHash() hornet.Hash
func (*TransactionMetadata) TxHash ¶
func (m *TransactionMetadata) TxHash() hornet.Hash
func (*TransactionMetadata) Unmarshal ¶
func (m *TransactionMetadata) Unmarshal(data []byte) error