Documentation
¶
Index ¶
- func HandleRPCSubscription[T any](sub subscription.Subscription, handleResponse func(resp T) error) error
- func WithBlockSignerDecoder(signerIndicesDecoder hotstuff.BlockSignerDecoder) func(*Handler)
- func WithIndexReporter(indexReporter state_synchronization.IndexReporter) func(*Handler)
- type Config
- type Engine
- type HTTPHeader
- type Handler
- func (h *Handler) ExecuteScriptAtBlockHeight(ctx context.Context, req *accessproto.ExecuteScriptAtBlockHeightRequest) (*accessproto.ExecuteScriptResponse, error)
- func (h *Handler) ExecuteScriptAtBlockID(ctx context.Context, req *accessproto.ExecuteScriptAtBlockIDRequest) (*accessproto.ExecuteScriptResponse, error)
- func (h *Handler) ExecuteScriptAtLatestBlock(ctx context.Context, req *accessproto.ExecuteScriptAtLatestBlockRequest) (*accessproto.ExecuteScriptResponse, error)
- func (h *Handler) GetAccount(ctx context.Context, req *accessproto.GetAccountRequest) (*accessproto.GetAccountResponse, error)
- func (h *Handler) GetAccountAtBlockHeight(ctx context.Context, req *accessproto.GetAccountAtBlockHeightRequest) (*accessproto.AccountResponse, error)
- func (h *Handler) GetAccountAtLatestBlock(ctx context.Context, req *accessproto.GetAccountAtLatestBlockRequest) (*accessproto.AccountResponse, error)
- func (h *Handler) GetAccountBalanceAtBlockHeight(ctx context.Context, req *accessproto.GetAccountBalanceAtBlockHeightRequest) (*accessproto.AccountBalanceResponse, error)
- func (h *Handler) GetAccountBalanceAtLatestBlock(ctx context.Context, req *accessproto.GetAccountBalanceAtLatestBlockRequest) (*accessproto.AccountBalanceResponse, error)
- func (h *Handler) GetAccountKeyAtBlockHeight(ctx context.Context, req *accessproto.GetAccountKeyAtBlockHeightRequest) (*accessproto.AccountKeyResponse, error)
- func (h *Handler) GetAccountKeyAtLatestBlock(ctx context.Context, req *accessproto.GetAccountKeyAtLatestBlockRequest) (*accessproto.AccountKeyResponse, error)
- func (h *Handler) GetAccountKeysAtBlockHeight(ctx context.Context, req *accessproto.GetAccountKeysAtBlockHeightRequest) (*accessproto.AccountKeysResponse, error)
- func (h *Handler) GetAccountKeysAtLatestBlock(ctx context.Context, req *accessproto.GetAccountKeysAtLatestBlockRequest) (*accessproto.AccountKeysResponse, error)
- func (h *Handler) GetBlockByHeight(ctx context.Context, req *accessproto.GetBlockByHeightRequest) (*accessproto.BlockResponse, error)
- func (h *Handler) GetBlockByID(ctx context.Context, req *accessproto.GetBlockByIDRequest) (*accessproto.BlockResponse, error)
- func (h *Handler) GetBlockHeaderByHeight(ctx context.Context, req *accessproto.GetBlockHeaderByHeightRequest) (*accessproto.BlockHeaderResponse, error)
- func (h *Handler) GetBlockHeaderByID(ctx context.Context, req *accessproto.GetBlockHeaderByIDRequest) (*accessproto.BlockHeaderResponse, error)
- func (h *Handler) GetCollectionByID(ctx context.Context, req *accessproto.GetCollectionByIDRequest) (*accessproto.CollectionResponse, error)
- func (h *Handler) GetEventsForBlockIDs(ctx context.Context, req *accessproto.GetEventsForBlockIDsRequest) (*accessproto.EventsResponse, error)
- func (h *Handler) GetEventsForHeightRange(ctx context.Context, req *accessproto.GetEventsForHeightRangeRequest) (*accessproto.EventsResponse, error)
- func (h *Handler) GetExecutionResultByID(ctx context.Context, req *accessproto.GetExecutionResultByIDRequest) (*accessproto.ExecutionResultByIDResponse, error)
- func (h *Handler) GetExecutionResultForBlockID(ctx context.Context, req *accessproto.GetExecutionResultForBlockIDRequest) (*accessproto.ExecutionResultForBlockIDResponse, error)
- func (h *Handler) GetFullCollectionByID(ctx context.Context, req *accessproto.GetFullCollectionByIDRequest) (*accessproto.FullCollectionResponse, error)
- func (h *Handler) GetLatestBlock(ctx context.Context, req *accessproto.GetLatestBlockRequest) (*accessproto.BlockResponse, error)
- func (h *Handler) GetLatestBlockHeader(ctx context.Context, req *accessproto.GetLatestBlockHeaderRequest) (*accessproto.BlockHeaderResponse, error)
- func (h *Handler) GetLatestProtocolStateSnapshot(ctx context.Context, req *accessproto.GetLatestProtocolStateSnapshotRequest) (*accessproto.ProtocolStateSnapshotResponse, error)
- func (h *Handler) GetNetworkParameters(ctx context.Context, _ *accessproto.GetNetworkParametersRequest) (*accessproto.GetNetworkParametersResponse, error)
- func (h *Handler) GetNodeVersionInfo(ctx context.Context, _ *accessproto.GetNodeVersionInfoRequest) (*accessproto.GetNodeVersionInfoResponse, error)
- func (h *Handler) GetProtocolStateSnapshotByBlockID(ctx context.Context, req *accessproto.GetProtocolStateSnapshotByBlockIDRequest) (*accessproto.ProtocolStateSnapshotResponse, error)
- func (h *Handler) GetProtocolStateSnapshotByHeight(ctx context.Context, req *accessproto.GetProtocolStateSnapshotByHeightRequest) (*accessproto.ProtocolStateSnapshotResponse, error)
- func (h *Handler) GetSystemTransaction(ctx context.Context, req *accessproto.GetSystemTransactionRequest) (*accessproto.TransactionResponse, error)
- func (h *Handler) GetSystemTransactionResult(ctx context.Context, req *accessproto.GetSystemTransactionResultRequest) (*accessproto.TransactionResultResponse, error)
- func (h *Handler) GetTransaction(ctx context.Context, req *accessproto.GetTransactionRequest) (*accessproto.TransactionResponse, error)
- func (h *Handler) GetTransactionResult(ctx context.Context, req *accessproto.GetTransactionRequest) (*accessproto.TransactionResultResponse, error)
- func (h *Handler) GetTransactionResultByIndex(ctx context.Context, req *accessproto.GetTransactionByIndexRequest) (*accessproto.TransactionResultResponse, error)
- func (h *Handler) GetTransactionResultsByBlockID(ctx context.Context, req *accessproto.GetTransactionsByBlockIDRequest) (*accessproto.TransactionResultsResponse, error)
- func (h *Handler) GetTransactionsByBlockID(ctx context.Context, req *accessproto.GetTransactionsByBlockIDRequest) (*accessproto.TransactionsResponse, error)
- func (h *Handler) Ping(ctx context.Context, _ *accessproto.PingRequest) (*accessproto.PingResponse, error)
- func (h *Handler) SendAndSubscribeTransactionStatuses(request *accessproto.SendAndSubscribeTransactionStatusesRequest, ...) error
- func (h *Handler) SendTransaction(ctx context.Context, req *accessproto.SendTransactionRequest) (*accessproto.SendTransactionResponse, error)
- func (h *Handler) SubscribeBlockDigestsFromLatest(request *accessproto.SubscribeBlockDigestsFromLatestRequest, ...) error
- func (h *Handler) SubscribeBlockDigestsFromStartBlockID(request *accessproto.SubscribeBlockDigestsFromStartBlockIDRequest, ...) error
- func (h *Handler) SubscribeBlockDigestsFromStartHeight(request *accessproto.SubscribeBlockDigestsFromStartHeightRequest, ...) error
- func (h *Handler) SubscribeBlockHeadersFromLatest(request *accessproto.SubscribeBlockHeadersFromLatestRequest, ...) error
- func (h *Handler) SubscribeBlockHeadersFromStartBlockID(request *accessproto.SubscribeBlockHeadersFromStartBlockIDRequest, ...) error
- func (h *Handler) SubscribeBlockHeadersFromStartHeight(request *accessproto.SubscribeBlockHeadersFromStartHeightRequest, ...) error
- func (h *Handler) SubscribeBlocksFromLatest(request *accessproto.SubscribeBlocksFromLatestRequest, ...) error
- func (h *Handler) SubscribeBlocksFromStartBlockID(request *accessproto.SubscribeBlocksFromStartBlockIDRequest, ...) error
- func (h *Handler) SubscribeBlocksFromStartHeight(request *accessproto.SubscribeBlocksFromStartHeightRequest, ...) error
- type HandlerOption
- type Option
- type RPCEngineBuilder
- func (builder *RPCEngineBuilder) Build() (*Engine, error)
- func (builder *RPCEngineBuilder) DefaultHandler(signerIndicesDecoder hotstuff.BlockSignerDecoder) *Handler
- func (builder *RPCEngineBuilder) RpcHandler() accessproto.AccessAPIServer
- func (builder *RPCEngineBuilder) WithBlockSignerDecoder(signerIndicesDecoder hotstuff.BlockSignerDecoder) *RPCEngineBuilder
- func (builder *RPCEngineBuilder) WithLegacy() *RPCEngineBuilder
- func (builder *RPCEngineBuilder) WithMetrics() *RPCEngineBuilder
- func (builder *RPCEngineBuilder) WithRpcHandler(handler accessproto.AccessAPIServer) *RPCEngineBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleRPCSubscription ¶ added in v0.40.0
func HandleRPCSubscription[T any](sub subscription.Subscription, handleResponse func(resp T) error) error
HandleRPCSubscription is a generic handler for subscriptions to a specific type for rpc calls.
Parameters: - sub: The subscription. - handleResponse: The function responsible for handling the response of the subscribed type.
Expected errors during normal operation:
- codes.Internal: If the subscription encounters an error or gets an unexpected response.
func WithBlockSignerDecoder ¶ added in v0.40.0
func WithBlockSignerDecoder(signerIndicesDecoder hotstuff.BlockSignerDecoder) func(*Handler)
WithBlockSignerDecoder configures the Handler to decode signer indices via the provided hotstuff.BlockSignerDecoder
func WithIndexReporter ¶ added in v0.40.0
func WithIndexReporter(indexReporter state_synchronization.IndexReporter) func(*Handler)
WithIndexReporter configures the Handler to work with index reporter
Types ¶
type Config ¶
type Config struct { UnsecureGRPCListenAddr string // the non-secure GRPC server address as ip:port SecureGRPCListenAddr string // the secure GRPC server address as ip:port TransportCredentials credentials.TransportCredentials // the secure GRPC credentials HTTPListenAddr string // the HTTP web proxy address as ip:port CollectionAddr string // the address of the upstream collection node HistoricalAccessAddrs string // the list of all access nodes from previous spork BackendConfig backend.Config // configurable options for creating Backend RestConfig rest.Config // the REST server configuration CompressorName string // GRPC compressor name WebSocketConfig websockets.Config EnableWebSocketsStreamAPI bool // holds value of deprecated MaxMsgSize flag for use during bootstrapping. // will be removed in a future release. DeprecatedMaxMsgSize uint // in bytes }
Config defines the configurable options for the access node server A secure GRPC server here implies a server that presents a self-signed TLS certificate and a client that authenticates the server via a pre-shared public key
type Engine ¶
Engine exposes the server with a simplified version of the Access API. An unsecured GRPC server (default port 9000), a secure GRPC server (default port 9001) and an HTTP Web proxy (default port 8000) are brought up.
func (*Engine) OnFinalizedBlock ¶ added in v0.31.0
OnFinalizedBlock responds to block finalization events.
func (*Engine) RestApiAddress ¶ added in v0.23.2
RestApiAddress returns the listen address of the REST API server. Guaranteed to be non-nil after Engine.Ready is closed.
type HTTPHeader ¶
type Handler ¶ added in v0.40.0
type Handler struct { subscription.StreamingData // contains filtered or unexported fields }
func NewHandler ¶ added in v0.40.0
func (*Handler) ExecuteScriptAtBlockHeight ¶ added in v0.40.0
func (h *Handler) ExecuteScriptAtBlockHeight( ctx context.Context, req *accessproto.ExecuteScriptAtBlockHeightRequest, ) (*accessproto.ExecuteScriptResponse, error)
ExecuteScriptAtBlockHeight executes a script at a specific block height.
func (*Handler) ExecuteScriptAtBlockID ¶ added in v0.40.0
func (h *Handler) ExecuteScriptAtBlockID( ctx context.Context, req *accessproto.ExecuteScriptAtBlockIDRequest, ) (*accessproto.ExecuteScriptResponse, error)
ExecuteScriptAtBlockID executes a script at a specific block ID.
func (*Handler) ExecuteScriptAtLatestBlock ¶ added in v0.40.0
func (h *Handler) ExecuteScriptAtLatestBlock( ctx context.Context, req *accessproto.ExecuteScriptAtLatestBlockRequest, ) (*accessproto.ExecuteScriptResponse, error)
ExecuteScriptAtLatestBlock executes a script at a the latest block.
func (*Handler) GetAccount ¶ added in v0.40.0
func (h *Handler) GetAccount( ctx context.Context, req *accessproto.GetAccountRequest, ) (*accessproto.GetAccountResponse, error)
GetAccount returns an account by address at the latest sealed block.
func (*Handler) GetAccountAtBlockHeight ¶ added in v0.40.0
func (h *Handler) GetAccountAtBlockHeight( ctx context.Context, req *accessproto.GetAccountAtBlockHeightRequest, ) (*accessproto.AccountResponse, error)
GetAccountAtBlockHeight returns an account by address at the given block height.
func (*Handler) GetAccountAtLatestBlock ¶ added in v0.40.0
func (h *Handler) GetAccountAtLatestBlock( ctx context.Context, req *accessproto.GetAccountAtLatestBlockRequest, ) (*accessproto.AccountResponse, error)
GetAccountAtLatestBlock returns an account by address at the latest sealed block.
func (*Handler) GetAccountBalanceAtBlockHeight ¶ added in v0.40.0
func (h *Handler) GetAccountBalanceAtBlockHeight( ctx context.Context, req *accessproto.GetAccountBalanceAtBlockHeightRequest, ) (*accessproto.AccountBalanceResponse, error)
func (*Handler) GetAccountBalanceAtLatestBlock ¶ added in v0.40.0
func (h *Handler) GetAccountBalanceAtLatestBlock( ctx context.Context, req *accessproto.GetAccountBalanceAtLatestBlockRequest, ) (*accessproto.AccountBalanceResponse, error)
GetAccountBalanceAtLatestBlock returns an account balance by address at the latest sealed block.
Expected errors during normal operation: - codes.InvalidArgument - if invalid account address provided. - codes.Internal - if failed to get account from the execution node or failed to convert account message.
func (*Handler) GetAccountKeyAtBlockHeight ¶ added in v0.40.0
func (h *Handler) GetAccountKeyAtBlockHeight( ctx context.Context, req *accessproto.GetAccountKeyAtBlockHeightRequest, ) (*accessproto.AccountKeyResponse, error)
GetAccountKeyAtBlockHeight returns an account public keys by address and key index at the given block height. GetAccountKeyAtLatestBlock returns an account public key by address and key index at the latest sealed block.
Expected errors during normal operation: - codes.InvalidArgument - if invalid account address provided. - codes.Internal - if failed to get account from the execution node, ailed to convert account message or failed to encode account key.
func (*Handler) GetAccountKeyAtLatestBlock ¶ added in v0.40.0
func (h *Handler) GetAccountKeyAtLatestBlock( ctx context.Context, req *accessproto.GetAccountKeyAtLatestBlockRequest, ) (*accessproto.AccountKeyResponse, error)
GetAccountKeyAtLatestBlock returns an account public key by address and key index at the latest sealed block.
Expected errors during normal operation: - codes.InvalidArgument - if invalid account address provided. - codes.Internal - if failed to get account from the execution node, ailed to convert account message or failed to encode account key.
func (*Handler) GetAccountKeysAtBlockHeight ¶ added in v0.40.0
func (h *Handler) GetAccountKeysAtBlockHeight( ctx context.Context, req *accessproto.GetAccountKeysAtBlockHeightRequest, ) (*accessproto.AccountKeysResponse, error)
GetAccountKeysAtBlockHeight returns an account public keys by address at the given block height. GetAccountKeyAtLatestBlock returns an account public key by address and key index at the latest sealed block.
Expected errors during normal operation: - codes.InvalidArgument - if invalid account address provided. - codes.Internal - if failed to get account from the execution node, ailed to convert account message or failed to encode account key.
func (*Handler) GetAccountKeysAtLatestBlock ¶ added in v0.40.0
func (h *Handler) GetAccountKeysAtLatestBlock( ctx context.Context, req *accessproto.GetAccountKeysAtLatestBlockRequest, ) (*accessproto.AccountKeysResponse, error)
GetAccountKeysAtLatestBlock returns an account public keys by address at the latest sealed block. GetAccountKeyAtLatestBlock returns an account public key by address and key index at the latest sealed block.
Expected errors during normal operation: - codes.InvalidArgument - if invalid account address provided. - codes.Internal - if failed to get account from the execution node, ailed to convert account message or failed to encode account key.
func (*Handler) GetBlockByHeight ¶ added in v0.40.0
func (h *Handler) GetBlockByHeight( ctx context.Context, req *accessproto.GetBlockByHeightRequest, ) (*accessproto.BlockResponse, error)
GetBlockByHeight gets a block by height.
func (*Handler) GetBlockByID ¶ added in v0.40.0
func (h *Handler) GetBlockByID( ctx context.Context, req *accessproto.GetBlockByIDRequest, ) (*accessproto.BlockResponse, error)
GetBlockByID gets a block by ID.
func (*Handler) GetBlockHeaderByHeight ¶ added in v0.40.0
func (h *Handler) GetBlockHeaderByHeight( ctx context.Context, req *accessproto.GetBlockHeaderByHeightRequest, ) (*accessproto.BlockHeaderResponse, error)
GetBlockHeaderByHeight gets a block header by height.
func (*Handler) GetBlockHeaderByID ¶ added in v0.40.0
func (h *Handler) GetBlockHeaderByID( ctx context.Context, req *accessproto.GetBlockHeaderByIDRequest, ) (*accessproto.BlockHeaderResponse, error)
GetBlockHeaderByID gets a block header by ID.
func (*Handler) GetCollectionByID ¶ added in v0.40.0
func (h *Handler) GetCollectionByID( ctx context.Context, req *accessproto.GetCollectionByIDRequest, ) (*accessproto.CollectionResponse, error)
GetCollectionByID gets a collection by ID.
func (*Handler) GetEventsForBlockIDs ¶ added in v0.40.0
func (h *Handler) GetEventsForBlockIDs( ctx context.Context, req *accessproto.GetEventsForBlockIDsRequest, ) (*accessproto.EventsResponse, error)
GetEventsForBlockIDs returns events matching a set of block IDs.
func (*Handler) GetEventsForHeightRange ¶ added in v0.40.0
func (h *Handler) GetEventsForHeightRange( ctx context.Context, req *accessproto.GetEventsForHeightRangeRequest, ) (*accessproto.EventsResponse, error)
GetEventsForHeightRange returns events matching a query.
func (*Handler) GetExecutionResultByID ¶ added in v0.40.0
func (h *Handler) GetExecutionResultByID(ctx context.Context, req *accessproto.GetExecutionResultByIDRequest) (*accessproto.ExecutionResultByIDResponse, error)
GetExecutionResultByID returns the execution result for the given ID.
func (*Handler) GetExecutionResultForBlockID ¶ added in v0.40.0
func (h *Handler) GetExecutionResultForBlockID(ctx context.Context, req *accessproto.GetExecutionResultForBlockIDRequest) (*accessproto.ExecutionResultForBlockIDResponse, error)
GetExecutionResultForBlockID returns the latest received execution result for the given block ID. AN might receive multiple receipts with conflicting results for unsealed blocks. If this case happens, since AN is not able to determine which result is the correct one until the block is sealed, it has to pick one result to respond to this query. For now, we return the result from the latest received receipt.
func (*Handler) GetFullCollectionByID ¶ added in v0.40.0
func (h *Handler) GetFullCollectionByID( ctx context.Context, req *accessproto.GetFullCollectionByIDRequest, ) (*accessproto.FullCollectionResponse, error)
func (*Handler) GetLatestBlock ¶ added in v0.40.0
func (h *Handler) GetLatestBlock( ctx context.Context, req *accessproto.GetLatestBlockRequest, ) (*accessproto.BlockResponse, error)
GetLatestBlock gets the latest sealed block.
func (*Handler) GetLatestBlockHeader ¶ added in v0.40.0
func (h *Handler) GetLatestBlockHeader( ctx context.Context, req *accessproto.GetLatestBlockHeaderRequest, ) (*accessproto.BlockHeaderResponse, error)
GetLatestBlockHeader gets the latest sealed block header.
func (*Handler) GetLatestProtocolStateSnapshot ¶ added in v0.40.0
func (h *Handler) GetLatestProtocolStateSnapshot(ctx context.Context, req *accessproto.GetLatestProtocolStateSnapshotRequest) (*accessproto.ProtocolStateSnapshotResponse, error)
GetLatestProtocolStateSnapshot returns the latest serializable Snapshot
func (*Handler) GetNetworkParameters ¶ added in v0.40.0
func (h *Handler) GetNetworkParameters( ctx context.Context, _ *accessproto.GetNetworkParametersRequest, ) (*accessproto.GetNetworkParametersResponse, error)
func (*Handler) GetNodeVersionInfo ¶ added in v0.40.0
func (h *Handler) GetNodeVersionInfo( ctx context.Context, _ *accessproto.GetNodeVersionInfoRequest, ) (*accessproto.GetNodeVersionInfoResponse, error)
GetNodeVersionInfo gets node version information such as semver, commit, sporkID, protocolVersion, etc
func (*Handler) GetProtocolStateSnapshotByBlockID ¶ added in v0.40.0
func (h *Handler) GetProtocolStateSnapshotByBlockID(ctx context.Context, req *accessproto.GetProtocolStateSnapshotByBlockIDRequest) (*accessproto.ProtocolStateSnapshotResponse, error)
GetProtocolStateSnapshotByBlockID returns serializable Snapshot by blockID
func (*Handler) GetProtocolStateSnapshotByHeight ¶ added in v0.40.0
func (h *Handler) GetProtocolStateSnapshotByHeight(ctx context.Context, req *accessproto.GetProtocolStateSnapshotByHeightRequest) (*accessproto.ProtocolStateSnapshotResponse, error)
GetProtocolStateSnapshotByHeight returns serializable Snapshot by block height
func (*Handler) GetSystemTransaction ¶ added in v0.40.0
func (h *Handler) GetSystemTransaction( ctx context.Context, req *accessproto.GetSystemTransactionRequest, ) (*accessproto.TransactionResponse, error)
func (*Handler) GetSystemTransactionResult ¶ added in v0.40.0
func (h *Handler) GetSystemTransactionResult( ctx context.Context, req *accessproto.GetSystemTransactionResultRequest, ) (*accessproto.TransactionResultResponse, error)
func (*Handler) GetTransaction ¶ added in v0.40.0
func (h *Handler) GetTransaction( ctx context.Context, req *accessproto.GetTransactionRequest, ) (*accessproto.TransactionResponse, error)
GetTransaction gets a transaction by ID.
func (*Handler) GetTransactionResult ¶ added in v0.40.0
func (h *Handler) GetTransactionResult( ctx context.Context, req *accessproto.GetTransactionRequest, ) (*accessproto.TransactionResultResponse, error)
GetTransactionResult gets a transaction by ID.
func (*Handler) GetTransactionResultByIndex ¶ added in v0.40.0
func (h *Handler) GetTransactionResultByIndex( ctx context.Context, req *accessproto.GetTransactionByIndexRequest, ) (*accessproto.TransactionResultResponse, error)
GetTransactionResultByIndex gets a transaction at a specific index for in a block that is executed, pending or finalized transactions return errors
func (*Handler) GetTransactionResultsByBlockID ¶ added in v0.40.0
func (h *Handler) GetTransactionResultsByBlockID( ctx context.Context, req *accessproto.GetTransactionsByBlockIDRequest, ) (*accessproto.TransactionResultsResponse, error)
func (*Handler) GetTransactionsByBlockID ¶ added in v0.40.0
func (h *Handler) GetTransactionsByBlockID( ctx context.Context, req *accessproto.GetTransactionsByBlockIDRequest, ) (*accessproto.TransactionsResponse, error)
func (*Handler) Ping ¶ added in v0.40.0
func (h *Handler) Ping(ctx context.Context, _ *accessproto.PingRequest) (*accessproto.PingResponse, error)
Ping the Access API server for a response.
func (*Handler) SendAndSubscribeTransactionStatuses ¶ added in v0.40.0
func (h *Handler) SendAndSubscribeTransactionStatuses( request *accessproto.SendAndSubscribeTransactionStatusesRequest, stream accessproto.AccessAPI_SendAndSubscribeTransactionStatusesServer, ) error
SendAndSubscribeTransactionStatuses streams transaction statuses starting from the reference block saved in the transaction itself until the block containing the transaction becomes sealed or expired. When the transaction status becomes TransactionStatusSealed or TransactionStatusExpired, the subscription will automatically shut down.
func (*Handler) SendTransaction ¶ added in v0.40.0
func (h *Handler) SendTransaction( ctx context.Context, req *accessproto.SendTransactionRequest, ) (*accessproto.SendTransactionResponse, error)
SendTransaction submits a transaction to the network.
func (*Handler) SubscribeBlockDigestsFromLatest ¶ added in v0.40.0
func (h *Handler) SubscribeBlockDigestsFromLatest(request *accessproto.SubscribeBlockDigestsFromLatestRequest, stream accessproto.AccessAPI_SubscribeBlockDigestsFromLatestServer) error
SubscribeBlockDigestsFromLatest handles subscription requests for lightweight block started from latest sealed block. It takes a SubscribeBlockDigestsFromLatestRequest and an AccessAPI_SubscribeBlockDigestsFromLatestServer stream as input. The handler manages the subscription to block updates and sends the subscribed block header information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block to message or could not send response.
func (*Handler) SubscribeBlockDigestsFromStartBlockID ¶ added in v0.40.0
func (h *Handler) SubscribeBlockDigestsFromStartBlockID(request *accessproto.SubscribeBlockDigestsFromStartBlockIDRequest, stream accessproto.AccessAPI_SubscribeBlockDigestsFromStartBlockIDServer) error
SubscribeBlockDigestsFromStartBlockID streams finalized or sealed lightweight block starting at the requested block id. It takes a SubscribeBlockDigestsFromStartBlockIDRequest and an AccessAPI_SubscribeBlockDigestsFromStartBlockIDServer stream as input.
Expected errors during normal operation: - codes.InvalidArgument - if invalid startBlockID provided or unknown block status provided, - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block to message or could not send response.
func (*Handler) SubscribeBlockDigestsFromStartHeight ¶ added in v0.40.0
func (h *Handler) SubscribeBlockDigestsFromStartHeight(request *accessproto.SubscribeBlockDigestsFromStartHeightRequest, stream accessproto.AccessAPI_SubscribeBlockDigestsFromStartHeightServer) error
SubscribeBlockDigestsFromStartHeight handles subscription requests for lightweight blocks started from block height. It takes a SubscribeBlockDigestsFromStartHeightRequest and an AccessAPI_SubscribeBlockDigestsFromStartHeightServer stream as input. The handler manages the subscription to block updates and sends the subscribed block information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block to message or could not send response.
func (*Handler) SubscribeBlockHeadersFromLatest ¶ added in v0.40.0
func (h *Handler) SubscribeBlockHeadersFromLatest(request *accessproto.SubscribeBlockHeadersFromLatestRequest, stream accessproto.AccessAPI_SubscribeBlockHeadersFromLatestServer) error
SubscribeBlockHeadersFromLatest handles subscription requests for block headers started from latest sealed block. It takes a SubscribeBlockHeadersFromLatestRequest and an AccessAPI_SubscribeBlockHeadersFromLatestServer stream as input. The handler manages the subscription to block updates and sends the subscribed block header information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block header to message or could not send response.
func (*Handler) SubscribeBlockHeadersFromStartBlockID ¶ added in v0.40.0
func (h *Handler) SubscribeBlockHeadersFromStartBlockID(request *accessproto.SubscribeBlockHeadersFromStartBlockIDRequest, stream accessproto.AccessAPI_SubscribeBlockHeadersFromStartBlockIDServer) error
SubscribeBlockHeadersFromStartBlockID handles subscription requests for block headers started from block id. It takes a SubscribeBlockHeadersFromStartBlockIDRequest and an AccessAPI_SubscribeBlockHeadersFromStartBlockIDServer stream as input. The handler manages the subscription to block updates and sends the subscribed block header information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if invalid startBlockID provided or unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block header to message or could not send response.
func (*Handler) SubscribeBlockHeadersFromStartHeight ¶ added in v0.40.0
func (h *Handler) SubscribeBlockHeadersFromStartHeight(request *accessproto.SubscribeBlockHeadersFromStartHeightRequest, stream accessproto.AccessAPI_SubscribeBlockHeadersFromStartHeightServer) error
SubscribeBlockHeadersFromStartHeight handles subscription requests for block headers started from block height. It takes a SubscribeBlockHeadersFromStartHeightRequest and an AccessAPI_SubscribeBlockHeadersFromStartHeightServer stream as input. The handler manages the subscription to block updates and sends the subscribed block header information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block header to message or could not send response.
func (*Handler) SubscribeBlocksFromLatest ¶ added in v0.40.0
func (h *Handler) SubscribeBlocksFromLatest(request *accessproto.SubscribeBlocksFromLatestRequest, stream accessproto.AccessAPI_SubscribeBlocksFromLatestServer) error
SubscribeBlocksFromLatest handles subscription requests for blocks started from latest sealed block. It takes a SubscribeBlocksFromLatestRequest and an AccessAPI_SubscribeBlocksFromLatestServer stream as input. The handler manages the subscription to block updates and sends the subscribed block information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block to message or could not send response.
func (*Handler) SubscribeBlocksFromStartBlockID ¶ added in v0.40.0
func (h *Handler) SubscribeBlocksFromStartBlockID(request *accessproto.SubscribeBlocksFromStartBlockIDRequest, stream accessproto.AccessAPI_SubscribeBlocksFromStartBlockIDServer) error
SubscribeBlocksFromStartBlockID handles subscription requests for blocks started from block id. It takes a SubscribeBlocksFromStartBlockIDRequest and an AccessAPI_SubscribeBlocksFromStartBlockIDServer stream as input. The handler manages the subscription to block updates and sends the subscribed block information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if invalid startBlockID provided or unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block to message or could not send response.
func (*Handler) SubscribeBlocksFromStartHeight ¶ added in v0.40.0
func (h *Handler) SubscribeBlocksFromStartHeight(request *accessproto.SubscribeBlocksFromStartHeightRequest, stream accessproto.AccessAPI_SubscribeBlocksFromStartHeightServer) error
SubscribeBlocksFromStartHeight handles subscription requests for blocks started from block height. It takes a SubscribeBlocksFromStartHeightRequest and an AccessAPI_SubscribeBlocksFromStartHeightServer stream as input. The handler manages the subscription to block updates and sends the subscribed block information to the client via the provided stream.
Expected errors during normal operation: - codes.InvalidArgument - if unknown block status provided. - codes.ResourceExhausted - if the maximum number of streams is reached. - codes.Internal - if stream encountered an error, if stream got unexpected response or could not convert block to message or could not send response.
type HandlerOption ¶ added in v0.40.0
type HandlerOption func(*Handler)
HandlerOption is used to hand over optional constructor parameters
type Option ¶ added in v0.32.0
type Option func(*RPCEngineBuilder)
type RPCEngineBuilder ¶ added in v0.27.0
type RPCEngineBuilder struct { *Engine // contains filtered or unexported fields }
func NewBuilder ¶ added in v0.27.0
func NewBuilder( log zerolog.Logger, state protocol.State, config Config, chainID flow.ChainID, accessMetrics module.AccessMetrics, rpcMetricsEnabled bool, me module.Local, backend *backend.Backend, restHandler access.API, secureGrpcServer *grpcserver.GrpcServer, unsecureGrpcServer *grpcserver.GrpcServer, stateStreamBackend state_stream.API, stateStreamConfig statestreambackend.Config, indexReporter state_synchronization.IndexReporter, ) (*RPCEngineBuilder, error)
NewBuilder returns a new RPC engine builder.
func NewRPCEngineBuilder ¶ added in v0.27.0
func NewRPCEngineBuilder(engine *Engine, me module.Local, finalizedHeaderCache module.FinalizedHeaderCache, indexReporter state_synchronization.IndexReporter) *RPCEngineBuilder
NewRPCEngineBuilder helps to build a new RPC engine.
func (*RPCEngineBuilder) Build ¶ added in v0.27.0
func (builder *RPCEngineBuilder) Build() (*Engine, error)
func (*RPCEngineBuilder) DefaultHandler ¶ added in v0.33.30
func (builder *RPCEngineBuilder) DefaultHandler(signerIndicesDecoder hotstuff.BlockSignerDecoder) *Handler
func (*RPCEngineBuilder) RpcHandler ¶ added in v0.32.0
func (builder *RPCEngineBuilder) RpcHandler() accessproto.AccessAPIServer
func (*RPCEngineBuilder) WithBlockSignerDecoder ¶ added in v0.27.0
func (builder *RPCEngineBuilder) WithBlockSignerDecoder(signerIndicesDecoder hotstuff.BlockSignerDecoder) *RPCEngineBuilder
WithBlockSignerDecoder specifies that signer indices in block headers should be translated to full node IDs with the given decoder. Caution: you can inject either a `BlockSignerDecoder` (via method `WithBlockSignerDecoder`) or an `AccessAPIServer` (via method `WithNewHandler`); but not both. If both are specified, the builder will error during the build step.
Returns self-reference for chaining.
func (*RPCEngineBuilder) WithLegacy ¶ added in v0.27.0
func (builder *RPCEngineBuilder) WithLegacy() *RPCEngineBuilder
WithLegacy specifies that a legacy access API should be instantiated Returns self-reference for chaining.
func (*RPCEngineBuilder) WithMetrics ¶ added in v0.27.0
func (builder *RPCEngineBuilder) WithMetrics() *RPCEngineBuilder
WithMetrics specifies the metrics should be collected. Returns self-reference for chaining.
func (*RPCEngineBuilder) WithRpcHandler ¶ added in v0.32.0
func (builder *RPCEngineBuilder) WithRpcHandler(handler accessproto.AccessAPIServer) *RPCEngineBuilder
WithRpcHandler specifies that the given `AccessAPIServer` should be used for serving API queries. Caution: you can inject either a `BlockSignerDecoder` (via method `WithBlockSignerDecoder`) or an `AccessAPIServer` (via method `WithRpcHandler`); but not both. If both are specified, the builder will error during the build step.
Returns self-reference for chaining.