tangle

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2020 License: Apache-2.0, BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_MISSING_TIME_BEFORE_CLEANUP = 30 * time.Second
	MISSING_CHECK_INTERVAL          = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Events

type Events struct {
	TransactionAttached        *events.Event
	TransactionSolid           *events.Event
	MissingTransactionReceived *events.Event
	TransactionMissing         *events.Event
	TransactionUnsolidifiable  *events.Event
	TransactionRemoved         *events.Event
}

type Tangle

type Tangle struct {
	Events Events
	// contains filtered or unexported fields
}

func New

func New(badgerInstance *badger.DB, storageId []byte) (result *Tangle)

Constructor for the tangle.

func (*Tangle) AttachTransaction

func (tangle *Tangle) AttachTransaction(transaction *transaction.Transaction)

Attaches a new transaction to the tangle.

func (*Tangle) DeleteTransaction

func (tangle *Tangle) DeleteTransaction(transactionId transaction.Id)

Deletes a transaction from the tangle (i.e. for local snapshots)

func (*Tangle) GetApprovers

func (tangle *Tangle) GetApprovers(transactionId transaction.Id) approver.CachedApprovers

Retrieves the approvers of a transaction from the tangle.

func (*Tangle) GetStorageId

func (tangle *Tangle) GetStorageId() []byte

Returns the storage id of this tangle (can be used to create ontologies that follow the storage of the main tangle).

func (*Tangle) GetTransaction

func (tangle *Tangle) GetTransaction(transactionId transaction.Id) *transaction.CachedTransaction

Retrieves a transaction from the tangle.

func (*Tangle) GetTransactionMetadata

func (tangle *Tangle) GetTransactionMetadata(transactionId transaction.Id) *transactionmetadata.CachedTransactionMetadata

Retrieves the metadata of a transaction from the tangle.

func (*Tangle) Prune

func (tangle *Tangle) Prune() error

Resets the database and deletes all objects (good for testing or "node resets").

func (*Tangle) Shutdown

func (tangle *Tangle) Shutdown() *Tangle

Marks the tangle as stopped, so it will not accept any new transactions (waits for all backgroundTasks to finish.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL