ingestion

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: AGPL-3.0 Imports: 32 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

An Engine receives and saves incoming blocks.

func New

func New(
	logger zerolog.Logger,
	net module.Network,
	me module.Local,
	request module.Requester,
	state protocol.State,
	blocks storage.Blocks,
	payloads storage.Payloads,
	collections storage.Collections,
	events storage.Events,
	transactionResults storage.TransactionResults,
	executionEngine computation.ComputationManager,
	providerEngine provider.ProviderEngine,
	blockSync module.BlockRequester,
	execState state.ExecutionState,
	syncThreshold uint64,
	syncFilter flow.IdentityFilter,
	syncByBlocks bool,
	metrics module.ExecutionMetrics,
	tracer module.Tracer,
	extLog bool,
) (*Engine, error)

func (*Engine) Done

func (e *Engine) Done() <-chan struct{}

Done returns a channel that will close when the engine has successfully stopped.

func (*Engine) ExecuteScriptAtBlockID

func (e *Engine) ExecuteScriptAtBlockID(ctx context.Context, script []byte, arguments [][]byte, blockID flow.Identifier) ([]byte, error)

func (*Engine) GetAccount

func (e *Engine) GetAccount(ctx context.Context, addr flow.Address, blockID flow.Identifier) (*flow.Account, error)

func (*Engine) OnCollection

func (e *Engine) OnCollection(originID flow.Identifier, entity flow.Entity)

func (*Engine) Process

func (e *Engine) Process(originID flow.Identifier, event interface{}) error

func (*Engine) ProcessLocal

func (e *Engine) ProcessLocal(event interface{}) error

func (*Engine) Ready

func (e *Engine) Ready() <-chan struct{}

Ready returns a channel that will close when the engine has successfully started.

func (*Engine) StartSync

func (e *Engine) StartSync(ctx context.Context, firstKnown *entity.ExecutableBlock)

func (*Engine) Submit

func (e *Engine) Submit(originID flow.Identifier, event interface{})

func (*Engine) SubmitLocal

func (e *Engine) SubmitLocal(event interface{})

Engine boilerplate

func (*Engine) Wait

func (e *Engine) Wait()

type IngestRPC

type IngestRPC interface {

	// ExecuteScriptAtBlockID executes a script at the given Block id
	ExecuteScriptAtBlockID(ctx context.Context, script []byte, arguments [][]byte, blockID flow.Identifier) ([]byte, error)

	// GetAccount returns the Account details at the given Block id
	GetAccount(ctx context.Context, address flow.Address, blockID flow.Identifier) (*flow.Account, error)
}

IngestRPC represents the RPC calls that the execution ingest engine exposes to support the Access Node API calls

type Mempool

type Mempool struct {
	BlockByCollection *stdmap.BlockByCollections
	ExecutionQueue    *stdmap.Queues
	OrphanQueue       *stdmap.Queues
	SyncQueues        *stdmap.Queues
}

func (*Mempool) Run

func (m *Mempool) Run(f func(blockByCollection *stdmap.BlockByCollectionBackdata, executionQueue *stdmap.QueuesBackdata, orphanQueue *stdmap.QueuesBackdata) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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