Documentation
¶
Index ¶
- Variables
- func GetSyncStatus() (sync, current uint32)
- func Process(ctx context.Context, dbKeyMR *factom.Bytes32, eb factom.EBlock) error
- func ProcessPending(ctx context.Context, es ...factom.Entry) error
- func Start(ctx context.Context) (done <-chan struct{})
- type Chain
- func (chain *Chain) Apply(ctx context.Context, c *factom.Client, dbKeyMR *factom.Bytes32, ...) error
- func (chain Chain) String() string
- func (chain *Chain) Sync(ctx context.Context, c *factom.Client) error
- func (chain *Chain) SyncEBlocks(ctx context.Context, c *factom.Client, ebs []factom.EBlock) error
- type ChainMap
- type ChainStatus
- type Pending
Constants ¶
This section is empty.
Variables ¶
var ( Chains = ChainMap{ RWMutex: new(sync.RWMutex), // contains filtered or unexported fields } )
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 ¶
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 ¶
type Chain ¶
type Chain struct {
ChainStatus
db.Chain
Pending Pending
}
func OpenNewByChainID ¶
type ChainMap ¶
func (*ChainMap) Get ¶
func (cm *ChainMap) Get(ctx context.Context, id *factom.Bytes32, pending bool) (Chain, func(), error)
Get returns a threadsafe connection to the database, and a function to release the connection back to the pool. If pending is true, the chain will reflect the state with pending entries applied. Otherwise the chain will reflect the official state after the most recent EBlock.
func (*ChainMap) GetTracked ¶
type ChainStatus ¶
type ChainStatus uint
const ( ChainStatusUnknown ChainStatus = 0 ChainStatusTracked ChainStatus = 1 ChainStatusIssued ChainStatus = 3 ChainStatusIgnored ChainStatus = 4 )
func (ChainStatus) IsIgnored ¶
func (status ChainStatus) IsIgnored() bool
func (ChainStatus) IsIssued ¶
func (status ChainStatus) IsIssued() bool
func (ChainStatus) IsTracked ¶
func (status ChainStatus) IsTracked() bool
func (ChainStatus) IsUnknown ¶
func (status ChainStatus) IsUnknown() bool
func (ChainStatus) String ¶
func (status ChainStatus) String() string