Documentation ¶
Index ¶
- type Backend
- func (b *Backend) DeriveTransactionStatus(tx *flow.TransactionBody, executed bool) (flow.TransactionStatus, error)
- func (b *Backend) ExecuteScriptAtBlockHeight(ctx context.Context, blockHeight uint64, script []byte, arguments [][]byte) ([]byte, error)
- func (b *Backend) ExecuteScriptAtBlockID(ctx context.Context, blockID flow.Identifier, script []byte, ...) ([]byte, error)
- func (b *Backend) ExecuteScriptAtLatestBlock(ctx context.Context, script []byte, arguments [][]byte) ([]byte, error)
- func (b *Backend) GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error)
- func (b *Backend) GetAccountAtBlockHeight(ctx context.Context, address flow.Address, height uint64) (*flow.Account, error)
- func (b *Backend) GetAccountAtLatestBlock(ctx context.Context, address flow.Address) (*flow.Account, error)
- func (b *Backend) GetBlockByHeight(_ context.Context, height uint64) (*flow.Block, error)
- func (b *Backend) GetBlockByID(_ context.Context, id flow.Identifier) (*flow.Block, error)
- func (b *Backend) GetBlockHeaderByHeight(_ context.Context, height uint64) (*flow.Header, error)
- func (b *Backend) GetBlockHeaderByID(_ context.Context, id flow.Identifier) (*flow.Header, error)
- func (b *Backend) GetCollectionByID(_ context.Context, colID flow.Identifier) (*flow.LightCollection, error)
- func (b *Backend) GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier) ([]flow.BlockEvents, error)
- func (b *Backend) GetEventsForHeightRange(ctx context.Context, eventType string, startHeight, endHeight uint64) ([]flow.BlockEvents, error)
- func (b *Backend) GetLatestBlock(_ context.Context, isSealed bool) (*flow.Block, error)
- func (b *Backend) GetLatestBlockHeader(_ context.Context, isSealed bool) (*flow.Header, error)
- func (b *Backend) GetNetworkParameters(_ context.Context) access.NetworkParameters
- func (b *Backend) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.TransactionBody, error)
- func (b *Backend) GetTransactionResult(ctx context.Context, txID flow.Identifier) (*access.TransactionResult, error)
- func (b *Backend) NotifyFinalizedBlockHeight(height uint64)
- func (b *Backend) Ping(ctx context.Context) error
- func (b *Backend) SendRawTransaction(ctx context.Context, tx *flow.TransactionBody) error
- func (b *Backend) SendTransaction(ctx context.Context, tx *flow.TransactionBody) error
- type ConnectionFactory
- type ConnectionFactoryImpl
- type Retry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backends implements the Access API.
It is composed of several sub-backends that implement part of the Access API.
Script related calls are handled by backendScripts. Transaction related calls are handled by backendTransactions. Block Header related calls are handled by backendBlockHeaders. Block details related calls are handled by backendBlockDetails. Event related calls are handled by backendEvents. Account related calls are handled by backendAccounts.
All remaining calls are handled by the base Backend in this file.
func New ¶
func New( state protocol.State, executionRPC execproto.ExecutionAPIClient, collectionRPC accessproto.AccessAPIClient, historicalAccessNodes []accessproto.AccessAPIClient, blocks storage.Blocks, headers storage.Headers, collections storage.Collections, transactions storage.Transactions, chainID flow.ChainID, transactionMetrics module.TransactionMetrics, collectionGRPCPort uint, connFactory ConnectionFactory, retryEnabled bool, ) *Backend
func (*Backend) DeriveTransactionStatus ¶
func (b *Backend) DeriveTransactionStatus( tx *flow.TransactionBody, executed bool, ) (flow.TransactionStatus, error)
DeriveTransactionStatus derives the transaction status based on current protocol state
func (*Backend) ExecuteScriptAtBlockHeight ¶
func (*Backend) ExecuteScriptAtBlockID ¶
func (*Backend) ExecuteScriptAtLatestBlock ¶
func (*Backend) GetAccount ¶
func (*Backend) GetAccountAtBlockHeight ¶
func (*Backend) GetAccountAtLatestBlock ¶
func (*Backend) GetBlockByHeight ¶
func (*Backend) GetBlockByID ¶
func (*Backend) GetBlockHeaderByHeight ¶
func (*Backend) GetBlockHeaderByID ¶
func (*Backend) GetCollectionByID ¶
func (b *Backend) GetCollectionByID(_ context.Context, colID flow.Identifier) (*flow.LightCollection, error)
func (*Backend) GetEventsForBlockIDs ¶
func (b *Backend) GetEventsForBlockIDs( ctx context.Context, eventType string, blockIDs []flow.Identifier, ) ([]flow.BlockEvents, error)
GetEventsForBlockIDs retrieves events for all the specified block IDs that have the given type
func (*Backend) GetEventsForHeightRange ¶
func (b *Backend) GetEventsForHeightRange( ctx context.Context, eventType string, startHeight, endHeight uint64, ) ([]flow.BlockEvents, error)
GetEventsForHeightRange retrieves events for all sealed blocks between the start block height and the end block height (inclusive) that have the given type.
func (*Backend) GetLatestBlock ¶
func (*Backend) GetLatestBlockHeader ¶
func (*Backend) GetNetworkParameters ¶
func (b *Backend) GetNetworkParameters(_ context.Context) access.NetworkParameters
func (*Backend) GetTransaction ¶
func (b *Backend) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.TransactionBody, error)
func (*Backend) GetTransactionResult ¶
func (b *Backend) GetTransactionResult( ctx context.Context, txID flow.Identifier, ) (*access.TransactionResult, error)
func (*Backend) NotifyFinalizedBlockHeight ¶
func (b *Backend) NotifyFinalizedBlockHeight(height uint64)
func (*Backend) SendRawTransaction ¶
func (b *Backend) SendRawTransaction( ctx context.Context, tx *flow.TransactionBody, ) error
SendRawTransaction sends a raw transaction to the collection node
func (*Backend) SendTransaction ¶
func (b *Backend) SendTransaction( ctx context.Context, tx *flow.TransactionBody, ) error
SendTransaction forwards the transaction to the collection node
type ConnectionFactory ¶
type ConnectionFactory interface {
GetAccessAPIClient(address string) (access.AccessAPIClient, io.Closer, error)
}
ConnectionFactory is used to create an access api client
type ConnectionFactoryImpl ¶
type ConnectionFactoryImpl struct { }
func (*ConnectionFactoryImpl) GetAccessAPIClient ¶
func (cf *ConnectionFactoryImpl) GetAccessAPIClient(address string) (access.AccessAPIClient, io.Closer, error)
type Retry ¶
type Retry struct {
// contains filtered or unexported fields
}
Retry implements a simple retry mechanism for transaction submission.
func (*Retry) RegisterTransaction ¶
func (r *Retry) RegisterTransaction(height uint64, tx *flow.TransactionBody)
RegisterTransaction adds a transaction that could possibly be retried