Documentation
¶
Index ¶
- Variables
- func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
- type APIClient
- type APIServer
- type Config
- type Index
- func (i *Index) Collection(collID flow.Identifier) (*flow.LightCollection, error)
- func (i *Index) CollectionsByHeight(height uint64) ([]flow.Identifier, error)
- func (i *Index) Commit(height uint64) (flow.StateCommitment, error)
- func (i *Index) Events(height uint64, types ...flow.EventType) ([]flow.Event, error)
- func (i *Index) First() (uint64, error)
- func (i *Index) Guarantee(collID flow.Identifier) (*flow.CollectionGuarantee, error)
- func (i *Index) Header(height uint64) (*flow.Header, error)
- func (i *Index) HeightForBlock(blockID flow.Identifier) (uint64, error)
- func (i *Index) HeightForTransaction(txID flow.Identifier) (uint64, error)
- func (i *Index) Last() (uint64, error)
- func (i *Index) Result(txID flow.Identifier) (*flow.TransactionResult, error)
- func (i *Index) Seal(sealID flow.Identifier) (*flow.Seal, error)
- func (i *Index) SealsByHeight(height uint64) ([]flow.Identifier, error)
- func (i *Index) Transaction(txID flow.Identifier) (*flow.TransactionBody, error)
- func (i *Index) TransactionsByHeight(height uint64) ([]flow.Identifier, error)
- func (i *Index) Values(height uint64, paths []ledger.Path) ([]ledger.Value, error)
- type Option
- type Server
- func (s *Server) GetCollection(ctx context.Context, req *GetCollectionRequest) (*GetCollectionResponse, error)
- func (s *Server) GetCommit(ctx context.Context, req *GetCommitRequest) (*GetCommitResponse, error)
- func (s *Server) GetEvents(ctx context.Context, req *GetEventsRequest) (*GetEventsResponse, error)
- func (s *Server) GetFirst(ctx context.Context, _ *GetFirstRequest) (*GetFirstResponse, error)
- func (s *Server) GetGuarantee(ctx context.Context, req *GetGuaranteeRequest) (*GetGuaranteeResponse, error)
- func (s *Server) GetHeader(ctx context.Context, req *GetHeaderRequest) (*GetHeaderResponse, error)
- func (s *Server) GetHeightForBlock(ctx context.Context, req *GetHeightForBlockRequest) (*GetHeightForBlockResponse, error)
- func (s *Server) GetHeightForTransaction(ctx context.Context, req *GetHeightForTransactionRequest) (*GetHeightForTransactionResponse, error)
- func (s *Server) GetLast(ctx context.Context, _ *GetLastRequest) (*GetLastResponse, error)
- func (s *Server) GetRegisterValues(ctx context.Context, req *GetRegisterValuesRequest) (*GetRegisterValuesResponse, error)
- func (s *Server) GetResult(ctx context.Context, req *GetResultRequest) (*GetResultResponse, error)
- func (s *Server) GetSeal(ctx context.Context, req *GetSealRequest) (*GetSealResponse, error)
- func (s *Server) GetTransaction(ctx context.Context, req *GetTransactionRequest) (*GetTransactionResponse, error)
- func (s *Server) ListCollectionsForHeight(ctx context.Context, req *ListCollectionsForHeightRequest) (*ListCollectionsForHeightResponse, error)
- func (s *Server) ListSealsForHeight(ctx context.Context, req *ListSealsForHeightRequest) (*ListSealsForHeightResponse, error)
- func (s *Server) ListTransactionsForHeight(ctx context.Context, req *ListTransactionsForHeightRequest) (*ListTransactionsForHeightResponse, error)
- type UnimplementedAPIServer
- func (UnimplementedAPIServer) GetCollection(context.Context, *GetCollectionRequest) (*GetCollectionResponse, error)
- func (UnimplementedAPIServer) GetCommit(context.Context, *GetCommitRequest) (*GetCommitResponse, error)
- func (UnimplementedAPIServer) GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
- func (UnimplementedAPIServer) GetFirst(context.Context, *GetFirstRequest) (*GetFirstResponse, error)
- func (UnimplementedAPIServer) GetGuarantee(context.Context, *GetGuaranteeRequest) (*GetGuaranteeResponse, error)
- func (UnimplementedAPIServer) GetHeader(context.Context, *GetHeaderRequest) (*GetHeaderResponse, error)
- func (UnimplementedAPIServer) GetHeightForBlock(context.Context, *GetHeightForBlockRequest) (*GetHeightForBlockResponse, error)
- func (UnimplementedAPIServer) GetHeightForTransaction(context.Context, *GetHeightForTransactionRequest) (*GetHeightForTransactionResponse, error)
- func (UnimplementedAPIServer) GetLast(context.Context, *GetLastRequest) (*GetLastResponse, error)
- func (UnimplementedAPIServer) GetRegisterValues(context.Context, *GetRegisterValuesRequest) (*GetRegisterValuesResponse, error)
- func (UnimplementedAPIServer) GetResult(context.Context, *GetResultRequest) (*GetResultResponse, error)
- func (UnimplementedAPIServer) GetSeal(context.Context, *GetSealRequest) (*GetSealResponse, error)
- func (UnimplementedAPIServer) GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error)
- func (UnimplementedAPIServer) ListCollectionsForHeight(context.Context, *ListCollectionsForHeightRequest) (*ListCollectionsForHeightResponse, error)
- func (UnimplementedAPIServer) ListSealsForHeight(context.Context, *ListSealsForHeightRequest) (*ListSealsForHeightResponse, error)
- func (UnimplementedAPIServer) ListTransactionsForHeight(context.Context, *ListTransactionsForHeightRequest) (*ListTransactionsForHeightResponse, error)
- type UnsafeAPIServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var API_ServiceDesc = grpc.ServiceDesc{ ServiceName: "API", HandlerType: (*APIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetFirst", Handler: _API_GetFirst_Handler, }, { MethodName: "GetLast", Handler: _API_GetLast_Handler, }, { MethodName: "GetHeightForBlock", Handler: _API_GetHeightForBlock_Handler, }, { MethodName: "GetCommit", Handler: _API_GetCommit_Handler, }, { MethodName: "GetHeader", Handler: _API_GetHeader_Handler, }, { MethodName: "GetEvents", Handler: _API_GetEvents_Handler, }, { MethodName: "GetRegisterValues", Handler: _API_GetRegisterValues_Handler, }, { MethodName: "GetCollection", Handler: _API_GetCollection_Handler, }, { MethodName: "ListCollectionsForHeight", Handler: _API_ListCollectionsForHeight_Handler, }, { MethodName: "GetGuarantee", Handler: _API_GetGuarantee_Handler, }, { MethodName: "GetTransaction", Handler: _API_GetTransaction_Handler, }, { MethodName: "GetHeightForTransaction", Handler: _API_GetHeightForTransaction_Handler, }, { MethodName: "ListTransactionsForHeight", Handler: _API_ListTransactionsForHeight_Handler, }, { MethodName: "GetResult", Handler: _API_GetResult_Handler, }, { MethodName: "GetSeal", Handler: _API_GetSeal_Handler, }, { MethodName: "ListSealsForHeight", Handler: _API_ListSealsForHeight_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", }
API_ServiceDesc is the grpc.ServiceDesc for API service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var DefaultConfig = Config{ // contains filtered or unexported fields }
Functions ¶
func RegisterAPIServer ¶
func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
Types ¶
type APIClient ¶
type APIClient interface { GetFirst(ctx context.Context, in *GetFirstRequest, opts ...grpc.CallOption) (*GetFirstResponse, error) GetLast(ctx context.Context, in *GetLastRequest, opts ...grpc.CallOption) (*GetLastResponse, error) GetHeightForBlock(ctx context.Context, in *GetHeightForBlockRequest, opts ...grpc.CallOption) (*GetHeightForBlockResponse, error) GetCommit(ctx context.Context, in *GetCommitRequest, opts ...grpc.CallOption) (*GetCommitResponse, error) GetHeader(ctx context.Context, in *GetHeaderRequest, opts ...grpc.CallOption) (*GetHeaderResponse, error) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) GetRegisterValues(ctx context.Context, in *GetRegisterValuesRequest, opts ...grpc.CallOption) (*GetRegisterValuesResponse, error) GetCollection(ctx context.Context, in *GetCollectionRequest, opts ...grpc.CallOption) (*GetCollectionResponse, error) ListCollectionsForHeight(ctx context.Context, in *ListCollectionsForHeightRequest, opts ...grpc.CallOption) (*ListCollectionsForHeightResponse, error) GetGuarantee(ctx context.Context, in *GetGuaranteeRequest, opts ...grpc.CallOption) (*GetGuaranteeResponse, error) GetTransaction(ctx context.Context, in *GetTransactionRequest, opts ...grpc.CallOption) (*GetTransactionResponse, error) GetHeightForTransaction(ctx context.Context, in *GetHeightForTransactionRequest, opts ...grpc.CallOption) (*GetHeightForTransactionResponse, error) ListTransactionsForHeight(ctx context.Context, in *ListTransactionsForHeightRequest, opts ...grpc.CallOption) (*ListTransactionsForHeightResponse, error) GetResult(ctx context.Context, in *GetResultRequest, opts ...grpc.CallOption) (*GetResultResponse, error) GetSeal(ctx context.Context, in *GetSealRequest, opts ...grpc.CallOption) (*GetSealResponse, error) ListSealsForHeight(ctx context.Context, in *ListSealsForHeightRequest, opts ...grpc.CallOption) (*ListSealsForHeightResponse, error) }
APIClient is the client API for API service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAPIClient ¶
func NewAPIClient(cc grpc.ClientConnInterface) APIClient
type APIServer ¶
type APIServer interface { GetFirst(context.Context, *GetFirstRequest) (*GetFirstResponse, error) GetLast(context.Context, *GetLastRequest) (*GetLastResponse, error) GetHeightForBlock(context.Context, *GetHeightForBlockRequest) (*GetHeightForBlockResponse, error) GetCommit(context.Context, *GetCommitRequest) (*GetCommitResponse, error) GetHeader(context.Context, *GetHeaderRequest) (*GetHeaderResponse, error) GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error) GetRegisterValues(context.Context, *GetRegisterValuesRequest) (*GetRegisterValuesResponse, error) GetCollection(context.Context, *GetCollectionRequest) (*GetCollectionResponse, error) ListCollectionsForHeight(context.Context, *ListCollectionsForHeightRequest) (*ListCollectionsForHeightResponse, error) GetGuarantee(context.Context, *GetGuaranteeRequest) (*GetGuaranteeResponse, error) GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error) GetHeightForTransaction(context.Context, *GetHeightForTransactionRequest) (*GetHeightForTransactionResponse, error) ListTransactionsForHeight(context.Context, *ListTransactionsForHeightRequest) (*ListTransactionsForHeightResponse, error) GetResult(context.Context, *GetResultRequest) (*GetResultResponse, error) GetSeal(context.Context, *GetSealRequest) (*GetSealResponse, error) ListSealsForHeight(context.Context, *ListSealsForHeightRequest) (*ListSealsForHeightResponse, error) // contains filtered or unexported methods }
APIServer is the server API for API service. All implementations must embed UnimplementedAPIServer for forward compatibility
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index implements the `index.Reader` interface on top of the DPS server's GRPC API. It can substitute for the on-disk index reader when executing scripts, such that script invoker and execution state are on two different machines across a network.
func IndexFromAPI ¶
IndexFromAPI creates a new instance of an index reader that uses the provided GRPC API client to retrieve state from the index.
func (*Index) Collection ¶
func (i *Index) Collection(collID flow.Identifier) (*flow.LightCollection, error)
Collection returns the collection with the given ID.
func (*Index) CollectionsByHeight ¶
func (i *Index) CollectionsByHeight(height uint64) ([]flow.Identifier, error)
CollectionsByHeight returns the transaction IDs within the given block.
func (*Index) Commit ¶
func (i *Index) Commit(height uint64) (flow.StateCommitment, error)
Commit returns the commitment of the execution state as it was after the execution of the finalized block at the given height.
func (*Index) Events ¶
Events returns the events of all transactions that were part of the finalized block at the given height. It can optionally filter them by event type; if no event types are given, all events are returned.
func (*Index) Guarantee ¶
func (i *Index) Guarantee(collID flow.Identifier) (*flow.CollectionGuarantee, error)
Guarantee returns the collection guarantee for the given collection ID.
func (*Index) HeightForBlock ¶
func (i *Index) HeightForBlock(blockID flow.Identifier) (uint64, error)
HeightForBlock returns the height of the given blockID.
func (*Index) HeightForTransaction ¶
func (i *Index) HeightForTransaction(txID flow.Identifier) (uint64, error)
HeightForTransaction returns the height of the given transaction ID.
func (*Index) Result ¶
func (i *Index) Result(txID flow.Identifier) (*flow.TransactionResult, error)
Result returns the result for a given transaction ID.
func (*Index) SealsByHeight ¶
func (i *Index) SealsByHeight(height uint64) ([]flow.Identifier, error)
SealsByHeight returns the seal IDs at the given height.
func (*Index) Transaction ¶
func (i *Index) Transaction(txID flow.Identifier) (*flow.TransactionBody, error)
Transaction returns the transaction with the given ID.
func (*Index) TransactionsByHeight ¶
func (i *Index) TransactionsByHeight(height uint64) ([]flow.Identifier, error)
TransactionsByHeight returns the transaction IDs within the given block.
func (*Index) Values ¶
Values returns the Ledger values of the execution state at the given paths as they were after the execution of the finalized block at the given height. For compatibility with existing Flow execution node code, a path that is not found within the indexed execution state returns a nil value without error.
type Server ¶
type Server struct { UnimplementedAPIServer // contains filtered or unexported fields }
Server is a simple implementation of the generated APIServer 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) GetCollection ¶
func (s *Server) GetCollection(ctx context.Context, req *GetCollectionRequest) (*GetCollectionResponse, error)
GetCollection implements the `GetCollection` method of the generated GRPC server.
func (*Server) GetCommit ¶
GetCommit implements the `GetCommit` method of the generated GRPC server.
func (*Server) GetEvents ¶
GetEvents implements the `GetEvents` method of the generated GRPC server.
func (*Server) GetGuarantee ¶
func (s *Server) GetGuarantee(ctx context.Context, req *GetGuaranteeRequest) (*GetGuaranteeResponse, error)
GetGuarantee implements the `GetGuarantee` method of the generated GRPC server.
func (*Server) GetHeader ¶
GetHeader implements the `GetHeader` method of the generated GRPC server.
func (*Server) GetHeightForBlock ¶
func (s *Server) GetHeightForBlock(ctx context.Context, req *GetHeightForBlockRequest) (*GetHeightForBlockResponse, error)
GetHeightForBlock implements the `GetHeightForBlock` method of the generated GRPC server.
func (*Server) GetHeightForTransaction ¶
func (s *Server) GetHeightForTransaction(ctx context.Context, req *GetHeightForTransactionRequest) (*GetHeightForTransactionResponse, error)
GetHeightForTransaction implements the `GetHeightForTransaction` method of the generated GRPC server.
func (*Server) GetRegisterValues ¶
func (s *Server) GetRegisterValues(ctx context.Context, req *GetRegisterValuesRequest) (*GetRegisterValuesResponse, error)
GetRegisterValues implements the `GetRegisterValues` method of the generated GRPC server.
func (*Server) GetResult ¶
GetResult implements the `GetResult` method of the generated GRPC server.
func (*Server) GetTransaction ¶
func (s *Server) GetTransaction(ctx context.Context, req *GetTransactionRequest) (*GetTransactionResponse, error)
GetTransaction implements the `GetTransaction` method of the generated GRPC server.
func (*Server) ListCollectionsForHeight ¶
func (s *Server) ListCollectionsForHeight(ctx context.Context, req *ListCollectionsForHeightRequest) (*ListCollectionsForHeightResponse, error)
ListCollectionsForHeight implements the `ListCollectionsForHeight` method of the generated GRPC server.
type UnimplementedAPIServer ¶
type UnimplementedAPIServer struct { }
UnimplementedAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedAPIServer) GetCollection ¶
func (UnimplementedAPIServer) GetCollection(context.Context, *GetCollectionRequest) (*GetCollectionResponse, error)
func (UnimplementedAPIServer) GetCommit ¶
func (UnimplementedAPIServer) GetCommit(context.Context, *GetCommitRequest) (*GetCommitResponse, error)
func (UnimplementedAPIServer) GetEvents ¶
func (UnimplementedAPIServer) GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
func (UnimplementedAPIServer) GetFirst ¶
func (UnimplementedAPIServer) GetFirst(context.Context, *GetFirstRequest) (*GetFirstResponse, error)
func (UnimplementedAPIServer) GetGuarantee ¶
func (UnimplementedAPIServer) GetGuarantee(context.Context, *GetGuaranteeRequest) (*GetGuaranteeResponse, error)
func (UnimplementedAPIServer) GetHeader ¶
func (UnimplementedAPIServer) GetHeader(context.Context, *GetHeaderRequest) (*GetHeaderResponse, error)
func (UnimplementedAPIServer) GetHeightForBlock ¶
func (UnimplementedAPIServer) GetHeightForBlock(context.Context, *GetHeightForBlockRequest) (*GetHeightForBlockResponse, error)
func (UnimplementedAPIServer) GetHeightForTransaction ¶
func (UnimplementedAPIServer) GetHeightForTransaction(context.Context, *GetHeightForTransactionRequest) (*GetHeightForTransactionResponse, error)
func (UnimplementedAPIServer) GetLast ¶
func (UnimplementedAPIServer) GetLast(context.Context, *GetLastRequest) (*GetLastResponse, error)
func (UnimplementedAPIServer) GetRegisterValues ¶
func (UnimplementedAPIServer) GetRegisterValues(context.Context, *GetRegisterValuesRequest) (*GetRegisterValuesResponse, error)
func (UnimplementedAPIServer) GetResult ¶
func (UnimplementedAPIServer) GetResult(context.Context, *GetResultRequest) (*GetResultResponse, error)
func (UnimplementedAPIServer) GetSeal ¶
func (UnimplementedAPIServer) GetSeal(context.Context, *GetSealRequest) (*GetSealResponse, error)
func (UnimplementedAPIServer) GetTransaction ¶
func (UnimplementedAPIServer) GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error)
func (UnimplementedAPIServer) ListCollectionsForHeight ¶
func (UnimplementedAPIServer) ListCollectionsForHeight(context.Context, *ListCollectionsForHeightRequest) (*ListCollectionsForHeightResponse, error)
func (UnimplementedAPIServer) ListSealsForHeight ¶
func (UnimplementedAPIServer) ListSealsForHeight(context.Context, *ListSealsForHeightRequest) (*ListSealsForHeightResponse, error)
func (UnimplementedAPIServer) ListTransactionsForHeight ¶
func (UnimplementedAPIServer) ListTransactionsForHeight(context.Context, *ListTransactionsForHeightRequest) (*ListTransactionsForHeightResponse, error)
type UnsafeAPIServer ¶
type UnsafeAPIServer interface {
// contains filtered or unexported methods
}
UnsafeAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to APIServer will result in compilation errors.