// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 // protoc v3.20.0 // source: block_query.proto package pb import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Block struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // 区块 hash Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // 区块块高 BlockTime int64 `protobuf:"varint,3,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"` // 区块时间 ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // 所在链 ID TxsCount int64 `protobuf:"varint,5,opt,name=txsCount,proto3" json:"txsCount,omitempty"` // 区块包含的交易数量 Txs []string `protobuf:"bytes,6,rep,name=txs,proto3" json:"txs,omitempty"` // 区块交易 } func (x *Block) Reset() { *x = Block{} if protoimpl.UnsafeEnabled { mi := &file_block_query_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Block) String() string { return protoimpl.X.MessageStringOf(x) } func (*Block) ProtoMessage() {} func (x *Block) ProtoReflect() protoreflect.Message { mi := &file_block_query_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Block.ProtoReflect.Descriptor instead. func (*Block) Descriptor() ([]byte, []int) { return file_block_query_proto_rawDescGZIP(), []int{0} } func (x *Block) GetHash() string { if x != nil { return x.Hash } return "" } func (x *Block) GetHeight() int64 { if x != nil { return x.Height } return 0 } func (x *Block) GetBlockTime() int64 { if x != nil { return x.BlockTime } return 0 } func (x *Block) GetChainId() string { if x != nil { return x.ChainId } return "" } func (x *Block) GetTxsCount() int64 { if x != nil { return x.TxsCount } return 0 } func (x *Block) GetTxs() []string { if x != nil { return x.Txs } return nil } type QueryBlockReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // 查询的子链 chain-id Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` // 区块 hash Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` // 区块块高 HasTxs bool `protobuf:"varint,4,opt,name=has_txs,json=hasTxs,proto3" json:"has_txs,omitempty"` // 返回是否包含区块交易 } func (x *QueryBlockReq) Reset() { *x = QueryBlockReq{} if protoimpl.UnsafeEnabled { mi := &file_block_query_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *QueryBlockReq) String() string { return protoimpl.X.MessageStringOf(x) } func (*QueryBlockReq) ProtoMessage() {} func (x *QueryBlockReq) ProtoReflect() protoreflect.Message { mi := &file_block_query_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use QueryBlockReq.ProtoReflect.Descriptor instead. func (*QueryBlockReq) Descriptor() ([]byte, []int) { return file_block_query_proto_rawDescGZIP(), []int{1} } func (x *QueryBlockReq) GetChainId() string { if x != nil { return x.ChainId } return "" } func (x *QueryBlockReq) GetHash() string { if x != nil { return x.Hash } return "" } func (x *QueryBlockReq) GetHeight() int64 { if x != nil { return x.Height } return 0 } func (x *QueryBlockReq) GetHasTxs() bool { if x != nil { return x.HasTxs } return false } var File_block_query_proto protoreflect.FileDescriptor var file_block_query_proto_rawDesc = []byte{ 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, 0x01, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x78, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x78, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x74, 0x78, 0x73, 0x22, 0x6f, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x74, 0x78, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x68, 0x61, 0x73, 0x54, 0x78, 0x73, 0x32, 0xb4, 0x01, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_block_query_proto_rawDescOnce sync.Once file_block_query_proto_rawDescData = file_block_query_proto_rawDesc ) func file_block_query_proto_rawDescGZIP() []byte { file_block_query_proto_rawDescOnce.Do(func() { file_block_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_block_query_proto_rawDescData) }) return file_block_query_proto_rawDescData } var file_block_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_block_query_proto_goTypes = []interface{}{ (*Block)(nil), // 0: pb.Block (*QueryBlockReq)(nil), // 1: pb.QueryBlockReq (*Response)(nil), // 2: pb.Response } var file_block_query_proto_depIdxs = []int32{ 1, // 0: pb.BlockQueryService.QueryBlockByHash:input_type -> pb.QueryBlockReq 1, // 1: pb.BlockQueryService.QueryBlockByHeight:input_type -> pb.QueryBlockReq 1, // 2: pb.BlockQueryService.QueryLatestBlock:input_type -> pb.QueryBlockReq 2, // 3: pb.BlockQueryService.QueryBlockByHash:output_type -> pb.Response 2, // 4: pb.BlockQueryService.QueryBlockByHeight:output_type -> pb.Response 2, // 5: pb.BlockQueryService.QueryLatestBlock:output_type -> pb.Response 3, // [3:6] is the sub-list for method output_type 0, // [0:3] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_block_query_proto_init() } func file_block_query_proto_init() { if File_block_query_proto != nil { return } file_common_proto_init() if !protoimpl.UnsafeEnabled { file_block_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Block); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_block_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryBlockReq); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_block_query_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, GoTypes: file_block_query_proto_goTypes, DependencyIndexes: file_block_query_proto_depIdxs, MessageInfos: file_block_query_proto_msgTypes, }.Build() File_block_query_proto = out.File file_block_query_proto_rawDesc = nil file_block_query_proto_goTypes = nil file_block_query_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion6 // BlockQueryServiceClient is the client API for BlockQueryService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type BlockQueryServiceClient interface { QueryBlockByHash(ctx context.Context, in *QueryBlockReq, opts ...grpc.CallOption) (*Response, error) QueryBlockByHeight(ctx context.Context, in *QueryBlockReq, opts ...grpc.CallOption) (*Response, error) QueryLatestBlock(ctx context.Context, in *QueryBlockReq, opts ...grpc.CallOption) (*Response, error) } type blockQueryServiceClient struct { cc grpc.ClientConnInterface } func NewBlockQueryServiceClient(cc grpc.ClientConnInterface) BlockQueryServiceClient { return &blockQueryServiceClient{cc} } func (c *blockQueryServiceClient) QueryBlockByHash(ctx context.Context, in *QueryBlockReq, opts ...grpc.CallOption) (*Response, error) { out := new(Response) err := c.cc.Invoke(ctx, "/pb.BlockQueryService/QueryBlockByHash", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *blockQueryServiceClient) QueryBlockByHeight(ctx context.Context, in *QueryBlockReq, opts ...grpc.CallOption) (*Response, error) { out := new(Response) err := c.cc.Invoke(ctx, "/pb.BlockQueryService/QueryBlockByHeight", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *blockQueryServiceClient) QueryLatestBlock(ctx context.Context, in *QueryBlockReq, opts ...grpc.CallOption) (*Response, error) { out := new(Response) err := c.cc.Invoke(ctx, "/pb.BlockQueryService/QueryLatestBlock", in, out, opts...) if err != nil { return nil, err } return out, nil } // BlockQueryServiceServer is the server API for BlockQueryService service. type BlockQueryServiceServer interface { QueryBlockByHash(context.Context, *QueryBlockReq) (*Response, error) QueryBlockByHeight(context.Context, *QueryBlockReq) (*Response, error) QueryLatestBlock(context.Context, *QueryBlockReq) (*Response, error) } // UnimplementedBlockQueryServiceServer can be embedded to have forward compatible implementations. type UnimplementedBlockQueryServiceServer struct { } func (*UnimplementedBlockQueryServiceServer) QueryBlockByHash(context.Context, *QueryBlockReq) (*Response, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryBlockByHash not implemented") } func (*UnimplementedBlockQueryServiceServer) QueryBlockByHeight(context.Context, *QueryBlockReq) (*Response, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryBlockByHeight not implemented") } func (*UnimplementedBlockQueryServiceServer) QueryLatestBlock(context.Context, *QueryBlockReq) (*Response, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryLatestBlock not implemented") } func RegisterBlockQueryServiceServer(s *grpc.Server, srv BlockQueryServiceServer) { s.RegisterService(&_BlockQueryService_serviceDesc, srv) } func _BlockQueryService_QueryBlockByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryBlockReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(BlockQueryServiceServer).QueryBlockByHash(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/pb.BlockQueryService/QueryBlockByHash", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockQueryServiceServer).QueryBlockByHash(ctx, req.(*QueryBlockReq)) } return interceptor(ctx, in, info, handler) } func _BlockQueryService_QueryBlockByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryBlockReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(BlockQueryServiceServer).QueryBlockByHeight(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/pb.BlockQueryService/QueryBlockByHeight", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockQueryServiceServer).QueryBlockByHeight(ctx, req.(*QueryBlockReq)) } return interceptor(ctx, in, info, handler) } func _BlockQueryService_QueryLatestBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryBlockReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(BlockQueryServiceServer).QueryLatestBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/pb.BlockQueryService/QueryLatestBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BlockQueryServiceServer).QueryLatestBlock(ctx, req.(*QueryBlockReq)) } return interceptor(ctx, in, info, handler) } var _BlockQueryService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.BlockQueryService", HandlerType: (*BlockQueryServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "QueryBlockByHash", Handler: _BlockQueryService_QueryBlockByHash_Handler, }, { MethodName: "QueryBlockByHeight", Handler: _BlockQueryService_QueryBlockByHeight_Handler, }, { MethodName: "QueryLatestBlock", Handler: _BlockQueryService_QueryLatestBlock_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "block_query.proto", }