engine

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package engine manages syncing with the Factom blockchain and updating state. Start launches a number of goroutines: one to query for DBlocks sequentially, and a number of workers to concurrently process EBlocks within a DBlock and update state. If any runtime errors occur, engine finishes processing the current set of EBlocks and then exits. See Start for more details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSyncStatus

func GetSyncStatus() (sync, current uint32)

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

func Start

func Start(stop <-chan struct{}) (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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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