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.