Documentation ¶
Overview ¶
Package ingest implements an engine for receiving transactions that need to be packaged into a collection.
Index ¶
- type Config
- type Engine
- func (e *Engine) Done() <-chan struct{}
- func (e *Engine) Process(originID flow.Identifier, event interface{}) error
- func (e *Engine) ProcessLocal(event interface{}) error
- func (e *Engine) Ready() <-chan struct{}
- func (e *Engine) Submit(originID flow.Identifier, event interface{})
- func (e *Engine) SubmitLocal(event interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // how much buffer time there is between a transaction being ingested by a // collection node and being included in a collection and block ExpiryBuffer uint // the maximum transaction gas limit MaxGasLimit uint64 // whether or not we allow transactions that reference a block we have not // validated or seen yet AllowUnknownReference bool // whether or not we check that transaction scripts are parse-able CheckScriptsParse bool // how many extra nodes in the responsible cluster we propagate transactions to // (we always send to at least one) PropagationRedundancy uint }
Config defines configuration for the transaction ingest engine.
func DefaultConfig ¶
func DefaultConfig() Config
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the transaction ingestion engine, which ensures that new transactions are delegated to the correct collection cluster, and prepared to be included in a collection.
func New ¶
func New( log zerolog.Logger, net module.Network, state protocol.State, engMetrics module.EngineMetrics, colMetrics module.CollectionMetrics, me module.Local, pool mempool.Transactions, config Config, ) (*Engine, error)
New creates a new collection ingest engine.
func (*Engine) Done ¶
func (e *Engine) Done() <-chan struct{}
Done returns a done channel that is closed once the engine has fully stopped.
func (*Engine) Process ¶
func (e *Engine) Process(originID flow.Identifier, event interface{}) error
Process processes the given event from the node with the given origin ID in a blocking manner. It returns the potential processing error when done.
func (*Engine) ProcessLocal ¶
ProcessLocal processes an event originating on the local node.
func (*Engine) Ready ¶
func (e *Engine) Ready() <-chan struct{}
Ready returns a ready channel that is closed once the engine has fully started.
func (*Engine) Submit ¶
func (e *Engine) Submit(originID flow.Identifier, event interface{})
Submit submits the given event from the node with the given origin ID for processing in a non-blocking manner. It returns instantly and logs a potential processing error internally when done.
func (*Engine) SubmitLocal ¶
func (e *Engine) SubmitLocal(event interface{})
SubmitLocal submits an event originating on the local node.