From abd22b937ca783eee6e0927d4715dd702fd50b4e Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Thu, 8 Aug 2024 13:07:05 +0200 Subject: [PATCH] Add account, activation, layer, network, node, reward and tx service to v2beta1 --- release/go/spacemesh/v2beta1/account.pb.go | 93 ++++ release/go/spacemesh/v2beta1/account.pb.gw.go | 164 ++++++ .../go/spacemesh/v2beta1/account_grpc.pb.go | 108 ++++ release/go/spacemesh/v2beta1/activation.pb.go | 118 ++++ .../go/spacemesh/v2beta1/activation.pb.gw.go | 349 ++++++++++++ .../spacemesh/v2beta1/activation_grpc.pb.go | 260 +++++++++ release/go/spacemesh/v2beta1/layer.pb.go | 104 ++++ release/go/spacemesh/v2beta1/layer.pb.gw.go | 272 ++++++++++ release/go/spacemesh/v2beta1/layer_grpc.pb.go | 223 ++++++++ release/go/spacemesh/v2beta1/network.pb.go | 94 ++++ release/go/spacemesh/v2beta1/network.pb.gw.go | 164 ++++++ .../go/spacemesh/v2beta1/network_grpc.pb.go | 108 ++++ release/go/spacemesh/v2beta1/node.pb.go | 93 ++++ release/go/spacemesh/v2beta1/node.pb.gw.go | 164 ++++++ release/go/spacemesh/v2beta1/node_grpc.pb.go | 108 ++++ release/go/spacemesh/v2beta1/reward.pb.go | 105 ++++ release/go/spacemesh/v2beta1/reward.pb.gw.go | 272 ++++++++++ .../go/spacemesh/v2beta1/reward_grpc.pb.go | 223 ++++++++ release/go/spacemesh/v2beta1/tx.pb.go | 138 +++++ release/go/spacemesh/v2beta1/tx.pb.gw.go | 503 ++++++++++++++++++ release/go/spacemesh/v2beta1/tx_grpc.pb.go | 334 ++++++++++++ release/openapi/swagger/src/api.swagger.json | 352 ++++++++++++ spacemesh/v2beta1/account.proto | 12 + spacemesh/v2beta1/activation.proto | 19 + spacemesh/v2beta1/layer.proto | 18 + spacemesh/v2beta1/network.proto | 12 + spacemesh/v2beta1/node.proto | 12 + spacemesh/v2beta1/reward.proto | 18 + spacemesh/v2beta1/tx.proto | 21 + 29 files changed, 4461 insertions(+) create mode 100644 release/go/spacemesh/v2beta1/account.pb.go create mode 100644 release/go/spacemesh/v2beta1/account.pb.gw.go create mode 100644 release/go/spacemesh/v2beta1/account_grpc.pb.go create mode 100644 release/go/spacemesh/v2beta1/activation.pb.go create mode 100644 release/go/spacemesh/v2beta1/activation.pb.gw.go create mode 100644 release/go/spacemesh/v2beta1/activation_grpc.pb.go create mode 100644 release/go/spacemesh/v2beta1/layer.pb.go create mode 100644 release/go/spacemesh/v2beta1/layer.pb.gw.go create mode 100644 release/go/spacemesh/v2beta1/layer_grpc.pb.go create mode 100644 release/go/spacemesh/v2beta1/network.pb.go create mode 100644 release/go/spacemesh/v2beta1/network.pb.gw.go create mode 100644 release/go/spacemesh/v2beta1/network_grpc.pb.go create mode 100644 release/go/spacemesh/v2beta1/node.pb.go create mode 100644 release/go/spacemesh/v2beta1/node.pb.gw.go create mode 100644 release/go/spacemesh/v2beta1/node_grpc.pb.go create mode 100644 release/go/spacemesh/v2beta1/reward.pb.go create mode 100644 release/go/spacemesh/v2beta1/reward.pb.gw.go create mode 100644 release/go/spacemesh/v2beta1/reward_grpc.pb.go create mode 100644 release/go/spacemesh/v2beta1/tx.pb.go create mode 100644 release/go/spacemesh/v2beta1/tx.pb.gw.go create mode 100644 release/go/spacemesh/v2beta1/tx_grpc.pb.go create mode 100644 spacemesh/v2beta1/account.proto create mode 100644 spacemesh/v2beta1/activation.proto create mode 100644 spacemesh/v2beta1/layer.proto create mode 100644 spacemesh/v2beta1/network.proto create mode 100644 spacemesh/v2beta1/node.proto create mode 100644 spacemesh/v2beta1/reward.proto create mode 100644 spacemesh/v2beta1/tx.proto diff --git a/release/go/spacemesh/v2beta1/account.pb.go b/release/go/spacemesh/v2beta1/account.pb.go new file mode 100644 index 00000000..363f5b60 --- /dev/null +++ b/release/go/spacemesh/v2beta1/account.pb.go @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2beta1/account.proto + +package spacemeshv2beta1 + +import ( + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_spacemesh_v2beta1_account_proto protoreflect.FileDescriptor + +var file_spacemesh_v2beta1_account_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x32, 0x69, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x22, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, 0x42, 0xd4, + 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x1d, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_spacemesh_v2beta1_account_proto_goTypes = []interface{}{ + (*v2alpha1.AccountRequest)(nil), // 0: spacemesh.v2alpha1.AccountRequest + (*v2alpha1.AccountList)(nil), // 1: spacemesh.v2alpha1.AccountList +} +var file_spacemesh_v2beta1_account_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.AccountService.List:input_type -> spacemesh.v2alpha1.AccountRequest + 1, // 1: spacemesh.v2beta1.AccountService.List:output_type -> spacemesh.v2alpha1.AccountList + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_spacemesh_v2beta1_account_proto_init() } +func file_spacemesh_v2beta1_account_proto_init() { + if File_spacemesh_v2beta1_account_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_account_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_spacemesh_v2beta1_account_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_account_proto_depIdxs, + }.Build() + File_spacemesh_v2beta1_account_proto = out.File + file_spacemesh_v2beta1_account_proto_rawDesc = nil + file_spacemesh_v2beta1_account_proto_goTypes = nil + file_spacemesh_v2beta1_account_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2beta1/account.pb.gw.go b/release/go/spacemesh/v2beta1/account.pb.gw.go new file mode 100644 index 00000000..46e4e8ce --- /dev/null +++ b/release/go/spacemesh/v2beta1/account.pb.gw.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2beta1/account.proto + +/* +Package spacemeshv2beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_AccountService_List_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.AccountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AccountService_List_0(ctx context.Context, marshaler runtime.Marshaler, server AccountServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.AccountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.List(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterAccountServiceHandlerServer registers the http handlers for service AccountService to "mux". +// UnaryRPC :call AccountServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAccountServiceHandlerFromEndpoint instead. +func RegisterAccountServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountServiceServer) error { + + mux.Handle("POST", pattern_AccountService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.AccountService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.AccountService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AccountService_List_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AccountService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterAccountServiceHandlerFromEndpoint is same as RegisterAccountServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAccountServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAccountServiceHandler(ctx, mux, conn) +} + +// RegisterAccountServiceHandler registers the http handlers for service AccountService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAccountServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAccountServiceHandlerClient(ctx, mux, NewAccountServiceClient(conn)) +} + +// RegisterAccountServiceHandlerClient registers the http handlers for service AccountService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccountServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccountServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AccountServiceClient" to call the correct interceptors. +func RegisterAccountServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountServiceClient) error { + + mux.Handle("POST", pattern_AccountService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.AccountService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.AccountService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AccountService_List_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_AccountService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_AccountService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.AccountService", "List"}, "")) +) + +var ( + forward_AccountService_List_0 = runtime.ForwardResponseMessage +) diff --git a/release/go/spacemesh/v2beta1/account_grpc.pb.go b/release/go/spacemesh/v2beta1/account_grpc.pb.go new file mode 100644 index 00000000..bd2e693e --- /dev/null +++ b/release/go/spacemesh/v2beta1/account_grpc.pb.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2beta1/account.proto + +package spacemeshv2beta1 + +import ( + context "context" + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AccountService_List_FullMethodName = "/spacemesh.v2beta1.AccountService/List" +) + +// AccountServiceClient is the client API for AccountService 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. +type AccountServiceClient interface { + List(ctx context.Context, in *v2alpha1.AccountRequest, opts ...grpc.CallOption) (*v2alpha1.AccountList, error) +} + +type accountServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient { + return &accountServiceClient{cc} +} + +func (c *accountServiceClient) List(ctx context.Context, in *v2alpha1.AccountRequest, opts ...grpc.CallOption) (*v2alpha1.AccountList, error) { + out := new(v2alpha1.AccountList) + err := c.cc.Invoke(ctx, AccountService_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountServiceServer is the server API for AccountService service. +// All implementations should embed UnimplementedAccountServiceServer +// for forward compatibility +type AccountServiceServer interface { + List(context.Context, *v2alpha1.AccountRequest) (*v2alpha1.AccountList, error) +} + +// UnimplementedAccountServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAccountServiceServer struct { +} + +func (UnimplementedAccountServiceServer) List(context.Context, *v2alpha1.AccountRequest) (*v2alpha1.AccountList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} + +// UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountServiceServer will +// result in compilation errors. +type UnsafeAccountServiceServer interface { + mustEmbedUnimplementedAccountServiceServer() +} + +func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) { + s.RegisterService(&AccountService_ServiceDesc, srv) +} + +func _AccountService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.AccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).List(ctx, req.(*v2alpha1.AccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AccountService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.AccountService", + HandlerType: (*AccountServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "List", + Handler: _AccountService_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2beta1/account.proto", +} diff --git a/release/go/spacemesh/v2beta1/activation.pb.go b/release/go/spacemesh/v2beta1/activation.pb.go new file mode 100644 index 00000000..7f039150 --- /dev/null +++ b/release/go/spacemesh/v2beta1/activation.pb.go @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2beta1/activation.proto + +package spacemeshv2beta1 + +import ( + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_spacemesh_v2beta1_activation_proto protoreflect.FileDescriptor + +var file_spacemesh_v2beta1_activation_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x84, 0x01, 0x0a, 0x17, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x57, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, + 0x2b, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x30, 0x01, 0x1a, 0x10, + 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, + 0x32, 0xe1, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x25, + 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x6d, 0x0a, 0x10, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, + 0x12, 0x02, 0x56, 0x32, 0x42, 0xd7, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0f, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, + 0x58, 0xaa, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_spacemesh_v2beta1_activation_proto_goTypes = []interface{}{ + (*v2alpha1.ActivationStreamRequest)(nil), // 0: spacemesh.v2alpha1.ActivationStreamRequest + (*v2alpha1.ActivationRequest)(nil), // 1: spacemesh.v2alpha1.ActivationRequest + (*v2alpha1.ActivationsCountRequest)(nil), // 2: spacemesh.v2alpha1.ActivationsCountRequest + (*v2alpha1.Activation)(nil), // 3: spacemesh.v2alpha1.Activation + (*v2alpha1.ActivationList)(nil), // 4: spacemesh.v2alpha1.ActivationList + (*v2alpha1.ActivationsCountResponse)(nil), // 5: spacemesh.v2alpha1.ActivationsCountResponse +} +var file_spacemesh_v2beta1_activation_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.ActivationStreamService.Stream:input_type -> spacemesh.v2alpha1.ActivationStreamRequest + 1, // 1: spacemesh.v2beta1.ActivationService.List:input_type -> spacemesh.v2alpha1.ActivationRequest + 2, // 2: spacemesh.v2beta1.ActivationService.ActivationsCount:input_type -> spacemesh.v2alpha1.ActivationsCountRequest + 3, // 3: spacemesh.v2beta1.ActivationStreamService.Stream:output_type -> spacemesh.v2alpha1.Activation + 4, // 4: spacemesh.v2beta1.ActivationService.List:output_type -> spacemesh.v2alpha1.ActivationList + 5, // 5: spacemesh.v2beta1.ActivationService.ActivationsCount:output_type -> spacemesh.v2alpha1.ActivationsCountResponse + 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_spacemesh_v2beta1_activation_proto_init() } +func file_spacemesh_v2beta1_activation_proto_init() { + if File_spacemesh_v2beta1_activation_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_activation_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_activation_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_activation_proto_depIdxs, + }.Build() + File_spacemesh_v2beta1_activation_proto = out.File + file_spacemesh_v2beta1_activation_proto_rawDesc = nil + file_spacemesh_v2beta1_activation_proto_goTypes = nil + file_spacemesh_v2beta1_activation_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2beta1/activation.pb.gw.go b/release/go/spacemesh/v2beta1/activation.pb.gw.go new file mode 100644 index 00000000..fd9f3741 --- /dev/null +++ b/release/go/spacemesh/v2beta1/activation.pb.gw.go @@ -0,0 +1,349 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2beta1/activation.proto + +/* +Package spacemeshv2beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ActivationStreamService_Stream_0(ctx context.Context, marshaler runtime.Marshaler, client ActivationStreamServiceClient, req *http.Request, pathParams map[string]string) (ActivationStreamService_StreamClient, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.ActivationStreamRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.Stream(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_ActivationService_List_0(ctx context.Context, marshaler runtime.Marshaler, client ActivationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.ActivationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ActivationService_List_0(ctx context.Context, marshaler runtime.Marshaler, server ActivationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.ActivationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.List(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ActivationService_ActivationsCount_0(ctx context.Context, marshaler runtime.Marshaler, client ActivationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.ActivationsCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ActivationsCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ActivationService_ActivationsCount_0(ctx context.Context, marshaler runtime.Marshaler, server ActivationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.ActivationsCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ActivationsCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterActivationStreamServiceHandlerServer registers the http handlers for service ActivationStreamService to "mux". +// UnaryRPC :call ActivationStreamServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterActivationStreamServiceHandlerFromEndpoint instead. +func RegisterActivationStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ActivationStreamServiceServer) error { + + mux.Handle("POST", pattern_ActivationStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterActivationServiceHandlerServer registers the http handlers for service ActivationService to "mux". +// UnaryRPC :call ActivationServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterActivationServiceHandlerFromEndpoint instead. +func RegisterActivationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ActivationServiceServer) error { + + mux.Handle("POST", pattern_ActivationService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.ActivationService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.ActivationService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ActivationService_List_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ActivationService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ActivationService_ActivationsCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.ActivationService/ActivationsCount", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.ActivationService/ActivationsCount")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ActivationService_ActivationsCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ActivationService_ActivationsCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterActivationStreamServiceHandlerFromEndpoint is same as RegisterActivationStreamServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterActivationStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterActivationStreamServiceHandler(ctx, mux, conn) +} + +// RegisterActivationStreamServiceHandler registers the http handlers for service ActivationStreamService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterActivationStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterActivationStreamServiceHandlerClient(ctx, mux, NewActivationStreamServiceClient(conn)) +} + +// RegisterActivationStreamServiceHandlerClient registers the http handlers for service ActivationStreamService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ActivationStreamServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ActivationStreamServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ActivationStreamServiceClient" to call the correct interceptors. +func RegisterActivationStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ActivationStreamServiceClient) error { + + mux.Handle("POST", pattern_ActivationStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.ActivationStreamService/Stream", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.ActivationStreamService/Stream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ActivationStreamService_Stream_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ActivationStreamService_Stream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ActivationStreamService_Stream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.ActivationStreamService", "Stream"}, "")) +) + +var ( + forward_ActivationStreamService_Stream_0 = runtime.ForwardResponseStream +) + +// RegisterActivationServiceHandlerFromEndpoint is same as RegisterActivationServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterActivationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterActivationServiceHandler(ctx, mux, conn) +} + +// RegisterActivationServiceHandler registers the http handlers for service ActivationService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterActivationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterActivationServiceHandlerClient(ctx, mux, NewActivationServiceClient(conn)) +} + +// RegisterActivationServiceHandlerClient registers the http handlers for service ActivationService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ActivationServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ActivationServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ActivationServiceClient" to call the correct interceptors. +func RegisterActivationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ActivationServiceClient) error { + + mux.Handle("POST", pattern_ActivationService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.ActivationService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.ActivationService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ActivationService_List_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ActivationService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ActivationService_ActivationsCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.ActivationService/ActivationsCount", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.ActivationService/ActivationsCount")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ActivationService_ActivationsCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ActivationService_ActivationsCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ActivationService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.ActivationService", "List"}, "")) + + pattern_ActivationService_ActivationsCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.ActivationService", "ActivationsCount"}, "")) +) + +var ( + forward_ActivationService_List_0 = runtime.ForwardResponseMessage + + forward_ActivationService_ActivationsCount_0 = runtime.ForwardResponseMessage +) diff --git a/release/go/spacemesh/v2beta1/activation_grpc.pb.go b/release/go/spacemesh/v2beta1/activation_grpc.pb.go new file mode 100644 index 00000000..6d46519c --- /dev/null +++ b/release/go/spacemesh/v2beta1/activation_grpc.pb.go @@ -0,0 +1,260 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2beta1/activation.proto + +package spacemeshv2beta1 + +import ( + context "context" + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ActivationStreamService_Stream_FullMethodName = "/spacemesh.v2beta1.ActivationStreamService/Stream" +) + +// ActivationStreamServiceClient is the client API for ActivationStreamService 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. +type ActivationStreamServiceClient interface { + Stream(ctx context.Context, in *v2alpha1.ActivationStreamRequest, opts ...grpc.CallOption) (ActivationStreamService_StreamClient, error) +} + +type activationStreamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewActivationStreamServiceClient(cc grpc.ClientConnInterface) ActivationStreamServiceClient { + return &activationStreamServiceClient{cc} +} + +func (c *activationStreamServiceClient) Stream(ctx context.Context, in *v2alpha1.ActivationStreamRequest, opts ...grpc.CallOption) (ActivationStreamService_StreamClient, error) { + stream, err := c.cc.NewStream(ctx, &ActivationStreamService_ServiceDesc.Streams[0], ActivationStreamService_Stream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &activationStreamServiceStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ActivationStreamService_StreamClient interface { + Recv() (*v2alpha1.Activation, error) + grpc.ClientStream +} + +type activationStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *activationStreamServiceStreamClient) Recv() (*v2alpha1.Activation, error) { + m := new(v2alpha1.Activation) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ActivationStreamServiceServer is the server API for ActivationStreamService service. +// All implementations should embed UnimplementedActivationStreamServiceServer +// for forward compatibility +type ActivationStreamServiceServer interface { + Stream(*v2alpha1.ActivationStreamRequest, ActivationStreamService_StreamServer) error +} + +// UnimplementedActivationStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedActivationStreamServiceServer struct { +} + +func (UnimplementedActivationStreamServiceServer) Stream(*v2alpha1.ActivationStreamRequest, ActivationStreamService_StreamServer) error { + return status.Errorf(codes.Unimplemented, "method Stream not implemented") +} + +// UnsafeActivationStreamServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ActivationStreamServiceServer will +// result in compilation errors. +type UnsafeActivationStreamServiceServer interface { + mustEmbedUnimplementedActivationStreamServiceServer() +} + +func RegisterActivationStreamServiceServer(s grpc.ServiceRegistrar, srv ActivationStreamServiceServer) { + s.RegisterService(&ActivationStreamService_ServiceDesc, srv) +} + +func _ActivationStreamService_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(v2alpha1.ActivationStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ActivationStreamServiceServer).Stream(m, &activationStreamServiceStreamServer{stream}) +} + +type ActivationStreamService_StreamServer interface { + Send(*v2alpha1.Activation) error + grpc.ServerStream +} + +type activationStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *activationStreamServiceStreamServer) Send(m *v2alpha1.Activation) error { + return x.ServerStream.SendMsg(m) +} + +// ActivationStreamService_ServiceDesc is the grpc.ServiceDesc for ActivationStreamService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ActivationStreamService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.ActivationStreamService", + HandlerType: (*ActivationStreamServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Stream", + Handler: _ActivationStreamService_Stream_Handler, + ServerStreams: true, + }, + }, + Metadata: "spacemesh/v2beta1/activation.proto", +} + +const ( + ActivationService_List_FullMethodName = "/spacemesh.v2beta1.ActivationService/List" + ActivationService_ActivationsCount_FullMethodName = "/spacemesh.v2beta1.ActivationService/ActivationsCount" +) + +// ActivationServiceClient is the client API for ActivationService 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. +type ActivationServiceClient interface { + List(ctx context.Context, in *v2alpha1.ActivationRequest, opts ...grpc.CallOption) (*v2alpha1.ActivationList, error) + ActivationsCount(ctx context.Context, in *v2alpha1.ActivationsCountRequest, opts ...grpc.CallOption) (*v2alpha1.ActivationsCountResponse, error) +} + +type activationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewActivationServiceClient(cc grpc.ClientConnInterface) ActivationServiceClient { + return &activationServiceClient{cc} +} + +func (c *activationServiceClient) List(ctx context.Context, in *v2alpha1.ActivationRequest, opts ...grpc.CallOption) (*v2alpha1.ActivationList, error) { + out := new(v2alpha1.ActivationList) + err := c.cc.Invoke(ctx, ActivationService_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *activationServiceClient) ActivationsCount(ctx context.Context, in *v2alpha1.ActivationsCountRequest, opts ...grpc.CallOption) (*v2alpha1.ActivationsCountResponse, error) { + out := new(v2alpha1.ActivationsCountResponse) + err := c.cc.Invoke(ctx, ActivationService_ActivationsCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ActivationServiceServer is the server API for ActivationService service. +// All implementations should embed UnimplementedActivationServiceServer +// for forward compatibility +type ActivationServiceServer interface { + List(context.Context, *v2alpha1.ActivationRequest) (*v2alpha1.ActivationList, error) + ActivationsCount(context.Context, *v2alpha1.ActivationsCountRequest) (*v2alpha1.ActivationsCountResponse, error) +} + +// UnimplementedActivationServiceServer should be embedded to have forward compatible implementations. +type UnimplementedActivationServiceServer struct { +} + +func (UnimplementedActivationServiceServer) List(context.Context, *v2alpha1.ActivationRequest) (*v2alpha1.ActivationList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedActivationServiceServer) ActivationsCount(context.Context, *v2alpha1.ActivationsCountRequest) (*v2alpha1.ActivationsCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActivationsCount not implemented") +} + +// UnsafeActivationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ActivationServiceServer will +// result in compilation errors. +type UnsafeActivationServiceServer interface { + mustEmbedUnimplementedActivationServiceServer() +} + +func RegisterActivationServiceServer(s grpc.ServiceRegistrar, srv ActivationServiceServer) { + s.RegisterService(&ActivationService_ServiceDesc, srv) +} + +func _ActivationService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.ActivationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ActivationServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ActivationService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ActivationServiceServer).List(ctx, req.(*v2alpha1.ActivationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ActivationService_ActivationsCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.ActivationsCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ActivationServiceServer).ActivationsCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ActivationService_ActivationsCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ActivationServiceServer).ActivationsCount(ctx, req.(*v2alpha1.ActivationsCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ActivationService_ServiceDesc is the grpc.ServiceDesc for ActivationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ActivationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.ActivationService", + HandlerType: (*ActivationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "List", + Handler: _ActivationService_List_Handler, + }, + { + MethodName: "ActivationsCount", + Handler: _ActivationService_ActivationsCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2beta1/activation.proto", +} diff --git a/release/go/spacemesh/v2beta1/layer.pb.go b/release/go/spacemesh/v2beta1/layer.pb.go new file mode 100644 index 00000000..6f8c8b4e --- /dev/null +++ b/release/go/spacemesh/v2beta1/layer.pb.go @@ -0,0 +1,104 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2beta1/layer.proto + +package spacemeshv2beta1 + +import ( + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_spacemesh_v2beta1_layer_proto protoreflect.FileDescriptor + +var file_spacemesh_v2beta1_layer_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, + 0x63, 0x0a, 0x0c, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x47, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x79, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x61, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, + 0x12, 0x02, 0x56, 0x32, 0x32, 0x75, 0x0a, 0x12, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x12, 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x30, 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, + 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, 0xd2, 0x01, 0x0a, 0x15, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, + 0x53, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_spacemesh_v2beta1_layer_proto_goTypes = []interface{}{ + (*v2alpha1.LayerRequest)(nil), // 0: spacemesh.v2alpha1.LayerRequest + (*v2alpha1.LayerStreamRequest)(nil), // 1: spacemesh.v2alpha1.LayerStreamRequest + (*v2alpha1.LayerList)(nil), // 2: spacemesh.v2alpha1.LayerList + (*v2alpha1.Layer)(nil), // 3: spacemesh.v2alpha1.Layer +} +var file_spacemesh_v2beta1_layer_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.LayerService.List:input_type -> spacemesh.v2alpha1.LayerRequest + 1, // 1: spacemesh.v2beta1.LayerStreamService.Stream:input_type -> spacemesh.v2alpha1.LayerStreamRequest + 2, // 2: spacemesh.v2beta1.LayerService.List:output_type -> spacemesh.v2alpha1.LayerList + 3, // 3: spacemesh.v2beta1.LayerStreamService.Stream:output_type -> spacemesh.v2alpha1.Layer + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] 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_spacemesh_v2beta1_layer_proto_init() } +func file_spacemesh_v2beta1_layer_proto_init() { + if File_spacemesh_v2beta1_layer_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_layer_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_layer_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_layer_proto_depIdxs, + }.Build() + File_spacemesh_v2beta1_layer_proto = out.File + file_spacemesh_v2beta1_layer_proto_rawDesc = nil + file_spacemesh_v2beta1_layer_proto_goTypes = nil + file_spacemesh_v2beta1_layer_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2beta1/layer.pb.gw.go b/release/go/spacemesh/v2beta1/layer.pb.gw.go new file mode 100644 index 00000000..77935731 --- /dev/null +++ b/release/go/spacemesh/v2beta1/layer.pb.gw.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2beta1/layer.proto + +/* +Package spacemeshv2beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_LayerService_List_0(ctx context.Context, marshaler runtime.Marshaler, client LayerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.LayerRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_LayerService_List_0(ctx context.Context, marshaler runtime.Marshaler, server LayerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.LayerRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.List(ctx, &protoReq) + return msg, metadata, err + +} + +func request_LayerStreamService_Stream_0(ctx context.Context, marshaler runtime.Marshaler, client LayerStreamServiceClient, req *http.Request, pathParams map[string]string) (LayerStreamService_StreamClient, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.LayerStreamRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.Stream(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterLayerServiceHandlerServer registers the http handlers for service LayerService to "mux". +// UnaryRPC :call LayerServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLayerServiceHandlerFromEndpoint instead. +func RegisterLayerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LayerServiceServer) error { + + mux.Handle("POST", pattern_LayerService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.LayerService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.LayerService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_LayerService_List_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_LayerService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterLayerStreamServiceHandlerServer registers the http handlers for service LayerStreamService to "mux". +// UnaryRPC :call LayerStreamServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLayerStreamServiceHandlerFromEndpoint instead. +func RegisterLayerStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LayerStreamServiceServer) error { + + mux.Handle("POST", pattern_LayerStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterLayerServiceHandlerFromEndpoint is same as RegisterLayerServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterLayerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterLayerServiceHandler(ctx, mux, conn) +} + +// RegisterLayerServiceHandler registers the http handlers for service LayerService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterLayerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterLayerServiceHandlerClient(ctx, mux, NewLayerServiceClient(conn)) +} + +// RegisterLayerServiceHandlerClient registers the http handlers for service LayerService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LayerServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LayerServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "LayerServiceClient" to call the correct interceptors. +func RegisterLayerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LayerServiceClient) error { + + mux.Handle("POST", pattern_LayerService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.LayerService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.LayerService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_LayerService_List_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_LayerService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_LayerService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.LayerService", "List"}, "")) +) + +var ( + forward_LayerService_List_0 = runtime.ForwardResponseMessage +) + +// RegisterLayerStreamServiceHandlerFromEndpoint is same as RegisterLayerStreamServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterLayerStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterLayerStreamServiceHandler(ctx, mux, conn) +} + +// RegisterLayerStreamServiceHandler registers the http handlers for service LayerStreamService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterLayerStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterLayerStreamServiceHandlerClient(ctx, mux, NewLayerStreamServiceClient(conn)) +} + +// RegisterLayerStreamServiceHandlerClient registers the http handlers for service LayerStreamService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LayerStreamServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LayerStreamServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "LayerStreamServiceClient" to call the correct interceptors. +func RegisterLayerStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LayerStreamServiceClient) error { + + mux.Handle("POST", pattern_LayerStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.LayerStreamService/Stream", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.LayerStreamService/Stream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_LayerStreamService_Stream_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_LayerStreamService_Stream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_LayerStreamService_Stream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.LayerStreamService", "Stream"}, "")) +) + +var ( + forward_LayerStreamService_Stream_0 = runtime.ForwardResponseStream +) diff --git a/release/go/spacemesh/v2beta1/layer_grpc.pb.go b/release/go/spacemesh/v2beta1/layer_grpc.pb.go new file mode 100644 index 00000000..c26286d8 --- /dev/null +++ b/release/go/spacemesh/v2beta1/layer_grpc.pb.go @@ -0,0 +1,223 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2beta1/layer.proto + +package spacemeshv2beta1 + +import ( + context "context" + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + LayerService_List_FullMethodName = "/spacemesh.v2beta1.LayerService/List" +) + +// LayerServiceClient is the client API for LayerService 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. +type LayerServiceClient interface { + List(ctx context.Context, in *v2alpha1.LayerRequest, opts ...grpc.CallOption) (*v2alpha1.LayerList, error) +} + +type layerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLayerServiceClient(cc grpc.ClientConnInterface) LayerServiceClient { + return &layerServiceClient{cc} +} + +func (c *layerServiceClient) List(ctx context.Context, in *v2alpha1.LayerRequest, opts ...grpc.CallOption) (*v2alpha1.LayerList, error) { + out := new(v2alpha1.LayerList) + err := c.cc.Invoke(ctx, LayerService_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LayerServiceServer is the server API for LayerService service. +// All implementations should embed UnimplementedLayerServiceServer +// for forward compatibility +type LayerServiceServer interface { + List(context.Context, *v2alpha1.LayerRequest) (*v2alpha1.LayerList, error) +} + +// UnimplementedLayerServiceServer should be embedded to have forward compatible implementations. +type UnimplementedLayerServiceServer struct { +} + +func (UnimplementedLayerServiceServer) List(context.Context, *v2alpha1.LayerRequest) (*v2alpha1.LayerList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} + +// UnsafeLayerServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LayerServiceServer will +// result in compilation errors. +type UnsafeLayerServiceServer interface { + mustEmbedUnimplementedLayerServiceServer() +} + +func RegisterLayerServiceServer(s grpc.ServiceRegistrar, srv LayerServiceServer) { + s.RegisterService(&LayerService_ServiceDesc, srv) +} + +func _LayerService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.LayerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LayerServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LayerService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LayerServiceServer).List(ctx, req.(*v2alpha1.LayerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// LayerService_ServiceDesc is the grpc.ServiceDesc for LayerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LayerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.LayerService", + HandlerType: (*LayerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "List", + Handler: _LayerService_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2beta1/layer.proto", +} + +const ( + LayerStreamService_Stream_FullMethodName = "/spacemesh.v2beta1.LayerStreamService/Stream" +) + +// LayerStreamServiceClient is the client API for LayerStreamService 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. +type LayerStreamServiceClient interface { + Stream(ctx context.Context, in *v2alpha1.LayerStreamRequest, opts ...grpc.CallOption) (LayerStreamService_StreamClient, error) +} + +type layerStreamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLayerStreamServiceClient(cc grpc.ClientConnInterface) LayerStreamServiceClient { + return &layerStreamServiceClient{cc} +} + +func (c *layerStreamServiceClient) Stream(ctx context.Context, in *v2alpha1.LayerStreamRequest, opts ...grpc.CallOption) (LayerStreamService_StreamClient, error) { + stream, err := c.cc.NewStream(ctx, &LayerStreamService_ServiceDesc.Streams[0], LayerStreamService_Stream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &layerStreamServiceStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type LayerStreamService_StreamClient interface { + Recv() (*v2alpha1.Layer, error) + grpc.ClientStream +} + +type layerStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *layerStreamServiceStreamClient) Recv() (*v2alpha1.Layer, error) { + m := new(v2alpha1.Layer) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// LayerStreamServiceServer is the server API for LayerStreamService service. +// All implementations should embed UnimplementedLayerStreamServiceServer +// for forward compatibility +type LayerStreamServiceServer interface { + Stream(*v2alpha1.LayerStreamRequest, LayerStreamService_StreamServer) error +} + +// UnimplementedLayerStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedLayerStreamServiceServer struct { +} + +func (UnimplementedLayerStreamServiceServer) Stream(*v2alpha1.LayerStreamRequest, LayerStreamService_StreamServer) error { + return status.Errorf(codes.Unimplemented, "method Stream not implemented") +} + +// UnsafeLayerStreamServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LayerStreamServiceServer will +// result in compilation errors. +type UnsafeLayerStreamServiceServer interface { + mustEmbedUnimplementedLayerStreamServiceServer() +} + +func RegisterLayerStreamServiceServer(s grpc.ServiceRegistrar, srv LayerStreamServiceServer) { + s.RegisterService(&LayerStreamService_ServiceDesc, srv) +} + +func _LayerStreamService_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(v2alpha1.LayerStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LayerStreamServiceServer).Stream(m, &layerStreamServiceStreamServer{stream}) +} + +type LayerStreamService_StreamServer interface { + Send(*v2alpha1.Layer) error + grpc.ServerStream +} + +type layerStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *layerStreamServiceStreamServer) Send(m *v2alpha1.Layer) error { + return x.ServerStream.SendMsg(m) +} + +// LayerStreamService_ServiceDesc is the grpc.ServiceDesc for LayerStreamService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LayerStreamService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.LayerStreamService", + HandlerType: (*LayerStreamServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Stream", + Handler: _LayerStreamService_Stream_Handler, + ServerStreams: true, + }, + }, + Metadata: "spacemesh/v2beta1/layer.proto", +} diff --git a/release/go/spacemesh/v2beta1/network.pb.go b/release/go/spacemesh/v2beta1/network.pb.go new file mode 100644 index 00000000..a31f6ed4 --- /dev/null +++ b/release/go/spacemesh/v2beta1/network.pb.go @@ -0,0 +1,94 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2beta1/network.proto + +package spacemeshv2beta1 + +import ( + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_spacemesh_v2beta1_network_proto protoreflect.FileDescriptor + +var file_spacemesh_v2beta1_network_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x32, 0x75, 0x0a, 0x0e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x57, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x0a, + 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, 0x42, 0xd4, 0x01, 0x0a, 0x15, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_spacemesh_v2beta1_network_proto_goTypes = []interface{}{ + (*v2alpha1.NetworkInfoRequest)(nil), // 0: spacemesh.v2alpha1.NetworkInfoRequest + (*v2alpha1.NetworkInfoResponse)(nil), // 1: spacemesh.v2alpha1.NetworkInfoResponse +} +var file_spacemesh_v2beta1_network_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.NetworkService.Info:input_type -> spacemesh.v2alpha1.NetworkInfoRequest + 1, // 1: spacemesh.v2beta1.NetworkService.Info:output_type -> spacemesh.v2alpha1.NetworkInfoResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_spacemesh_v2beta1_network_proto_init() } +func file_spacemesh_v2beta1_network_proto_init() { + if File_spacemesh_v2beta1_network_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_network_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_spacemesh_v2beta1_network_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_network_proto_depIdxs, + }.Build() + File_spacemesh_v2beta1_network_proto = out.File + file_spacemesh_v2beta1_network_proto_rawDesc = nil + file_spacemesh_v2beta1_network_proto_goTypes = nil + file_spacemesh_v2beta1_network_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2beta1/network.pb.gw.go b/release/go/spacemesh/v2beta1/network.pb.gw.go new file mode 100644 index 00000000..f0892f28 --- /dev/null +++ b/release/go/spacemesh/v2beta1/network.pb.gw.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2beta1/network.proto + +/* +Package spacemeshv2beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_NetworkService_Info_0(ctx context.Context, marshaler runtime.Marshaler, client NetworkServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.NetworkInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Info(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_NetworkService_Info_0(ctx context.Context, marshaler runtime.Marshaler, server NetworkServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.NetworkInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Info(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterNetworkServiceHandlerServer registers the http handlers for service NetworkService to "mux". +// UnaryRPC :call NetworkServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNetworkServiceHandlerFromEndpoint instead. +func RegisterNetworkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NetworkServiceServer) error { + + mux.Handle("POST", pattern_NetworkService_Info_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.NetworkService/Info", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NetworkService/Info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_NetworkService_Info_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_NetworkService_Info_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterNetworkServiceHandlerFromEndpoint is same as RegisterNetworkServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterNetworkServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterNetworkServiceHandler(ctx, mux, conn) +} + +// RegisterNetworkServiceHandler registers the http handlers for service NetworkService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterNetworkServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterNetworkServiceHandlerClient(ctx, mux, NewNetworkServiceClient(conn)) +} + +// RegisterNetworkServiceHandlerClient registers the http handlers for service NetworkService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NetworkServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NetworkServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "NetworkServiceClient" to call the correct interceptors. +func RegisterNetworkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NetworkServiceClient) error { + + mux.Handle("POST", pattern_NetworkService_Info_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.NetworkService/Info", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NetworkService/Info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_NetworkService_Info_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_NetworkService_Info_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_NetworkService_Info_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.NetworkService", "Info"}, "")) +) + +var ( + forward_NetworkService_Info_0 = runtime.ForwardResponseMessage +) diff --git a/release/go/spacemesh/v2beta1/network_grpc.pb.go b/release/go/spacemesh/v2beta1/network_grpc.pb.go new file mode 100644 index 00000000..ec438ec7 --- /dev/null +++ b/release/go/spacemesh/v2beta1/network_grpc.pb.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2beta1/network.proto + +package spacemeshv2beta1 + +import ( + context "context" + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + NetworkService_Info_FullMethodName = "/spacemesh.v2beta1.NetworkService/Info" +) + +// NetworkServiceClient is the client API for NetworkService 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. +type NetworkServiceClient interface { + Info(ctx context.Context, in *v2alpha1.NetworkInfoRequest, opts ...grpc.CallOption) (*v2alpha1.NetworkInfoResponse, error) +} + +type networkServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNetworkServiceClient(cc grpc.ClientConnInterface) NetworkServiceClient { + return &networkServiceClient{cc} +} + +func (c *networkServiceClient) Info(ctx context.Context, in *v2alpha1.NetworkInfoRequest, opts ...grpc.CallOption) (*v2alpha1.NetworkInfoResponse, error) { + out := new(v2alpha1.NetworkInfoResponse) + err := c.cc.Invoke(ctx, NetworkService_Info_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NetworkServiceServer is the server API for NetworkService service. +// All implementations should embed UnimplementedNetworkServiceServer +// for forward compatibility +type NetworkServiceServer interface { + Info(context.Context, *v2alpha1.NetworkInfoRequest) (*v2alpha1.NetworkInfoResponse, error) +} + +// UnimplementedNetworkServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNetworkServiceServer struct { +} + +func (UnimplementedNetworkServiceServer) Info(context.Context, *v2alpha1.NetworkInfoRequest) (*v2alpha1.NetworkInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +} + +// UnsafeNetworkServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NetworkServiceServer will +// result in compilation errors. +type UnsafeNetworkServiceServer interface { + mustEmbedUnimplementedNetworkServiceServer() +} + +func RegisterNetworkServiceServer(s grpc.ServiceRegistrar, srv NetworkServiceServer) { + s.RegisterService(&NetworkService_ServiceDesc, srv) +} + +func _NetworkService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.NetworkInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkServiceServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NetworkService_Info_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkServiceServer).Info(ctx, req.(*v2alpha1.NetworkInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NetworkService_ServiceDesc is the grpc.ServiceDesc for NetworkService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NetworkService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.NetworkService", + HandlerType: (*NetworkServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Info", + Handler: _NetworkService_Info_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2beta1/network.proto", +} diff --git a/release/go/spacemesh/v2beta1/node.pb.go b/release/go/spacemesh/v2beta1/node.pb.go new file mode 100644 index 00000000..e9f439f5 --- /dev/null +++ b/release/go/spacemesh/v2beta1/node.pb.go @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2beta1/node.proto + +package spacemeshv2beta1 + +import ( + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_spacemesh_v2beta1_node_proto protoreflect.FileDescriptor + +var file_spacemesh_v2beta1_node_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x72, 0x0a, + 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x57, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, + 0x32, 0x42, 0xd1, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x09, 0x4e, 0x6f, 0x64, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x1d, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_spacemesh_v2beta1_node_proto_goTypes = []interface{}{ + (*v2alpha1.NodeStatusRequest)(nil), // 0: spacemesh.v2alpha1.NodeStatusRequest + (*v2alpha1.NodeStatusResponse)(nil), // 1: spacemesh.v2alpha1.NodeStatusResponse +} +var file_spacemesh_v2beta1_node_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.NodeService.Status:input_type -> spacemesh.v2alpha1.NodeStatusRequest + 1, // 1: spacemesh.v2beta1.NodeService.Status:output_type -> spacemesh.v2alpha1.NodeStatusResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_spacemesh_v2beta1_node_proto_init() } +func file_spacemesh_v2beta1_node_proto_init() { + if File_spacemesh_v2beta1_node_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_node_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_spacemesh_v2beta1_node_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_node_proto_depIdxs, + }.Build() + File_spacemesh_v2beta1_node_proto = out.File + file_spacemesh_v2beta1_node_proto_rawDesc = nil + file_spacemesh_v2beta1_node_proto_goTypes = nil + file_spacemesh_v2beta1_node_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2beta1/node.pb.gw.go b/release/go/spacemesh/v2beta1/node.pb.gw.go new file mode 100644 index 00000000..300c56d3 --- /dev/null +++ b/release/go/spacemesh/v2beta1/node.pb.gw.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2beta1/node.proto + +/* +Package spacemeshv2beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_NodeService_Status_0(ctx context.Context, marshaler runtime.Marshaler, client NodeServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.NodeStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_NodeService_Status_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.NodeStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Status(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterNodeServiceHandlerServer registers the http handlers for service NodeService to "mux". +// UnaryRPC :call NodeServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodeServiceHandlerFromEndpoint instead. +func RegisterNodeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeServiceServer) error { + + mux.Handle("POST", pattern_NodeService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.NodeService/Status", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NodeService/Status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_NodeService_Status_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_NodeService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterNodeServiceHandlerFromEndpoint is same as RegisterNodeServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterNodeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterNodeServiceHandler(ctx, mux, conn) +} + +// RegisterNodeServiceHandler registers the http handlers for service NodeService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterNodeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterNodeServiceHandlerClient(ctx, mux, NewNodeServiceClient(conn)) +} + +// RegisterNodeServiceHandlerClient registers the http handlers for service NodeService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "NodeServiceClient" to call the correct interceptors. +func RegisterNodeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeServiceClient) error { + + mux.Handle("POST", pattern_NodeService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.NodeService/Status", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.NodeService/Status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_NodeService_Status_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_NodeService_Status_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_NodeService_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.NodeService", "Status"}, "")) +) + +var ( + forward_NodeService_Status_0 = runtime.ForwardResponseMessage +) diff --git a/release/go/spacemesh/v2beta1/node_grpc.pb.go b/release/go/spacemesh/v2beta1/node_grpc.pb.go new file mode 100644 index 00000000..bc861155 --- /dev/null +++ b/release/go/spacemesh/v2beta1/node_grpc.pb.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2beta1/node.proto + +package spacemeshv2beta1 + +import ( + context "context" + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + NodeService_Status_FullMethodName = "/spacemesh.v2beta1.NodeService/Status" +) + +// NodeServiceClient is the client API for NodeService 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. +type NodeServiceClient interface { + Status(ctx context.Context, in *v2alpha1.NodeStatusRequest, opts ...grpc.CallOption) (*v2alpha1.NodeStatusResponse, error) +} + +type nodeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient { + return &nodeServiceClient{cc} +} + +func (c *nodeServiceClient) Status(ctx context.Context, in *v2alpha1.NodeStatusRequest, opts ...grpc.CallOption) (*v2alpha1.NodeStatusResponse, error) { + out := new(v2alpha1.NodeStatusResponse) + err := c.cc.Invoke(ctx, NodeService_Status_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NodeServiceServer is the server API for NodeService service. +// All implementations should embed UnimplementedNodeServiceServer +// for forward compatibility +type NodeServiceServer interface { + Status(context.Context, *v2alpha1.NodeStatusRequest) (*v2alpha1.NodeStatusResponse, error) +} + +// UnimplementedNodeServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNodeServiceServer struct { +} + +func (UnimplementedNodeServiceServer) Status(context.Context, *v2alpha1.NodeStatusRequest) (*v2alpha1.NodeStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} + +// UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NodeServiceServer will +// result in compilation errors. +type UnsafeNodeServiceServer interface { + mustEmbedUnimplementedNodeServiceServer() +} + +func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) { + s.RegisterService(&NodeService_ServiceDesc, srv) +} + +func _NodeService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.NodeStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_Status_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).Status(ctx, req.(*v2alpha1.NodeStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NodeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.NodeService", + HandlerType: (*NodeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Status", + Handler: _NodeService_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2beta1/node.proto", +} diff --git a/release/go/spacemesh/v2beta1/reward.pb.go b/release/go/spacemesh/v2beta1/reward.pb.go new file mode 100644 index 00000000..e98c6742 --- /dev/null +++ b/release/go/spacemesh/v2beta1/reward.pb.go @@ -0,0 +1,105 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2beta1/reward.proto + +package spacemeshv2beta1 + +import ( + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_spacemesh_v2beta1_reward_proto protoreflect.FileDescriptor + +var file_spacemesh_v2beta1_reward_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x11, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0x66, 0x0a, 0x0d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x49, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0a, 0xfa, + 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, 0x32, 0x78, 0x0a, 0x13, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x4f, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x30, + 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, + 0x4e, 0x41, 0x4c, 0x42, 0xd3, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, + 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xca, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var file_spacemesh_v2beta1_reward_proto_goTypes = []interface{}{ + (*v2alpha1.RewardRequest)(nil), // 0: spacemesh.v2alpha1.RewardRequest + (*v2alpha1.RewardStreamRequest)(nil), // 1: spacemesh.v2alpha1.RewardStreamRequest + (*v2alpha1.RewardList)(nil), // 2: spacemesh.v2alpha1.RewardList + (*v2alpha1.Reward)(nil), // 3: spacemesh.v2alpha1.Reward +} +var file_spacemesh_v2beta1_reward_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.RewardService.List:input_type -> spacemesh.v2alpha1.RewardRequest + 1, // 1: spacemesh.v2beta1.RewardStreamService.Stream:input_type -> spacemesh.v2alpha1.RewardStreamRequest + 2, // 2: spacemesh.v2beta1.RewardService.List:output_type -> spacemesh.v2alpha1.RewardList + 3, // 3: spacemesh.v2beta1.RewardStreamService.Stream:output_type -> spacemesh.v2alpha1.Reward + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] 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_spacemesh_v2beta1_reward_proto_init() } +func file_spacemesh_v2beta1_reward_proto_init() { + if File_spacemesh_v2beta1_reward_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_reward_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_reward_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_reward_proto_depIdxs, + }.Build() + File_spacemesh_v2beta1_reward_proto = out.File + file_spacemesh_v2beta1_reward_proto_rawDesc = nil + file_spacemesh_v2beta1_reward_proto_goTypes = nil + file_spacemesh_v2beta1_reward_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2beta1/reward.pb.gw.go b/release/go/spacemesh/v2beta1/reward.pb.gw.go new file mode 100644 index 00000000..cd788484 --- /dev/null +++ b/release/go/spacemesh/v2beta1/reward.pb.gw.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2beta1/reward.proto + +/* +Package spacemeshv2beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_RewardService_List_0(ctx context.Context, marshaler runtime.Marshaler, client RewardServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.RewardRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RewardService_List_0(ctx context.Context, marshaler runtime.Marshaler, server RewardServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.RewardRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.List(ctx, &protoReq) + return msg, metadata, err + +} + +func request_RewardStreamService_Stream_0(ctx context.Context, marshaler runtime.Marshaler, client RewardStreamServiceClient, req *http.Request, pathParams map[string]string) (RewardStreamService_StreamClient, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.RewardStreamRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.Stream(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterRewardServiceHandlerServer registers the http handlers for service RewardService to "mux". +// UnaryRPC :call RewardServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRewardServiceHandlerFromEndpoint instead. +func RegisterRewardServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RewardServiceServer) error { + + mux.Handle("POST", pattern_RewardService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.RewardService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.RewardService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RewardService_List_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RewardService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterRewardStreamServiceHandlerServer registers the http handlers for service RewardStreamService to "mux". +// UnaryRPC :call RewardStreamServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRewardStreamServiceHandlerFromEndpoint instead. +func RegisterRewardStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RewardStreamServiceServer) error { + + mux.Handle("POST", pattern_RewardStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterRewardServiceHandlerFromEndpoint is same as RegisterRewardServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRewardServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRewardServiceHandler(ctx, mux, conn) +} + +// RegisterRewardServiceHandler registers the http handlers for service RewardService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRewardServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterRewardServiceHandlerClient(ctx, mux, NewRewardServiceClient(conn)) +} + +// RegisterRewardServiceHandlerClient registers the http handlers for service RewardService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RewardServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RewardServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "RewardServiceClient" to call the correct interceptors. +func RegisterRewardServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RewardServiceClient) error { + + mux.Handle("POST", pattern_RewardService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.RewardService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.RewardService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RewardService_List_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RewardService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_RewardService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.RewardService", "List"}, "")) +) + +var ( + forward_RewardService_List_0 = runtime.ForwardResponseMessage +) + +// RegisterRewardStreamServiceHandlerFromEndpoint is same as RegisterRewardStreamServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRewardStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRewardStreamServiceHandler(ctx, mux, conn) +} + +// RegisterRewardStreamServiceHandler registers the http handlers for service RewardStreamService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRewardStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterRewardStreamServiceHandlerClient(ctx, mux, NewRewardStreamServiceClient(conn)) +} + +// RegisterRewardStreamServiceHandlerClient registers the http handlers for service RewardStreamService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RewardStreamServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RewardStreamServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "RewardStreamServiceClient" to call the correct interceptors. +func RegisterRewardStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RewardStreamServiceClient) error { + + mux.Handle("POST", pattern_RewardStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.RewardStreamService/Stream", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.RewardStreamService/Stream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RewardStreamService_Stream_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RewardStreamService_Stream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_RewardStreamService_Stream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.RewardStreamService", "Stream"}, "")) +) + +var ( + forward_RewardStreamService_Stream_0 = runtime.ForwardResponseStream +) diff --git a/release/go/spacemesh/v2beta1/reward_grpc.pb.go b/release/go/spacemesh/v2beta1/reward_grpc.pb.go new file mode 100644 index 00000000..ad03fb88 --- /dev/null +++ b/release/go/spacemesh/v2beta1/reward_grpc.pb.go @@ -0,0 +1,223 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2beta1/reward.proto + +package spacemeshv2beta1 + +import ( + context "context" + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + RewardService_List_FullMethodName = "/spacemesh.v2beta1.RewardService/List" +) + +// RewardServiceClient is the client API for RewardService 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. +type RewardServiceClient interface { + List(ctx context.Context, in *v2alpha1.RewardRequest, opts ...grpc.CallOption) (*v2alpha1.RewardList, error) +} + +type rewardServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRewardServiceClient(cc grpc.ClientConnInterface) RewardServiceClient { + return &rewardServiceClient{cc} +} + +func (c *rewardServiceClient) List(ctx context.Context, in *v2alpha1.RewardRequest, opts ...grpc.CallOption) (*v2alpha1.RewardList, error) { + out := new(v2alpha1.RewardList) + err := c.cc.Invoke(ctx, RewardService_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RewardServiceServer is the server API for RewardService service. +// All implementations should embed UnimplementedRewardServiceServer +// for forward compatibility +type RewardServiceServer interface { + List(context.Context, *v2alpha1.RewardRequest) (*v2alpha1.RewardList, error) +} + +// UnimplementedRewardServiceServer should be embedded to have forward compatible implementations. +type UnimplementedRewardServiceServer struct { +} + +func (UnimplementedRewardServiceServer) List(context.Context, *v2alpha1.RewardRequest) (*v2alpha1.RewardList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} + +// UnsafeRewardServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RewardServiceServer will +// result in compilation errors. +type UnsafeRewardServiceServer interface { + mustEmbedUnimplementedRewardServiceServer() +} + +func RegisterRewardServiceServer(s grpc.ServiceRegistrar, srv RewardServiceServer) { + s.RegisterService(&RewardService_ServiceDesc, srv) +} + +func _RewardService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.RewardRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RewardServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RewardService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RewardServiceServer).List(ctx, req.(*v2alpha1.RewardRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RewardService_ServiceDesc is the grpc.ServiceDesc for RewardService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RewardService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.RewardService", + HandlerType: (*RewardServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "List", + Handler: _RewardService_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2beta1/reward.proto", +} + +const ( + RewardStreamService_Stream_FullMethodName = "/spacemesh.v2beta1.RewardStreamService/Stream" +) + +// RewardStreamServiceClient is the client API for RewardStreamService 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. +type RewardStreamServiceClient interface { + Stream(ctx context.Context, in *v2alpha1.RewardStreamRequest, opts ...grpc.CallOption) (RewardStreamService_StreamClient, error) +} + +type rewardStreamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRewardStreamServiceClient(cc grpc.ClientConnInterface) RewardStreamServiceClient { + return &rewardStreamServiceClient{cc} +} + +func (c *rewardStreamServiceClient) Stream(ctx context.Context, in *v2alpha1.RewardStreamRequest, opts ...grpc.CallOption) (RewardStreamService_StreamClient, error) { + stream, err := c.cc.NewStream(ctx, &RewardStreamService_ServiceDesc.Streams[0], RewardStreamService_Stream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &rewardStreamServiceStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type RewardStreamService_StreamClient interface { + Recv() (*v2alpha1.Reward, error) + grpc.ClientStream +} + +type rewardStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *rewardStreamServiceStreamClient) Recv() (*v2alpha1.Reward, error) { + m := new(v2alpha1.Reward) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// RewardStreamServiceServer is the server API for RewardStreamService service. +// All implementations should embed UnimplementedRewardStreamServiceServer +// for forward compatibility +type RewardStreamServiceServer interface { + Stream(*v2alpha1.RewardStreamRequest, RewardStreamService_StreamServer) error +} + +// UnimplementedRewardStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedRewardStreamServiceServer struct { +} + +func (UnimplementedRewardStreamServiceServer) Stream(*v2alpha1.RewardStreamRequest, RewardStreamService_StreamServer) error { + return status.Errorf(codes.Unimplemented, "method Stream not implemented") +} + +// UnsafeRewardStreamServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RewardStreamServiceServer will +// result in compilation errors. +type UnsafeRewardStreamServiceServer interface { + mustEmbedUnimplementedRewardStreamServiceServer() +} + +func RegisterRewardStreamServiceServer(s grpc.ServiceRegistrar, srv RewardStreamServiceServer) { + s.RegisterService(&RewardStreamService_ServiceDesc, srv) +} + +func _RewardStreamService_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(v2alpha1.RewardStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RewardStreamServiceServer).Stream(m, &rewardStreamServiceStreamServer{stream}) +} + +type RewardStreamService_StreamServer interface { + Send(*v2alpha1.Reward) error + grpc.ServerStream +} + +type rewardStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *rewardStreamServiceStreamServer) Send(m *v2alpha1.Reward) error { + return x.ServerStream.SendMsg(m) +} + +// RewardStreamService_ServiceDesc is the grpc.ServiceDesc for RewardStreamService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RewardStreamService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.RewardStreamService", + HandlerType: (*RewardStreamServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Stream", + Handler: _RewardStreamService_Stream_Handler, + ServerStreams: true, + }, + }, + Metadata: "spacemesh/v2beta1/reward.proto", +} diff --git a/release/go/spacemesh/v2beta1/tx.pb.go b/release/go/spacemesh/v2beta1/tx.pb.go new file mode 100644 index 00000000..e11918b6 --- /dev/null +++ b/release/go/spacemesh/v2beta1/tx.pb.go @@ -0,0 +1,138 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2beta1/tx.proto + +package spacemeshv2beta1 + +import ( + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_spacemesh_v2beta1_tx_proto protoreflect.FileDescriptor + +var file_spacemesh_v2beta1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, + 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x8f, 0x01, 0x0a, 0x18, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x12, 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, + 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x32, 0xb6, 0x03, 0x0a, 0x12, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x6d, 0x0a, 0x10, 0x50, 0x61, 0x72, 0x73, 0x65, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x72, 0x73, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x70, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x0b, 0x45, 0x73, 0x74, 0x69, + 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x12, 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x27, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, + 0x12, 0x02, 0x56, 0x32, 0x42, 0xcf, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, + 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, + 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, + 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, + 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xe2, 0x02, 0x1d, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, + 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_spacemesh_v2beta1_tx_proto_goTypes = []interface{}{ + (*v2alpha1.TransactionStreamRequest)(nil), // 0: spacemesh.v2alpha1.TransactionStreamRequest + (*v2alpha1.TransactionRequest)(nil), // 1: spacemesh.v2alpha1.TransactionRequest + (*v2alpha1.ParseTransactionRequest)(nil), // 2: spacemesh.v2alpha1.ParseTransactionRequest + (*v2alpha1.SubmitTransactionRequest)(nil), // 3: spacemesh.v2alpha1.SubmitTransactionRequest + (*v2alpha1.EstimateGasRequest)(nil), // 4: spacemesh.v2alpha1.EstimateGasRequest + (*v2alpha1.TransactionResponse)(nil), // 5: spacemesh.v2alpha1.TransactionResponse + (*v2alpha1.TransactionList)(nil), // 6: spacemesh.v2alpha1.TransactionList + (*v2alpha1.ParseTransactionResponse)(nil), // 7: spacemesh.v2alpha1.ParseTransactionResponse + (*v2alpha1.SubmitTransactionResponse)(nil), // 8: spacemesh.v2alpha1.SubmitTransactionResponse + (*v2alpha1.EstimateGasResponse)(nil), // 9: spacemesh.v2alpha1.EstimateGasResponse +} +var file_spacemesh_v2beta1_tx_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.TransactionStreamService.Stream:input_type -> spacemesh.v2alpha1.TransactionStreamRequest + 1, // 1: spacemesh.v2beta1.TransactionService.List:input_type -> spacemesh.v2alpha1.TransactionRequest + 2, // 2: spacemesh.v2beta1.TransactionService.ParseTransaction:input_type -> spacemesh.v2alpha1.ParseTransactionRequest + 3, // 3: spacemesh.v2beta1.TransactionService.SubmitTransaction:input_type -> spacemesh.v2alpha1.SubmitTransactionRequest + 4, // 4: spacemesh.v2beta1.TransactionService.EstimateGas:input_type -> spacemesh.v2alpha1.EstimateGasRequest + 5, // 5: spacemesh.v2beta1.TransactionStreamService.Stream:output_type -> spacemesh.v2alpha1.TransactionResponse + 6, // 6: spacemesh.v2beta1.TransactionService.List:output_type -> spacemesh.v2alpha1.TransactionList + 7, // 7: spacemesh.v2beta1.TransactionService.ParseTransaction:output_type -> spacemesh.v2alpha1.ParseTransactionResponse + 8, // 8: spacemesh.v2beta1.TransactionService.SubmitTransaction:output_type -> spacemesh.v2alpha1.SubmitTransactionResponse + 9, // 9: spacemesh.v2beta1.TransactionService.EstimateGas:output_type -> spacemesh.v2alpha1.EstimateGasResponse + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] 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_spacemesh_v2beta1_tx_proto_init() } +func file_spacemesh_v2beta1_tx_proto_init() { + if File_spacemesh_v2beta1_tx_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_tx_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_tx_proto_depIdxs, + }.Build() + File_spacemesh_v2beta1_tx_proto = out.File + file_spacemesh_v2beta1_tx_proto_rawDesc = nil + file_spacemesh_v2beta1_tx_proto_goTypes = nil + file_spacemesh_v2beta1_tx_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2beta1/tx.pb.gw.go b/release/go/spacemesh/v2beta1/tx.pb.gw.go new file mode 100644 index 00000000..3e3a5c75 --- /dev/null +++ b/release/go/spacemesh/v2beta1/tx.pb.gw.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2beta1/tx.proto + +/* +Package spacemeshv2beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_TransactionStreamService_Stream_0(ctx context.Context, marshaler runtime.Marshaler, client TransactionStreamServiceClient, req *http.Request, pathParams map[string]string) (TransactionStreamService_StreamClient, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.TransactionStreamRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.Stream(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_TransactionService_List_0(ctx context.Context, marshaler runtime.Marshaler, client TransactionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.TransactionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TransactionService_List_0(ctx context.Context, marshaler runtime.Marshaler, server TransactionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.TransactionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.List(ctx, &protoReq) + return msg, metadata, err + +} + +func request_TransactionService_ParseTransaction_0(ctx context.Context, marshaler runtime.Marshaler, client TransactionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.ParseTransactionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParseTransaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TransactionService_ParseTransaction_0(ctx context.Context, marshaler runtime.Marshaler, server TransactionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.ParseTransactionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParseTransaction(ctx, &protoReq) + return msg, metadata, err + +} + +func request_TransactionService_SubmitTransaction_0(ctx context.Context, marshaler runtime.Marshaler, client TransactionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.SubmitTransactionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SubmitTransaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TransactionService_SubmitTransaction_0(ctx context.Context, marshaler runtime.Marshaler, server TransactionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.SubmitTransactionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SubmitTransaction(ctx, &protoReq) + return msg, metadata, err + +} + +func request_TransactionService_EstimateGas_0(ctx context.Context, marshaler runtime.Marshaler, client TransactionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.EstimateGasRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.EstimateGas(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TransactionService_EstimateGas_0(ctx context.Context, marshaler runtime.Marshaler, server TransactionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq spacemeshv2alpha1.EstimateGasRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.EstimateGas(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterTransactionStreamServiceHandlerServer registers the http handlers for service TransactionStreamService to "mux". +// UnaryRPC :call TransactionStreamServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTransactionStreamServiceHandlerFromEndpoint instead. +func RegisterTransactionStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TransactionStreamServiceServer) error { + + mux.Handle("POST", pattern_TransactionStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterTransactionServiceHandlerServer registers the http handlers for service TransactionService to "mux". +// UnaryRPC :call TransactionServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTransactionServiceHandlerFromEndpoint instead. +func RegisterTransactionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TransactionServiceServer) error { + + mux.Handle("POST", pattern_TransactionService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TransactionService_List_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_TransactionService_ParseTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/ParseTransaction", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/ParseTransaction")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TransactionService_ParseTransaction_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_ParseTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_TransactionService_SubmitTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/SubmitTransaction", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/SubmitTransaction")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TransactionService_SubmitTransaction_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_SubmitTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_TransactionService_EstimateGas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/EstimateGas", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/EstimateGas")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TransactionService_EstimateGas_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_EstimateGas_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterTransactionStreamServiceHandlerFromEndpoint is same as RegisterTransactionStreamServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterTransactionStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterTransactionStreamServiceHandler(ctx, mux, conn) +} + +// RegisterTransactionStreamServiceHandler registers the http handlers for service TransactionStreamService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterTransactionStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterTransactionStreamServiceHandlerClient(ctx, mux, NewTransactionStreamServiceClient(conn)) +} + +// RegisterTransactionStreamServiceHandlerClient registers the http handlers for service TransactionStreamService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TransactionStreamServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TransactionStreamServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "TransactionStreamServiceClient" to call the correct interceptors. +func RegisterTransactionStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TransactionStreamServiceClient) error { + + mux.Handle("POST", pattern_TransactionStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionStreamService/Stream", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionStreamService/Stream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TransactionStreamService_Stream_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionStreamService_Stream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_TransactionStreamService_Stream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.TransactionStreamService", "Stream"}, "")) +) + +var ( + forward_TransactionStreamService_Stream_0 = runtime.ForwardResponseStream +) + +// RegisterTransactionServiceHandlerFromEndpoint is same as RegisterTransactionServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterTransactionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterTransactionServiceHandler(ctx, mux, conn) +} + +// RegisterTransactionServiceHandler registers the http handlers for service TransactionService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterTransactionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterTransactionServiceHandlerClient(ctx, mux, NewTransactionServiceClient(conn)) +} + +// RegisterTransactionServiceHandlerClient registers the http handlers for service TransactionService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TransactionServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TransactionServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "TransactionServiceClient" to call the correct interceptors. +func RegisterTransactionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TransactionServiceClient) error { + + mux.Handle("POST", pattern_TransactionService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/List", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TransactionService_List_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_TransactionService_ParseTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/ParseTransaction", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/ParseTransaction")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TransactionService_ParseTransaction_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_ParseTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_TransactionService_SubmitTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/SubmitTransaction", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/SubmitTransaction")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TransactionService_SubmitTransaction_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_SubmitTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_TransactionService_EstimateGas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2beta1.TransactionService/EstimateGas", runtime.WithHTTPPathPattern("/spacemesh.v2beta1.TransactionService/EstimateGas")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TransactionService_EstimateGas_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TransactionService_EstimateGas_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_TransactionService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.TransactionService", "List"}, "")) + + pattern_TransactionService_ParseTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.TransactionService", "ParseTransaction"}, "")) + + pattern_TransactionService_SubmitTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.TransactionService", "SubmitTransaction"}, "")) + + pattern_TransactionService_EstimateGas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2beta1.TransactionService", "EstimateGas"}, "")) +) + +var ( + forward_TransactionService_List_0 = runtime.ForwardResponseMessage + + forward_TransactionService_ParseTransaction_0 = runtime.ForwardResponseMessage + + forward_TransactionService_SubmitTransaction_0 = runtime.ForwardResponseMessage + + forward_TransactionService_EstimateGas_0 = runtime.ForwardResponseMessage +) diff --git a/release/go/spacemesh/v2beta1/tx_grpc.pb.go b/release/go/spacemesh/v2beta1/tx_grpc.pb.go new file mode 100644 index 00000000..bf279be5 --- /dev/null +++ b/release/go/spacemesh/v2beta1/tx_grpc.pb.go @@ -0,0 +1,334 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2beta1/tx.proto + +package spacemeshv2beta1 + +import ( + context "context" + v2alpha1 "github.com/spacemeshos/api/release/go/spacemesh/v2alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + TransactionStreamService_Stream_FullMethodName = "/spacemesh.v2beta1.TransactionStreamService/Stream" +) + +// TransactionStreamServiceClient is the client API for TransactionStreamService 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. +type TransactionStreamServiceClient interface { + Stream(ctx context.Context, in *v2alpha1.TransactionStreamRequest, opts ...grpc.CallOption) (TransactionStreamService_StreamClient, error) +} + +type transactionStreamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTransactionStreamServiceClient(cc grpc.ClientConnInterface) TransactionStreamServiceClient { + return &transactionStreamServiceClient{cc} +} + +func (c *transactionStreamServiceClient) Stream(ctx context.Context, in *v2alpha1.TransactionStreamRequest, opts ...grpc.CallOption) (TransactionStreamService_StreamClient, error) { + stream, err := c.cc.NewStream(ctx, &TransactionStreamService_ServiceDesc.Streams[0], TransactionStreamService_Stream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &transactionStreamServiceStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type TransactionStreamService_StreamClient interface { + Recv() (*v2alpha1.TransactionResponse, error) + grpc.ClientStream +} + +type transactionStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *transactionStreamServiceStreamClient) Recv() (*v2alpha1.TransactionResponse, error) { + m := new(v2alpha1.TransactionResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// TransactionStreamServiceServer is the server API for TransactionStreamService service. +// All implementations should embed UnimplementedTransactionStreamServiceServer +// for forward compatibility +type TransactionStreamServiceServer interface { + Stream(*v2alpha1.TransactionStreamRequest, TransactionStreamService_StreamServer) error +} + +// UnimplementedTransactionStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedTransactionStreamServiceServer struct { +} + +func (UnimplementedTransactionStreamServiceServer) Stream(*v2alpha1.TransactionStreamRequest, TransactionStreamService_StreamServer) error { + return status.Errorf(codes.Unimplemented, "method Stream not implemented") +} + +// UnsafeTransactionStreamServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TransactionStreamServiceServer will +// result in compilation errors. +type UnsafeTransactionStreamServiceServer interface { + mustEmbedUnimplementedTransactionStreamServiceServer() +} + +func RegisterTransactionStreamServiceServer(s grpc.ServiceRegistrar, srv TransactionStreamServiceServer) { + s.RegisterService(&TransactionStreamService_ServiceDesc, srv) +} + +func _TransactionStreamService_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(v2alpha1.TransactionStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TransactionStreamServiceServer).Stream(m, &transactionStreamServiceStreamServer{stream}) +} + +type TransactionStreamService_StreamServer interface { + Send(*v2alpha1.TransactionResponse) error + grpc.ServerStream +} + +type transactionStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *transactionStreamServiceStreamServer) Send(m *v2alpha1.TransactionResponse) error { + return x.ServerStream.SendMsg(m) +} + +// TransactionStreamService_ServiceDesc is the grpc.ServiceDesc for TransactionStreamService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TransactionStreamService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.TransactionStreamService", + HandlerType: (*TransactionStreamServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Stream", + Handler: _TransactionStreamService_Stream_Handler, + ServerStreams: true, + }, + }, + Metadata: "spacemesh/v2beta1/tx.proto", +} + +const ( + TransactionService_List_FullMethodName = "/spacemesh.v2beta1.TransactionService/List" + TransactionService_ParseTransaction_FullMethodName = "/spacemesh.v2beta1.TransactionService/ParseTransaction" + TransactionService_SubmitTransaction_FullMethodName = "/spacemesh.v2beta1.TransactionService/SubmitTransaction" + TransactionService_EstimateGas_FullMethodName = "/spacemesh.v2beta1.TransactionService/EstimateGas" +) + +// TransactionServiceClient is the client API for TransactionService 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. +type TransactionServiceClient interface { + List(ctx context.Context, in *v2alpha1.TransactionRequest, opts ...grpc.CallOption) (*v2alpha1.TransactionList, error) + ParseTransaction(ctx context.Context, in *v2alpha1.ParseTransactionRequest, opts ...grpc.CallOption) (*v2alpha1.ParseTransactionResponse, error) + SubmitTransaction(ctx context.Context, in *v2alpha1.SubmitTransactionRequest, opts ...grpc.CallOption) (*v2alpha1.SubmitTransactionResponse, error) + EstimateGas(ctx context.Context, in *v2alpha1.EstimateGasRequest, opts ...grpc.CallOption) (*v2alpha1.EstimateGasResponse, error) +} + +type transactionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTransactionServiceClient(cc grpc.ClientConnInterface) TransactionServiceClient { + return &transactionServiceClient{cc} +} + +func (c *transactionServiceClient) List(ctx context.Context, in *v2alpha1.TransactionRequest, opts ...grpc.CallOption) (*v2alpha1.TransactionList, error) { + out := new(v2alpha1.TransactionList) + err := c.cc.Invoke(ctx, TransactionService_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *transactionServiceClient) ParseTransaction(ctx context.Context, in *v2alpha1.ParseTransactionRequest, opts ...grpc.CallOption) (*v2alpha1.ParseTransactionResponse, error) { + out := new(v2alpha1.ParseTransactionResponse) + err := c.cc.Invoke(ctx, TransactionService_ParseTransaction_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *transactionServiceClient) SubmitTransaction(ctx context.Context, in *v2alpha1.SubmitTransactionRequest, opts ...grpc.CallOption) (*v2alpha1.SubmitTransactionResponse, error) { + out := new(v2alpha1.SubmitTransactionResponse) + err := c.cc.Invoke(ctx, TransactionService_SubmitTransaction_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *transactionServiceClient) EstimateGas(ctx context.Context, in *v2alpha1.EstimateGasRequest, opts ...grpc.CallOption) (*v2alpha1.EstimateGasResponse, error) { + out := new(v2alpha1.EstimateGasResponse) + err := c.cc.Invoke(ctx, TransactionService_EstimateGas_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TransactionServiceServer is the server API for TransactionService service. +// All implementations should embed UnimplementedTransactionServiceServer +// for forward compatibility +type TransactionServiceServer interface { + List(context.Context, *v2alpha1.TransactionRequest) (*v2alpha1.TransactionList, error) + ParseTransaction(context.Context, *v2alpha1.ParseTransactionRequest) (*v2alpha1.ParseTransactionResponse, error) + SubmitTransaction(context.Context, *v2alpha1.SubmitTransactionRequest) (*v2alpha1.SubmitTransactionResponse, error) + EstimateGas(context.Context, *v2alpha1.EstimateGasRequest) (*v2alpha1.EstimateGasResponse, error) +} + +// UnimplementedTransactionServiceServer should be embedded to have forward compatible implementations. +type UnimplementedTransactionServiceServer struct { +} + +func (UnimplementedTransactionServiceServer) List(context.Context, *v2alpha1.TransactionRequest) (*v2alpha1.TransactionList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedTransactionServiceServer) ParseTransaction(context.Context, *v2alpha1.ParseTransactionRequest) (*v2alpha1.ParseTransactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParseTransaction not implemented") +} +func (UnimplementedTransactionServiceServer) SubmitTransaction(context.Context, *v2alpha1.SubmitTransactionRequest) (*v2alpha1.SubmitTransactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitTransaction not implemented") +} +func (UnimplementedTransactionServiceServer) EstimateGas(context.Context, *v2alpha1.EstimateGasRequest) (*v2alpha1.EstimateGasResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimateGas not implemented") +} + +// UnsafeTransactionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TransactionServiceServer will +// result in compilation errors. +type UnsafeTransactionServiceServer interface { + mustEmbedUnimplementedTransactionServiceServer() +} + +func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer) { + s.RegisterService(&TransactionService_ServiceDesc, srv) +} + +func _TransactionService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.TransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TransactionServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TransactionService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TransactionServiceServer).List(ctx, req.(*v2alpha1.TransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TransactionService_ParseTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.ParseTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TransactionServiceServer).ParseTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TransactionService_ParseTransaction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TransactionServiceServer).ParseTransaction(ctx, req.(*v2alpha1.ParseTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TransactionService_SubmitTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.SubmitTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TransactionServiceServer).SubmitTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TransactionService_SubmitTransaction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TransactionServiceServer).SubmitTransaction(ctx, req.(*v2alpha1.SubmitTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TransactionService_EstimateGas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v2alpha1.EstimateGasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TransactionServiceServer).EstimateGas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TransactionService_EstimateGas_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TransactionServiceServer).EstimateGas(ctx, req.(*v2alpha1.EstimateGasRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// TransactionService_ServiceDesc is the grpc.ServiceDesc for TransactionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TransactionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2beta1.TransactionService", + HandlerType: (*TransactionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "List", + Handler: _TransactionService_List_Handler, + }, + { + MethodName: "ParseTransaction", + Handler: _TransactionService_ParseTransaction_Handler, + }, + { + MethodName: "SubmitTransaction", + Handler: _TransactionService_SubmitTransaction_Handler, + }, + { + MethodName: "EstimateGas", + Handler: _TransactionService_EstimateGas_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2beta1/tx.proto", +} diff --git a/release/openapi/swagger/src/api.swagger.json b/release/openapi/swagger/src/api.swagger.json index a5ee4d1d..ee497e13 100644 --- a/release/openapi/swagger/src/api.swagger.json +++ b/release/openapi/swagger/src/api.swagger.json @@ -374,6 +374,358 @@ } } } + }, + "/spacemesh.v2beta1.AccountService/List": { + "post": { + "tags": [ + "AccountService" + ], + "operationId": "AccountService_List", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/spacemeshv2alpha1AccountRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1AccountList" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.ActivationService/ActivationsCount": { + "post": { + "tags": [ + "ActivationService" + ], + "operationId": "ActivationService_ActivationsCount", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1ActivationsCountRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1ActivationsCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.ActivationService/List": { + "post": { + "tags": [ + "ActivationService" + ], + "operationId": "ActivationService_List", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1ActivationRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1ActivationList" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.LayerService/List": { + "post": { + "tags": [ + "LayerService" + ], + "operationId": "LayerService_List", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1LayerRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1LayerList" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.NetworkService/Info": { + "post": { + "tags": [ + "NetworkService" + ], + "operationId": "NetworkService_Info", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1NetworkInfoRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2alpha1NetworkInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.NodeService/Status": { + "post": { + "tags": [ + "NodeService" + ], + "operationId": "NodeService_Status", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1NodeStatusRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1NodeStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.RewardService/List": { + "post": { + "tags": [ + "RewardService" + ], + "operationId": "RewardService_List", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1RewardRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1RewardList" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.TransactionService/EstimateGas": { + "post": { + "tags": [ + "TransactionService" + ], + "operationId": "TransactionService_EstimateGas", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1EstimateGasRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1EstimateGasResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.TransactionService/List": { + "post": { + "tags": [ + "TransactionService" + ], + "operationId": "TransactionService_List", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v2alpha1TransactionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1TransactionList" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.TransactionService/ParseTransaction": { + "post": { + "tags": [ + "TransactionService" + ], + "operationId": "TransactionService_ParseTransaction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/spacemeshv2alpha1ParseTransactionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2alpha1ParseTransactionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, + "/spacemesh.v2beta1.TransactionService/SubmitTransaction": { + "post": { + "tags": [ + "TransactionService" + ], + "operationId": "TransactionService_SubmitTransaction", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/spacemeshv2alpha1SubmitTransactionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2alpha1SubmitTransactionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } } }, "definitions": { diff --git a/spacemesh/v2beta1/account.proto b/spacemesh/v2beta1/account.proto new file mode 100644 index 00000000..29a27194 --- /dev/null +++ b/spacemesh/v2beta1/account.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/account.proto"; + +package spacemesh.v2beta1; + +service AccountService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(spacemesh.v2alpha1.AccountRequest) returns (spacemesh.v2alpha1.AccountList); +} \ No newline at end of file diff --git a/spacemesh/v2beta1/activation.proto b/spacemesh/v2beta1/activation.proto new file mode 100644 index 00000000..d31c3032 --- /dev/null +++ b/spacemesh/v2beta1/activation.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/activation.proto"; + +package spacemesh.v2beta1; + +service ActivationStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(spacemesh.v2alpha1.ActivationStreamRequest) returns (stream spacemesh.v2alpha1.Activation); +} + +service ActivationService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(spacemesh.v2alpha1.ActivationRequest) returns (spacemesh.v2alpha1.ActivationList); + rpc ActivationsCount(spacemesh.v2alpha1.ActivationsCountRequest) returns (spacemesh.v2alpha1.ActivationsCountResponse); +} diff --git a/spacemesh/v2beta1/layer.proto b/spacemesh/v2beta1/layer.proto new file mode 100644 index 00000000..4c14d526 --- /dev/null +++ b/spacemesh/v2beta1/layer.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/layer.proto"; + +package spacemesh.v2beta1; + +service LayerService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(spacemesh.v2alpha1.LayerRequest) returns (spacemesh.v2alpha1.LayerList); +} + +service LayerStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(spacemesh.v2alpha1.LayerStreamRequest) returns (stream spacemesh.v2alpha1.Layer); +} \ No newline at end of file diff --git a/spacemesh/v2beta1/network.proto b/spacemesh/v2beta1/network.proto new file mode 100644 index 00000000..d9afa514 --- /dev/null +++ b/spacemesh/v2beta1/network.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/network.proto"; + +package spacemesh.v2beta1; + +service NetworkService { + option (google.api.api_visibility).restriction = "V2"; + + rpc Info(spacemesh.v2alpha1.NetworkInfoRequest) returns (spacemesh.v2alpha1.NetworkInfoResponse); +} diff --git a/spacemesh/v2beta1/node.proto b/spacemesh/v2beta1/node.proto new file mode 100644 index 00000000..75db37f7 --- /dev/null +++ b/spacemesh/v2beta1/node.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/node.proto"; + +package spacemesh.v2beta1; + +service NodeService { + option (google.api.api_visibility).restriction = "V2"; + + rpc Status(spacemesh.v2alpha1.NodeStatusRequest) returns (spacemesh.v2alpha1.NodeStatusResponse); +} \ No newline at end of file diff --git a/spacemesh/v2beta1/reward.proto b/spacemesh/v2beta1/reward.proto new file mode 100644 index 00000000..f1f937c8 --- /dev/null +++ b/spacemesh/v2beta1/reward.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/reward.proto"; + +package spacemesh.v2beta1; + +service RewardService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(spacemesh.v2alpha1.RewardRequest) returns (spacemesh.v2alpha1.RewardList); +} + +service RewardStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(spacemesh.v2alpha1.RewardStreamRequest) returns (stream spacemesh.v2alpha1.Reward); +} \ No newline at end of file diff --git a/spacemesh/v2beta1/tx.proto b/spacemesh/v2beta1/tx.proto new file mode 100644 index 00000000..45eb49fd --- /dev/null +++ b/spacemesh/v2beta1/tx.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/tx.proto"; + +package spacemesh.v2beta1; + +service TransactionStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(spacemesh.v2alpha1.TransactionStreamRequest) returns (stream spacemesh.v2alpha1.TransactionResponse); +} + +service TransactionService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(spacemesh.v2alpha1.TransactionRequest) returns (spacemesh.v2alpha1.TransactionList); + rpc ParseTransaction(spacemesh.v2alpha1.ParseTransactionRequest) returns (spacemesh.v2alpha1.ParseTransactionResponse); + rpc SubmitTransaction(spacemesh.v2alpha1.SubmitTransactionRequest) returns (spacemesh.v2alpha1.SubmitTransactionResponse); + rpc EstimateGas(spacemesh.v2alpha1.EstimateGasRequest) returns (spacemesh.v2alpha1.EstimateGasResponse); +} \ No newline at end of file