Documentation ¶
Index ¶
- func WithBlockSignerDecoder(signerIndicesDecoder hotstuff.BlockSignerDecoder) func(*Handler)
- type API
- type Handler
- func (h *Handler) GetBlockByHeight(ctx context.Context, req *access.GetBlockByHeightRequest) (*access.BlockResponse, error)
- func (h *Handler) GetBlockByID(ctx context.Context, req *access.GetBlockByIDRequest) (*access.BlockResponse, error)
- func (h *Handler) GetBlockHeaderByHeight(ctx context.Context, req *access.GetBlockHeaderByHeightRequest) (*access.BlockHeaderResponse, error)
- func (h *Handler) GetBlockHeaderByID(ctx context.Context, req *access.GetBlockHeaderByIDRequest) (*access.BlockHeaderResponse, error)
- func (h *Handler) GetLatestBlock(ctx context.Context, req *access.GetLatestBlockRequest) (*access.BlockResponse, error)
- func (h *Handler) GetLatestBlockHeader(ctx context.Context, req *access.GetLatestBlockHeaderRequest) (*access.BlockHeaderResponse, error)
- func (h *Handler) GetLatestProtocolStateSnapshot(ctx context.Context, req *access.GetLatestProtocolStateSnapshotRequest) (*access.ProtocolStateSnapshotResponse, error)
- func (h *Handler) GetNetworkParameters(ctx context.Context, _ *access.GetNetworkParametersRequest) (*access.GetNetworkParametersResponse, error)
- func (h *Handler) GetNodeVersionInfo(ctx context.Context, request *access.GetNodeVersionInfoRequest) (*access.GetNodeVersionInfoResponse, error)
- func (h *Handler) GetProtocolStateSnapshotByBlockID(ctx context.Context, req *access.GetProtocolStateSnapshotByBlockIDRequest) (*access.ProtocolStateSnapshotResponse, error)
- func (h *Handler) GetProtocolStateSnapshotByHeight(ctx context.Context, req *access.GetProtocolStateSnapshotByHeightRequest) (*access.ProtocolStateSnapshotResponse, error)
- type HandlerOption
- type NetworkAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBlockSignerDecoder ¶
func WithBlockSignerDecoder(signerIndicesDecoder hotstuff.BlockSignerDecoder) func(*Handler)
Types ¶
type API ¶
type API interface { NetworkAPI GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.Header, error) GetBlockHeaderByID(ctx context.Context, id flow.Identifier) (*flow.Header, error) GetBlockHeaderByHeight(ctx context.Context, height uint64) (*flow.Header, error) GetLatestBlock(ctx context.Context, isSealed bool) (*flow.Block, error) GetBlockByID(ctx context.Context, id flow.Identifier) (*flow.Block, error) GetBlockByHeight(ctx context.Context, height uint64) (*flow.Block, error) }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(api API, options ...HandlerOption) *Handler
func (*Handler) GetBlockByHeight ¶
func (h *Handler) GetBlockByHeight( ctx context.Context, req *access.GetBlockByHeightRequest, ) (*access.BlockResponse, error)
GetBlockByHeight gets a block by height.
func (*Handler) GetBlockByID ¶
func (h *Handler) GetBlockByID( ctx context.Context, req *access.GetBlockByIDRequest, ) (*access.BlockResponse, error)
GetBlockByID gets a block by ID.
func (*Handler) GetBlockHeaderByHeight ¶
func (h *Handler) GetBlockHeaderByHeight( ctx context.Context, req *access.GetBlockHeaderByHeightRequest, ) (*access.BlockHeaderResponse, error)
GetBlockHeaderByHeight gets a block header by height.
func (*Handler) GetBlockHeaderByID ¶
func (h *Handler) GetBlockHeaderByID( ctx context.Context, req *access.GetBlockHeaderByIDRequest, ) (*access.BlockHeaderResponse, error)
GetBlockHeaderByID gets a block header by ID.
func (*Handler) GetLatestBlock ¶
func (h *Handler) GetLatestBlock( ctx context.Context, req *access.GetLatestBlockRequest, ) (*access.BlockResponse, error)
GetLatestBlock gets the latest sealed block.
func (*Handler) GetLatestBlockHeader ¶
func (h *Handler) GetLatestBlockHeader( ctx context.Context, req *access.GetLatestBlockHeaderRequest, ) (*access.BlockHeaderResponse, error)
GetLatestBlockHeader gets the latest sealed block header.
func (*Handler) GetLatestProtocolStateSnapshot ¶
func (h *Handler) GetLatestProtocolStateSnapshot(ctx context.Context, req *access.GetLatestProtocolStateSnapshotRequest) (*access.ProtocolStateSnapshotResponse, error)
GetLatestProtocolStateSnapshot returns the latest serializable Snapshot
func (*Handler) GetNetworkParameters ¶
func (h *Handler) GetNetworkParameters( ctx context.Context, _ *access.GetNetworkParametersRequest, ) (*access.GetNetworkParametersResponse, error)
func (*Handler) GetNodeVersionInfo ¶ added in v0.31.0
func (h *Handler) GetNodeVersionInfo( ctx context.Context, request *access.GetNodeVersionInfoRequest, ) (*access.GetNodeVersionInfoResponse, error)
func (*Handler) GetProtocolStateSnapshotByBlockID ¶ added in v0.33.1
func (h *Handler) GetProtocolStateSnapshotByBlockID(ctx context.Context, req *access.GetProtocolStateSnapshotByBlockIDRequest) (*access.ProtocolStateSnapshotResponse, error)
GetProtocolStateSnapshotByBlockID returns serializable Snapshot by blockID
func (*Handler) GetProtocolStateSnapshotByHeight ¶ added in v0.33.1
func (h *Handler) GetProtocolStateSnapshotByHeight(ctx context.Context, req *access.GetProtocolStateSnapshotByHeightRequest) (*access.ProtocolStateSnapshotResponse, error)
GetProtocolStateSnapshotByHeight returns serializable Snapshot by block height
type HandlerOption ¶
type HandlerOption func(*Handler)
HandlerOption is used to hand over optional constructor parameters
type NetworkAPI ¶
type NetworkAPI interface { GetNetworkParameters(ctx context.Context) access.NetworkParameters GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error) GetProtocolStateSnapshotByBlockID(ctx context.Context, blockID flow.Identifier) ([]byte, error) GetProtocolStateSnapshotByHeight(ctx context.Context, blockHeight uint64) ([]byte, error) GetNodeVersionInfo(ctx context.Context) (*access.NodeVersionInfo, error) }
Click to show internal directories.
Click to hide internal directories.