index

package
v0.34.0-crescendo-prev... Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventsIndex

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

EventsIndex implements a wrapper around `storage.Events` ensuring that needed data has been synced and is available to the client. Note: `EventsIndex` is created with empty report due to the next reasoning: When the index is initially bootstrapped, the indexer needs to load an execution state checkpoint from disk and index all the data. This process can take more than 1 hour on some systems. Consequently, the Initialize pattern is implemented to enable the Access API to start up and serve queries before the index is fully ready. During the initialization phase, all calls to retrieve data from this struct should return indexer.ErrIndexNotInitialized. The caller is responsible for handling this error appropriately for the method.

func NewEventsIndex

func NewEventsIndex(events storage.Events) *EventsIndex

func (*EventsIndex) ByBlockID

func (e *EventsIndex) ByBlockID(blockID flow.Identifier, height uint64) ([]flow.Event, error)

ByBlockID checks data availability and returns events for a block Expected errors:

  • indexer.ErrIndexNotInitialized if the `EventsIndex` has not been initialized
  • storage.ErrHeightNotIndexed when data is unavailable
  • codes.NotFound if result cannot be provided by storage due to the absence of data.

func (*EventsIndex) ByBlockIDTransactionID

func (e *EventsIndex) ByBlockIDTransactionID(blockID flow.Identifier, height uint64, transactionID flow.Identifier) ([]flow.Event, error)

ByBlockIDTransactionID checks data availability and return events for the given block ID and transaction ID Expected errors:

  • indexer.ErrIndexNotInitialized if the `EventsIndex` has not been initialized
  • storage.ErrHeightNotIndexed when data is unavailable
  • codes.NotFound if result cannot be provided by storage due to the absence of data.

func (*EventsIndex) ByBlockIDTransactionIndex

func (e *EventsIndex) ByBlockIDTransactionIndex(blockID flow.Identifier, height uint64, txIndex uint32) ([]flow.Event, error)

ByBlockIDTransactionIndex checks data availability and return events for the transaction at given index in a given block Expected errors:

  • indexer.ErrIndexNotInitialized if the `EventsIndex` has not been initialized
  • storage.ErrHeightNotIndexed when data is unavailable
  • codes.NotFound if result cannot be provided by storage due to the absence of data.

func (*EventsIndex) HighestIndexedHeight added in v0.35.4

func (e *EventsIndex) HighestIndexedHeight() (uint64, error)

HighestIndexedHeight returns the highest height indexed by the execution state indexer. Expected errors: - indexer.ErrIndexNotInitialized if the EventsIndex has not been initialized

func (*EventsIndex) Initialize added in v0.35.4

func (e *EventsIndex) Initialize(indexReporter state_synchronization.IndexReporter) error

Initialize replaces a previously non-initialized reporter. Can be called once. No errors are expected during normal operations.

func (*EventsIndex) LowestIndexedHeight added in v0.35.4

func (e *EventsIndex) LowestIndexedHeight() (uint64, error)

LowestIndexedHeight returns the lowest height indexed by the execution state indexer. Expected errors: - indexer.ErrIndexNotInitialized if the EventsIndex has not been initialized

type TransactionResultsIndex

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

TransactionResultsIndex implements a wrapper around `storage.LightTransactionResult` ensuring that needed data has been synced and is available to the client. Note: `TransactionResultsIndex` is created with empty report due to the next reasoning: When the index is initially bootstrapped, the indexer needs to load an execution state checkpoint from disk and index all the data. This process can take more than 1 hour on some systems. Consequently, the Initialize pattern is implemented to enable the Access API to start up and serve queries before the index is fully ready. During the initialization phase, all calls to retrieve data from this struct should return indexer.ErrIndexNotInitialized. The caller is responsible for handling this error appropriately for the method.

func (*TransactionResultsIndex) ByBlockID

func (t *TransactionResultsIndex) ByBlockID(blockID flow.Identifier, height uint64) ([]flow.LightTransactionResult, error)

ByBlockID checks data availability and returns all transaction results for a block Expected errors:

  • indexer.ErrIndexNotInitialized if the `TransactionResultsIndex` has not been initialized
  • storage.ErrHeightNotIndexed when data is unavailable
  • codes.NotFound if result cannot be provided by storage due to the absence of data.

func (*TransactionResultsIndex) ByBlockIDTransactionID

func (t *TransactionResultsIndex) ByBlockIDTransactionID(blockID flow.Identifier, height uint64, txID flow.Identifier) (*flow.LightTransactionResult, error)

ByBlockIDTransactionID checks data availability and return the transaction result for the given block ID and transaction ID Expected errors:

  • indexer.ErrIndexNotInitialized if the `TransactionResultsIndex` has not been initialized
  • storage.ErrHeightNotIndexed when data is unavailable
  • codes.NotFound if result cannot be provided by storage due to the absence of data.

func (*TransactionResultsIndex) ByBlockIDTransactionIndex

func (t *TransactionResultsIndex) ByBlockIDTransactionIndex(blockID flow.Identifier, height uint64, index uint32) (*flow.LightTransactionResult, error)

ByBlockIDTransactionIndex checks data availability and return the transaction result for the given blockID and transaction index Expected errors:

  • indexer.ErrIndexNotInitialized if the `TransactionResultsIndex` has not been initialized
  • storage.ErrHeightNotIndexed when data is unavailable
  • codes.NotFound when result cannot be provided by storage due to the absence of data.

func (*TransactionResultsIndex) HighestIndexedHeight added in v0.35.4

func (t *TransactionResultsIndex) HighestIndexedHeight() (uint64, error)

HighestIndexedHeight returns the highest height indexed by the execution state indexer. Expected errors: - indexer.ErrIndexNotInitialized if the `TransactionResultsIndex` has not been initialized

func (*TransactionResultsIndex) Initialize added in v0.35.4

Initialize replaces a previously non-initialized reporter. Can be called once. No errors are expected during normal operations.

func (*TransactionResultsIndex) LowestIndexedHeight added in v0.35.4

func (t *TransactionResultsIndex) LowestIndexedHeight() (uint64, error)

LowestIndexedHeight returns the lowest height indexed by the execution state indexer. Expected errors: - indexer.ErrIndexNotInitialized if the `TransactionResultsIndex` has not been initialized

Jump to

Keyboard shortcuts

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