Documentation
¶
Index ¶
- type Invoker
- type Server
- func (s *Server) ExecuteScriptAtBlockHeight(_ context.Context, in *access.ExecuteScriptAtBlockHeightRequest) (*access.ExecuteScriptResponse, error)
- func (s *Server) ExecuteScriptAtBlockID(ctx context.Context, in *access.ExecuteScriptAtBlockIDRequest) (*access.ExecuteScriptResponse, error)
- func (s *Server) ExecuteScriptAtLatestBlock(ctx context.Context, in *access.ExecuteScriptAtLatestBlockRequest) (*access.ExecuteScriptResponse, error)
- func (s *Server) GetAccount(ctx context.Context, in *access.GetAccountRequest) (*access.GetAccountResponse, error)
- func (s *Server) GetAccountAtBlockHeight(_ context.Context, in *access.GetAccountAtBlockHeightRequest) (*access.AccountResponse, error)
- func (s *Server) GetAccountAtLatestBlock(ctx context.Context, in *access.GetAccountAtLatestBlockRequest) (*access.AccountResponse, error)
- func (s *Server) GetBlockByHeight(_ context.Context, in *access.GetBlockByHeightRequest) (*access.BlockResponse, error)
- func (s *Server) GetBlockByID(ctx context.Context, in *access.GetBlockByIDRequest) (*access.BlockResponse, error)
- func (s *Server) GetBlockHeaderByHeight(_ context.Context, in *access.GetBlockHeaderByHeightRequest) (*access.BlockHeaderResponse, error)
- func (s *Server) GetBlockHeaderByID(ctx context.Context, in *access.GetBlockHeaderByIDRequest) (*access.BlockHeaderResponse, error)
- func (s *Server) GetCollectionByID(_ context.Context, in *access.GetCollectionByIDRequest) (*access.CollectionResponse, error)
- func (s *Server) GetEventsForBlockIDs(_ context.Context, in *access.GetEventsForBlockIDsRequest) (*access.EventsResponse, error)
- func (s *Server) GetEventsForHeightRange(_ context.Context, in *access.GetEventsForHeightRangeRequest) (*access.EventsResponse, error)
- func (s *Server) GetExecutionResultForBlockID(_ context.Context, req *access.GetExecutionResultForBlockIDRequest) (*access.ExecutionResultForBlockIDResponse, error)
- func (s *Server) GetLatestBlock(ctx context.Context, in *access.GetLatestBlockRequest) (*access.BlockResponse, error)
- func (s *Server) GetLatestBlockHeader(ctx context.Context, _ *access.GetLatestBlockHeaderRequest) (*access.BlockHeaderResponse, error)
- func (s *Server) GetLatestProtocolStateSnapshot(ctx context.Context, in *access.GetLatestProtocolStateSnapshotRequest) (*access.ProtocolStateSnapshotResponse, error)
- func (s *Server) GetNetworkParameters(_ context.Context, _ *access.GetNetworkParametersRequest) (*access.GetNetworkParametersResponse, error)
- func (s *Server) GetTransaction(_ context.Context, in *access.GetTransactionRequest) (*access.TransactionResponse, error)
- func (s *Server) GetTransactionResult(_ context.Context, in *access.GetTransactionRequest) (*access.TransactionResultResponse, error)
- func (s *Server) Ping(_ context.Context, _ *access.PingRequest) (*access.PingResponse, error)
- func (s *Server) SendTransaction(ctx context.Context, in *access.SendTransactionRequest) (*access.SendTransactionResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Invoker ¶
type Invoker interface {
Account(height uint64, address flow.Address) (*flow.Account, error)
Script(height uint64, script []byte, parameters []cadence.Value) (cadence.Value, error)
}
Invoker represents something that can retrieve accounts at any given height, and execute scripts to retrieve values from the Flow Virtual Machine.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a simple implementation of the generated AccessAPIServer interface. It uses an index reader interface as the backend to retrieve the desired data. This is generally an on-disk interface, but could be a GRPC-based index as well, in which case there is a double redirection.
func NewServer ¶
NewServer creates a new server, using the provided index reader as a backend for data retrieval.
func (*Server) ExecuteScriptAtBlockHeight ¶
func (s *Server) ExecuteScriptAtBlockHeight(_ context.Context, in *access.ExecuteScriptAtBlockHeightRequest) (*access.ExecuteScriptResponse, error)
ExecuteScriptAtBlockHeight implements the ExecuteScriptAtBlockHeight endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#executescriptatblockheight
func (*Server) ExecuteScriptAtBlockID ¶
func (s *Server) ExecuteScriptAtBlockID(ctx context.Context, in *access.ExecuteScriptAtBlockIDRequest) (*access.ExecuteScriptResponse, error)
ExecuteScriptAtBlockID implements the ExecuteScriptAtBlockID endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#executescriptatblockid
func (*Server) ExecuteScriptAtLatestBlock ¶
func (s *Server) ExecuteScriptAtLatestBlock(ctx context.Context, in *access.ExecuteScriptAtLatestBlockRequest) (*access.ExecuteScriptResponse, error)
ExecuteScriptAtLatestBlock implements the ExecuteScriptAtLatestBlock endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#executescriptatlatestblock
func (*Server) GetAccount ¶
func (s *Server) GetAccount(ctx context.Context, in *access.GetAccountRequest) (*access.GetAccountResponse, error)
GetAccount implements the GetAccount endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getaccount
func (*Server) GetAccountAtBlockHeight ¶
func (s *Server) GetAccountAtBlockHeight(_ context.Context, in *access.GetAccountAtBlockHeightRequest) (*access.AccountResponse, error)
GetAccountAtBlockHeight implements the GetAccountAtBlockHeight endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getaccountatblockheight
func (*Server) GetAccountAtLatestBlock ¶
func (s *Server) GetAccountAtLatestBlock(ctx context.Context, in *access.GetAccountAtLatestBlockRequest) (*access.AccountResponse, error)
GetAccountAtLatestBlock implements the GetAccountAtLatestBlock endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getaccountatlatestblock
func (*Server) GetBlockByHeight ¶
func (s *Server) GetBlockByHeight(_ context.Context, in *access.GetBlockByHeightRequest) (*access.BlockResponse, error)
GetBlockByHeight implements the GetBlockByHeight endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getblockbyheight
func (*Server) GetBlockByID ¶
func (s *Server) GetBlockByID(ctx context.Context, in *access.GetBlockByIDRequest) (*access.BlockResponse, error)
GetBlockByID implements the GetBlockByID endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getblockbyid
func (*Server) GetBlockHeaderByHeight ¶
func (s *Server) GetBlockHeaderByHeight(_ context.Context, in *access.GetBlockHeaderByHeightRequest) (*access.BlockHeaderResponse, error)
GetBlockHeaderByHeight implements the GetBlockHeaderByHeight endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getblockheaderbyheight
func (*Server) GetBlockHeaderByID ¶
func (s *Server) GetBlockHeaderByID(ctx context.Context, in *access.GetBlockHeaderByIDRequest) (*access.BlockHeaderResponse, error)
GetBlockHeaderByID implements the GetBlockHeaderByID endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getblockheaderbyid
func (*Server) GetCollectionByID ¶
func (s *Server) GetCollectionByID(_ context.Context, in *access.GetCollectionByIDRequest) (*access.CollectionResponse, error)
GetCollectionByID implements the GetCollectionByID endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getcollectionbyid
func (*Server) GetEventsForBlockIDs ¶
func (s *Server) GetEventsForBlockIDs(_ context.Context, in *access.GetEventsForBlockIDsRequest) (*access.EventsResponse, error)
GetEventsForBlockIDs implements the GetEventsForBlockIDs endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#geteventsforblockids
func (*Server) GetEventsForHeightRange ¶
func (s *Server) GetEventsForHeightRange(_ context.Context, in *access.GetEventsForHeightRangeRequest) (*access.EventsResponse, error)
GetEventsForHeightRange implements the GetEventsForHeightRange endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#geteventsforheightrange
func (*Server) GetExecutionResultForBlockID ¶ added in v1.3.0
func (s *Server) GetExecutionResultForBlockID(_ context.Context, req *access.GetExecutionResultForBlockIDRequest) (*access.ExecutionResultForBlockIDResponse, error)
GetExecutionResultForBlockID is not implemented. See https://docs.onflow.org/access-api/#getexecutionresultforblockid
func (*Server) GetLatestBlock ¶
func (s *Server) GetLatestBlock(ctx context.Context, in *access.GetLatestBlockRequest) (*access.BlockResponse, error)
GetLatestBlock implements the GetLatestBlock endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getlatestblock
func (*Server) GetLatestBlockHeader ¶
func (s *Server) GetLatestBlockHeader(ctx context.Context, _ *access.GetLatestBlockHeaderRequest) (*access.BlockHeaderResponse, error)
GetLatestBlockHeader implements the GetLatestBlockHeader endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getlatestblockheader
func (*Server) GetLatestProtocolStateSnapshot ¶
func (s *Server) GetLatestProtocolStateSnapshot(ctx context.Context, in *access.GetLatestProtocolStateSnapshotRequest) (*access.ProtocolStateSnapshotResponse, error)
GetLatestProtocolStateSnapshot is not implemented. See https://docs.onflow.org/access-api/#getlatestprotocolstatesnapshotrequest
func (*Server) GetNetworkParameters ¶
func (s *Server) GetNetworkParameters(_ context.Context, _ *access.GetNetworkParametersRequest) (*access.GetNetworkParametersResponse, error)
GetNetworkParameters implements the GetNetworkParameters endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#getnetworkparameters
func (*Server) GetTransaction ¶
func (s *Server) GetTransaction(_ context.Context, in *access.GetTransactionRequest) (*access.TransactionResponse, error)
GetTransaction implements the GetTransaction endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#gettransaction
func (*Server) GetTransactionResult ¶
func (s *Server) GetTransactionResult(_ context.Context, in *access.GetTransactionRequest) (*access.TransactionResultResponse, error)
GetTransactionResult implements the GetTransactionResult endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#gettransactionresult
func (*Server) Ping ¶
func (s *Server) Ping(_ context.Context, _ *access.PingRequest) (*access.PingResponse, error)
Ping implements the Ping endpoint from the Flow Access API. See https://docs.onflow.org/access-api/#ping
func (*Server) SendTransaction ¶
func (s *Server) SendTransaction(ctx context.Context, in *access.SendTransactionRequest) (*access.SendTransactionResponse, error)
SendTransaction is not implemented. See https://docs.onflow.org/access-api/#sendtransaction