From 38619dfc1a9e6b68af34dc2a5a348dd9206a9045 Mon Sep 17 00:00:00 2001 From: arnaudberger Date: Tue, 13 Feb 2024 16:39:12 -0500 Subject: [PATCH] BlockByTime doc --- server/pb/sf/blockmeta/v2/blockmeta_grpc.pb.go | 6 ++++++ server/proto/sf/blockmeta/v2/blockmeta.proto | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/server/pb/sf/blockmeta/v2/blockmeta_grpc.pb.go b/server/pb/sf/blockmeta/v2/blockmeta_grpc.pb.go index 817264b..03a2300 100644 --- a/server/pb/sf/blockmeta/v2/blockmeta_grpc.pb.go +++ b/server/pb/sf/blockmeta/v2/blockmeta_grpc.pb.go @@ -178,8 +178,11 @@ var Block_ServiceDesc = grpc.ServiceDesc{ // // 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. type BlockByTimeClient interface { + // At(TimeReq): Returns the block at a specified timestamp. At(ctx context.Context, in *TimeReq, opts ...grpc.CallOption) (*BlockResp, error) + // After(RelativeTimeReq): Returns the first block after a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). After(ctx context.Context, in *RelativeTimeReq, opts ...grpc.CallOption) (*BlockResp, error) + // Before(RelativeTimeReq): Returns the last block before a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). Before(ctx context.Context, in *RelativeTimeReq, opts ...grpc.CallOption) (*BlockResp, error) } @@ -222,8 +225,11 @@ func (c *blockByTimeClient) Before(ctx context.Context, in *RelativeTimeReq, opt // All implementations should embed UnimplementedBlockByTimeServer // for forward compatibility type BlockByTimeServer interface { + // At(TimeReq): Returns the block at a specified timestamp. At(context.Context, *TimeReq) (*BlockResp, error) + // After(RelativeTimeReq): Returns the first block after a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). After(context.Context, *RelativeTimeReq) (*BlockResp, error) + // Before(RelativeTimeReq): Returns the last block before a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). Before(context.Context, *RelativeTimeReq) (*BlockResp, error) } diff --git a/server/proto/sf/blockmeta/v2/blockmeta.proto b/server/proto/sf/blockmeta/v2/blockmeta.proto index 21ca3d6..15aa2c3 100644 --- a/server/proto/sf/blockmeta/v2/blockmeta.proto +++ b/server/proto/sf/blockmeta/v2/blockmeta.proto @@ -23,15 +23,13 @@ service Block { message Empty {} +// The BlockByTime service provides capabilities to query block information based on specific timestamps. service BlockByTime { - //The BlockByTime service provides capabilities to query block information based on specific timestamps. - - //At(TimeReq): Returns the block at a specified timestamp. - //After(RelativeTimeReq): Returns the first block after a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). - //Before(RelativeTimeReq): Returns the last block before a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). - + // At(TimeReq): Returns the block at a specified timestamp. rpc At (TimeReq) returns (BlockResp); + // After(RelativeTimeReq): Returns the first block after a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). rpc After (RelativeTimeReq) returns (BlockResp); + // Before(RelativeTimeReq): Returns the last block before a specified timestamp (or the block at the specified timestamp if it exists, if the query is inclusive). rpc Before (RelativeTimeReq) returns (BlockResp); }