engine

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDBlock added in v1.1.0

func ApplyDBlock(ctx context.Context, c *factom.Client, h uint32, state State) error

func ApplyPendingEntries added in v1.1.0

func ApplyPendingEntries(ctx context.Context, c *factom.Client, state State) error

func Get added in v1.1.0

func Get(ctx context.Context, chainID *factom.Bytes32, includePending bool) (
	state.Chain, func(), error)

func GetSyncStatus

func GetSyncStatus() (sync, current uint32)

GetSyncStatus is a threadsafe way to get the sync height and current Factom Blockchain height.

func IssuedIDs added in v1.1.0

func IssuedIDs() []*factom.Bytes32

func Start

func Start(ctx context.Context, c *factom.Client) (done <-chan struct{})

Start launches the main engine goroutine, which loads state and starts the worker goroutines. If stop is closed or if an error occurs, the engine will finish processing the current DBlock, cleanup and close state, all goroutines will exit, and done will be closed. If the done channel is closed before the stop channel is closed, an error occurred.

func TrackedIDs added in v1.1.0

func TrackedIDs() []*factom.Bytes32

Types

type State added in v1.1.0

type State interface {
	ApplyEBlock(context.Context, *factom.Bytes32, factom.EBlock) error
	ApplyPendingEntries(context.Context, []factom.Entry) error
	SetSync(context.Context, uint32, *factom.Bytes32) error
	GetSync() uint32
	TrackedIDs() []*factom.Bytes32
	IssuedIDs() []*factom.Bytes32
	Get(context.Context, *factom.Bytes32, bool) (state.Chain, func(), error)
	Close()
}

Jump to

Keyboard shortcuts

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