diff --git a/release/go/spacemesh/v2beta1/account.pb.go b/release/go/spacemesh/v2beta1/account.pb.go new file mode 100644 index 00000000..8324fd60 --- /dev/null +++ b/release/go/spacemesh/v2beta1/account.pb.go @@ -0,0 +1,257 @@ +// 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" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AccountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` + Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data + Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch// bech32 format including HRP +} + +func (x *AccountRequest) Reset() { + *x = AccountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_account_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRequest) ProtoMessage() {} + +func (x *AccountRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_account_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountRequest.ProtoReflect.Descriptor instead. +func (*AccountRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_account_proto_rawDescGZIP(), []int{0} +} + +func (x *AccountRequest) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +func (x *AccountRequest) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *AccountRequest) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +type AccountList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Accounts []*v2alpha1.Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (x *AccountList) Reset() { + *x = AccountList{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_account_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountList) ProtoMessage() {} + +func (x *AccountList) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_account_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountList.ProtoReflect.Descriptor instead. +func (*AccountList) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_account_proto_rawDescGZIP(), []int{1} +} + +func (x *AccountList) GetAccounts() []*v2alpha1.Account { + if x != nil { + return x.Accounts + } + return nil +} + +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, 0x22, 0x5c, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x22, 0x46, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x37, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1b, 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, + 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x32, 0x67, 0x0a, 0x0e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 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, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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_rawDescOnce sync.Once + file_spacemesh_v2beta1_account_proto_rawDescData = file_spacemesh_v2beta1_account_proto_rawDesc +) + +func file_spacemesh_v2beta1_account_proto_rawDescGZIP() []byte { + file_spacemesh_v2beta1_account_proto_rawDescOnce.Do(func() { + file_spacemesh_v2beta1_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2beta1_account_proto_rawDescData) + }) + return file_spacemesh_v2beta1_account_proto_rawDescData +} + +var file_spacemesh_v2beta1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_spacemesh_v2beta1_account_proto_goTypes = []interface{}{ + (*AccountRequest)(nil), // 0: spacemesh.v2beta1.AccountRequest + (*AccountList)(nil), // 1: spacemesh.v2beta1.AccountList + (*v2alpha1.Account)(nil), // 2: spacemesh.v2alpha1.Account +} +var file_spacemesh_v2beta1_account_proto_depIdxs = []int32{ + 2, // 0: spacemesh.v2beta1.AccountList.accounts:type_name -> spacemesh.v2alpha1.Account + 0, // 1: spacemesh.v2beta1.AccountService.List:input_type -> spacemesh.v2beta1.AccountRequest + 1, // 2: spacemesh.v2beta1.AccountService.List:output_type -> spacemesh.v2beta1.AccountList + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] 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 + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2beta1_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_account_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_account_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_spacemesh_v2beta1_account_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_account_proto_depIdxs, + MessageInfos: file_spacemesh_v2beta1_account_proto_msgTypes, + }.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..0d130e6f --- /dev/null +++ b/release/go/spacemesh/v2beta1/account.pb.gw.go @@ -0,0 +1,163 @@ +// 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" + "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 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 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..1127f083 --- /dev/null +++ b/release/go/spacemesh/v2beta1/account_grpc.pb.go @@ -0,0 +1,107 @@ +// 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" + 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 *AccountRequest, opts ...grpc.CallOption) (*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 *AccountRequest, opts ...grpc.CallOption) (*AccountList, error) { + out := new(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, *AccountRequest) (*AccountList, error) +} + +// UnimplementedAccountServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAccountServiceServer struct { +} + +func (UnimplementedAccountServiceServer) List(context.Context, *AccountRequest) (*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(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.(*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..276e1e9a --- /dev/null +++ b/release/go/spacemesh/v2beta1/activation.pb.go @@ -0,0 +1,677 @@ +// 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" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ActivationStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartEpoch uint32 `protobuf:"varint,1,opt,name=start_epoch,json=startEpoch,proto3" json:"start_epoch,omitempty"` // Apply `start_epoch/end_epoch` filters together with `coinbase` filter for better performance. + EndEpoch uint32 `protobuf:"varint,2,opt,name=end_epoch,json=endEpoch,proto3" json:"end_epoch,omitempty"` + Id [][]byte `protobuf:"bytes,3,rep,name=id,proto3" json:"id,omitempty"` + SmesherId [][]byte `protobuf:"bytes,4,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` + Coinbase string `protobuf:"bytes,5,opt,name=coinbase,proto3" json:"coinbase,omitempty"` // `coinbase` filter is not supported by database index and will result in sequential scan. + Watch bool `protobuf:"varint,6,opt,name=watch,proto3" json:"watch,omitempty"` +} + +func (x *ActivationStreamRequest) Reset() { + *x = ActivationStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivationStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivationStreamRequest) ProtoMessage() {} + +func (x *ActivationStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivationStreamRequest.ProtoReflect.Descriptor instead. +func (*ActivationStreamRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_activation_proto_rawDescGZIP(), []int{0} +} + +func (x *ActivationStreamRequest) GetStartEpoch() uint32 { + if x != nil { + return x.StartEpoch + } + return 0 +} + +func (x *ActivationStreamRequest) GetEndEpoch() uint32 { + if x != nil { + return x.EndEpoch + } + return 0 +} + +func (x *ActivationStreamRequest) GetId() [][]byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *ActivationStreamRequest) GetSmesherId() [][]byte { + if x != nil { + return x.SmesherId + } + return nil +} + +func (x *ActivationStreamRequest) GetCoinbase() string { + if x != nil { + return x.Coinbase + } + return "" +} + +func (x *ActivationStreamRequest) GetWatch() bool { + if x != nil { + return x.Watch + } + return false +} + +type Activation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + SmesherId []byte `protobuf:"bytes,2,opt,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` + PublishEpoch uint32 `protobuf:"varint,3,opt,name=publish_epoch,json=publishEpoch,proto3" json:"publish_epoch,omitempty"` + Coinbase string `protobuf:"bytes,4,opt,name=coinbase,proto3" json:"coinbase,omitempty"` + Weight uint64 `protobuf:"varint,5,opt,name=weight,proto3" json:"weight,omitempty"` + Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + NumUnits uint32 `protobuf:"varint,7,opt,name=num_units,json=numUnits,proto3" json:"num_units,omitempty"` // number of effective PoST data commitment units +} + +func (x *Activation) Reset() { + *x = Activation{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Activation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Activation) ProtoMessage() {} + +func (x *Activation) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Activation.ProtoReflect.Descriptor instead. +func (*Activation) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_activation_proto_rawDescGZIP(), []int{1} +} + +func (x *Activation) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *Activation) GetSmesherId() []byte { + if x != nil { + return x.SmesherId + } + return nil +} + +func (x *Activation) GetPublishEpoch() uint32 { + if x != nil { + return x.PublishEpoch + } + return 0 +} + +func (x *Activation) GetCoinbase() string { + if x != nil { + return x.Coinbase + } + return "" +} + +func (x *Activation) GetWeight() uint64 { + if x != nil { + return x.Weight + } + return 0 +} + +func (x *Activation) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *Activation) GetNumUnits() uint32 { + if x != nil { + return x.NumUnits + } + return 0 +} + +type ActivationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartEpoch uint32 `protobuf:"varint,1,opt,name=start_epoch,json=startEpoch,proto3" json:"start_epoch,omitempty"` // Apply `start_epoch/end_epoch` filters together with `coinbase` filter for better performance. + EndEpoch uint32 `protobuf:"varint,2,opt,name=end_epoch,json=endEpoch,proto3" json:"end_epoch,omitempty"` + Id [][]byte `protobuf:"bytes,3,rep,name=id,proto3" json:"id,omitempty"` + SmesherId [][]byte `protobuf:"bytes,4,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` + Coinbase string `protobuf:"bytes,5,opt,name=coinbase,proto3" json:"coinbase,omitempty"` // `coinbase` filter is not supported by database index and will result in sequential scan. + Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` + Limit uint64 `protobuf:"varint,7,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *ActivationRequest) Reset() { + *x = ActivationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivationRequest) ProtoMessage() {} + +func (x *ActivationRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivationRequest.ProtoReflect.Descriptor instead. +func (*ActivationRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_activation_proto_rawDescGZIP(), []int{2} +} + +func (x *ActivationRequest) GetStartEpoch() uint32 { + if x != nil { + return x.StartEpoch + } + return 0 +} + +func (x *ActivationRequest) GetEndEpoch() uint32 { + if x != nil { + return x.EndEpoch + } + return 0 +} + +func (x *ActivationRequest) GetId() [][]byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *ActivationRequest) GetSmesherId() [][]byte { + if x != nil { + return x.SmesherId + } + return nil +} + +func (x *ActivationRequest) GetCoinbase() string { + if x != nil { + return x.Coinbase + } + return "" +} + +func (x *ActivationRequest) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ActivationRequest) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +type ActivationList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Activations []*v2alpha1.Activation `protobuf:"bytes,1,rep,name=activations,proto3" json:"activations,omitempty"` +} + +func (x *ActivationList) Reset() { + *x = ActivationList{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivationList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivationList) ProtoMessage() {} + +func (x *ActivationList) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivationList.ProtoReflect.Descriptor instead. +func (*ActivationList) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_activation_proto_rawDescGZIP(), []int{3} +} + +func (x *ActivationList) GetActivations() []*v2alpha1.Activation { + if x != nil { + return x.Activations + } + return nil +} + +type ActivationsCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Epoch *uint32 `protobuf:"varint,1,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` +} + +func (x *ActivationsCountRequest) Reset() { + *x = ActivationsCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivationsCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivationsCountRequest) ProtoMessage() {} + +func (x *ActivationsCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivationsCountRequest.ProtoReflect.Descriptor instead. +func (*ActivationsCountRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_activation_proto_rawDescGZIP(), []int{4} +} + +func (x *ActivationsCountRequest) GetEpoch() uint32 { + if x != nil && x.Epoch != nil { + return *x.Epoch + } + return 0 +} + +type ActivationsCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *ActivationsCountResponse) Reset() { + *x = ActivationsCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivationsCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivationsCountResponse) ProtoMessage() {} + +func (x *ActivationsCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_activation_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivationsCountResponse.ProtoReflect.Descriptor instead. +func (*ActivationsCountResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_activation_proto_rawDescGZIP(), []int{5} +} + +func (x *ActivationsCountResponse) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +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, 0x22, 0xb8, 0x01, 0x0a, 0x17, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, + 0x61, 0x74, 0x63, 0x68, 0x22, 0xc9, 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x75, 0x6d, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6e, 0x75, 0x6d, 0x55, 0x6e, 0x69, 0x74, 0x73, + 0x22, 0xca, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x52, 0x0a, + 0x0e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x40, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 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, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x22, 0x30, 0x0a, 0x18, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x32, 0x82, 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, + 0x55, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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, 0x1d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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, 0xdd, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, + 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x6b, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x76, 0x32, 0x62, 0x65, 0x74, 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, + 0x2b, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, + 0x74, 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_rawDescOnce sync.Once + file_spacemesh_v2beta1_activation_proto_rawDescData = file_spacemesh_v2beta1_activation_proto_rawDesc +) + +func file_spacemesh_v2beta1_activation_proto_rawDescGZIP() []byte { + file_spacemesh_v2beta1_activation_proto_rawDescOnce.Do(func() { + file_spacemesh_v2beta1_activation_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2beta1_activation_proto_rawDescData) + }) + return file_spacemesh_v2beta1_activation_proto_rawDescData +} + +var file_spacemesh_v2beta1_activation_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_spacemesh_v2beta1_activation_proto_goTypes = []interface{}{ + (*ActivationStreamRequest)(nil), // 0: spacemesh.v2beta1.ActivationStreamRequest + (*Activation)(nil), // 1: spacemesh.v2beta1.Activation + (*ActivationRequest)(nil), // 2: spacemesh.v2beta1.ActivationRequest + (*ActivationList)(nil), // 3: spacemesh.v2beta1.ActivationList + (*ActivationsCountRequest)(nil), // 4: spacemesh.v2beta1.ActivationsCountRequest + (*ActivationsCountResponse)(nil), // 5: spacemesh.v2beta1.ActivationsCountResponse + (*v2alpha1.Activation)(nil), // 6: spacemesh.v2alpha1.Activation +} +var file_spacemesh_v2beta1_activation_proto_depIdxs = []int32{ + 6, // 0: spacemesh.v2beta1.ActivationList.activations:type_name -> spacemesh.v2alpha1.Activation + 0, // 1: spacemesh.v2beta1.ActivationStreamService.Stream:input_type -> spacemesh.v2beta1.ActivationStreamRequest + 2, // 2: spacemesh.v2beta1.ActivationService.List:input_type -> spacemesh.v2beta1.ActivationRequest + 4, // 3: spacemesh.v2beta1.ActivationService.ActivationsCount:input_type -> spacemesh.v2beta1.ActivationsCountRequest + 1, // 4: spacemesh.v2beta1.ActivationStreamService.Stream:output_type -> spacemesh.v2beta1.Activation + 3, // 5: spacemesh.v2beta1.ActivationService.List:output_type -> spacemesh.v2beta1.ActivationList + 5, // 6: spacemesh.v2beta1.ActivationService.ActivationsCount:output_type -> spacemesh.v2beta1.ActivationsCountResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] 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 + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2beta1_activation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivationStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_activation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Activation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_activation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_activation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivationList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_activation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivationsCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_activation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivationsCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_spacemesh_v2beta1_activation_proto_msgTypes[4].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_activation_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_activation_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_activation_proto_depIdxs, + MessageInfos: file_spacemesh_v2beta1_activation_proto_msgTypes, + }.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..e50e1cd4 --- /dev/null +++ b/release/go/spacemesh/v2beta1/activation.pb.gw.go @@ -0,0 +1,348 @@ +// 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" + "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 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 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 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 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 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..28a49076 --- /dev/null +++ b/release/go/spacemesh/v2beta1/activation_grpc.pb.go @@ -0,0 +1,259 @@ +// 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" + 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 *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 *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() (*Activation, error) + grpc.ClientStream +} + +type activationStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *activationStreamServiceStreamClient) Recv() (*Activation, error) { + m := new(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(*ActivationStreamRequest, ActivationStreamService_StreamServer) error +} + +// UnimplementedActivationStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedActivationStreamServiceServer struct { +} + +func (UnimplementedActivationStreamServiceServer) Stream(*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(ActivationStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ActivationStreamServiceServer).Stream(m, &activationStreamServiceStreamServer{stream}) +} + +type ActivationStreamService_StreamServer interface { + Send(*Activation) error + grpc.ServerStream +} + +type activationStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *activationStreamServiceStreamServer) Send(m *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 *ActivationRequest, opts ...grpc.CallOption) (*ActivationList, error) + ActivationsCount(ctx context.Context, in *ActivationsCountRequest, opts ...grpc.CallOption) (*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 *ActivationRequest, opts ...grpc.CallOption) (*ActivationList, error) { + out := new(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 *ActivationsCountRequest, opts ...grpc.CallOption) (*ActivationsCountResponse, error) { + out := new(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, *ActivationRequest) (*ActivationList, error) + ActivationsCount(context.Context, *ActivationsCountRequest) (*ActivationsCountResponse, error) +} + +// UnimplementedActivationServiceServer should be embedded to have forward compatible implementations. +type UnimplementedActivationServiceServer struct { +} + +func (UnimplementedActivationServiceServer) List(context.Context, *ActivationRequest) (*ActivationList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedActivationServiceServer) ActivationsCount(context.Context, *ActivationsCountRequest) (*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(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.(*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(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.(*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..cb222c48 --- /dev/null +++ b/release/go/spacemesh/v2beta1/layer.pb.go @@ -0,0 +1,552 @@ +// 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" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Layer_LayerStatus int32 + +const ( + Layer_LAYER_STATUS_UNSPECIFIED Layer_LayerStatus = 0 + Layer_LAYER_STATUS_APPLIED Layer_LayerStatus = 1 // applied by hare + Layer_LAYER_STATUS_VERIFIED Layer_LayerStatus = 2 // verified by tortoise +) + +// Enum value maps for Layer_LayerStatus. +var ( + Layer_LayerStatus_name = map[int32]string{ + 0: "LAYER_STATUS_UNSPECIFIED", + 1: "LAYER_STATUS_APPLIED", + 2: "LAYER_STATUS_VERIFIED", + } + Layer_LayerStatus_value = map[string]int32{ + "LAYER_STATUS_UNSPECIFIED": 0, + "LAYER_STATUS_APPLIED": 1, + "LAYER_STATUS_VERIFIED": 2, + } +) + +func (x Layer_LayerStatus) Enum() *Layer_LayerStatus { + p := new(Layer_LayerStatus) + *p = x + return p +} + +func (x Layer_LayerStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Layer_LayerStatus) Descriptor() protoreflect.EnumDescriptor { + return file_spacemesh_v2beta1_layer_proto_enumTypes[0].Descriptor() +} + +func (Layer_LayerStatus) Type() protoreflect.EnumType { + return &file_spacemesh_v2beta1_layer_proto_enumTypes[0] +} + +func (x Layer_LayerStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Layer_LayerStatus.Descriptor instead. +func (Layer_LayerStatus) EnumDescriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_layer_proto_rawDescGZIP(), []int{2, 0} +} + +type LayerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartLayer uint32 `protobuf:"varint,1,opt,name=start_layer,json=startLayer,proto3" json:"start_layer,omitempty"` + EndLayer uint32 `protobuf:"varint,2,opt,name=end_layer,json=endLayer,proto3" json:"end_layer,omitempty"` + Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data + Limit uint64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch + SortOrder v2alpha1.SortOrder `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3,enum=spacemesh.v2alpha1.SortOrder" json:"sort_order,omitempty"` // specifies the sort order (default is ASC) +} + +func (x *LayerRequest) Reset() { + *x = LayerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LayerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LayerRequest) ProtoMessage() {} + +func (x *LayerRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LayerRequest.ProtoReflect.Descriptor instead. +func (*LayerRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_layer_proto_rawDescGZIP(), []int{0} +} + +func (x *LayerRequest) GetStartLayer() uint32 { + if x != nil { + return x.StartLayer + } + return 0 +} + +func (x *LayerRequest) GetEndLayer() uint32 { + if x != nil { + return x.EndLayer + } + return 0 +} + +func (x *LayerRequest) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *LayerRequest) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *LayerRequest) GetSortOrder() v2alpha1.SortOrder { + if x != nil { + return x.SortOrder + } + return v2alpha1.SortOrder(0) +} + +type LayerList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Layers []*Layer `protobuf:"bytes,1,rep,name=layers,proto3" json:"layers,omitempty"` +} + +func (x *LayerList) Reset() { + *x = LayerList{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LayerList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LayerList) ProtoMessage() {} + +func (x *LayerList) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LayerList.ProtoReflect.Descriptor instead. +func (*LayerList) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_layer_proto_rawDescGZIP(), []int{1} +} + +func (x *LayerList) GetLayers() []*Layer { + if x != nil { + return x.Layers + } + return nil +} + +type Layer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // layer number - not hash - layer content may change + Status Layer_LayerStatus `protobuf:"varint,2,opt,name=status,proto3,enum=spacemesh.v2beta1.Layer_LayerStatus" json:"status,omitempty"` + ConsensusHash string `protobuf:"bytes,3,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` + StateHash []byte `protobuf:"bytes,4,opt,name=state_hash,json=stateHash,proto3" json:"state_hash,omitempty"` // fingerprint of the computed state at the layer + CumulativeStateHash []byte `protobuf:"bytes,5,opt,name=cumulative_state_hash,json=cumulativeStateHash,proto3" json:"cumulative_state_hash,omitempty"` // cumulative fingerprint that uniquely identifies state since genesis + Block *v2alpha1.Block `protobuf:"bytes,6,opt,name=block,proto3" json:"block,omitempty"` // layer's block +} + +func (x *Layer) Reset() { + *x = Layer{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Layer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Layer) ProtoMessage() {} + +func (x *Layer) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Layer.ProtoReflect.Descriptor instead. +func (*Layer) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_layer_proto_rawDescGZIP(), []int{2} +} + +func (x *Layer) GetNumber() uint32 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *Layer) GetStatus() Layer_LayerStatus { + if x != nil { + return x.Status + } + return Layer_LAYER_STATUS_UNSPECIFIED +} + +func (x *Layer) GetConsensusHash() string { + if x != nil { + return x.ConsensusHash + } + return "" +} + +func (x *Layer) GetStateHash() []byte { + if x != nil { + return x.StateHash + } + return nil +} + +func (x *Layer) GetCumulativeStateHash() []byte { + if x != nil { + return x.CumulativeStateHash + } + return nil +} + +func (x *Layer) GetBlock() *v2alpha1.Block { + if x != nil { + return x.Block + } + return nil +} + +type LayerStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartLayer uint32 `protobuf:"varint,1,opt,name=start_layer,json=startLayer,proto3" json:"start_layer,omitempty"` + EndLayer uint32 `protobuf:"varint,2,opt,name=end_layer,json=endLayer,proto3" json:"end_layer,omitempty"` + Watch bool `protobuf:"varint,3,opt,name=watch,proto3" json:"watch,omitempty"` +} + +func (x *LayerStreamRequest) Reset() { + *x = LayerStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LayerStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LayerStreamRequest) ProtoMessage() {} + +func (x *LayerStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_layer_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LayerStreamRequest.ProtoReflect.Descriptor instead. +func (*LayerStreamRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_layer_proto_rawDescGZIP(), []int{3} +} + +func (x *LayerStreamRequest) GetStartLayer() uint32 { + if x != nil { + return x.StartLayer + } + return 0 +} + +func (x *LayerStreamRequest) GetEndLayer() uint32 { + if x != nil { + return x.EndLayer + } + return 0 +} + +func (x *LayerStreamRequest) GetWatch() bool { + if x != nil { + return x.Watch + } + return false +} + +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, 0x1a, + 0x1e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x21, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xb8, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, + 0x61, 0x79, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x4c, 0x61, 0x79, 0x65, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x3c, 0x0a, 0x0a, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x52, 0x09, 0x73, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x3d, 0x0a, + 0x09, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, + 0x61, 0x79, 0x65, 0x72, 0x52, 0x06, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x22, 0xea, 0x02, 0x0a, + 0x05, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3c, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, + 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x0a, 0x0e, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x13, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2f, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x60, 0x0a, 0x0b, 0x4c, 0x61, 0x79, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x10, 0x01, 0x12, 0x19, + 0x0a, 0x15, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, + 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x02, 0x22, 0x68, 0x0a, 0x12, 0x4c, 0x61, 0x79, + 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, + 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x14, 0x0a, + 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, + 0x74, 0x63, 0x68, 0x32, 0x61, 0x0a, 0x0c, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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, 0x73, 0x0a, 0x12, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x06, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x79, 0x65, 0x72, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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_rawDescOnce sync.Once + file_spacemesh_v2beta1_layer_proto_rawDescData = file_spacemesh_v2beta1_layer_proto_rawDesc +) + +func file_spacemesh_v2beta1_layer_proto_rawDescGZIP() []byte { + file_spacemesh_v2beta1_layer_proto_rawDescOnce.Do(func() { + file_spacemesh_v2beta1_layer_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2beta1_layer_proto_rawDescData) + }) + return file_spacemesh_v2beta1_layer_proto_rawDescData +} + +var file_spacemesh_v2beta1_layer_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_spacemesh_v2beta1_layer_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_spacemesh_v2beta1_layer_proto_goTypes = []interface{}{ + (Layer_LayerStatus)(0), // 0: spacemesh.v2beta1.Layer.LayerStatus + (*LayerRequest)(nil), // 1: spacemesh.v2beta1.LayerRequest + (*LayerList)(nil), // 2: spacemesh.v2beta1.LayerList + (*Layer)(nil), // 3: spacemesh.v2beta1.Layer + (*LayerStreamRequest)(nil), // 4: spacemesh.v2beta1.LayerStreamRequest + (v2alpha1.SortOrder)(0), // 5: spacemesh.v2alpha1.SortOrder + (*v2alpha1.Block)(nil), // 6: spacemesh.v2alpha1.Block +} +var file_spacemesh_v2beta1_layer_proto_depIdxs = []int32{ + 5, // 0: spacemesh.v2beta1.LayerRequest.sort_order:type_name -> spacemesh.v2alpha1.SortOrder + 3, // 1: spacemesh.v2beta1.LayerList.layers:type_name -> spacemesh.v2beta1.Layer + 0, // 2: spacemesh.v2beta1.Layer.status:type_name -> spacemesh.v2beta1.Layer.LayerStatus + 6, // 3: spacemesh.v2beta1.Layer.block:type_name -> spacemesh.v2alpha1.Block + 1, // 4: spacemesh.v2beta1.LayerService.List:input_type -> spacemesh.v2beta1.LayerRequest + 4, // 5: spacemesh.v2beta1.LayerStreamService.Stream:input_type -> spacemesh.v2beta1.LayerStreamRequest + 2, // 6: spacemesh.v2beta1.LayerService.List:output_type -> spacemesh.v2beta1.LayerList + 3, // 7: spacemesh.v2beta1.LayerStreamService.Stream:output_type -> spacemesh.v2beta1.Layer + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] 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 + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2beta1_layer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LayerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_layer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LayerList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_layer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Layer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_layer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LayerStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_layer_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_layer_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_layer_proto_depIdxs, + EnumInfos: file_spacemesh_v2beta1_layer_proto_enumTypes, + MessageInfos: file_spacemesh_v2beta1_layer_proto_msgTypes, + }.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..00632072 --- /dev/null +++ b/release/go/spacemesh/v2beta1/layer.pb.gw.go @@ -0,0 +1,271 @@ +// 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" + "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 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 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 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..5f385050 --- /dev/null +++ b/release/go/spacemesh/v2beta1/layer_grpc.pb.go @@ -0,0 +1,222 @@ +// 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" + 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 *LayerRequest, opts ...grpc.CallOption) (*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 *LayerRequest, opts ...grpc.CallOption) (*LayerList, error) { + out := new(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, *LayerRequest) (*LayerList, error) +} + +// UnimplementedLayerServiceServer should be embedded to have forward compatible implementations. +type UnimplementedLayerServiceServer struct { +} + +func (UnimplementedLayerServiceServer) List(context.Context, *LayerRequest) (*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(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.(*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 *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 *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() (*Layer, error) + grpc.ClientStream +} + +type layerStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *layerStreamServiceStreamClient) Recv() (*Layer, error) { + m := new(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(*LayerStreamRequest, LayerStreamService_StreamServer) error +} + +// UnimplementedLayerStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedLayerStreamServiceServer struct { +} + +func (UnimplementedLayerStreamServiceServer) Stream(*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(LayerStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LayerStreamServiceServer).Stream(m, &layerStreamServiceStreamServer{stream}) +} + +type LayerStreamService_StreamServer interface { + Send(*Layer) error + grpc.ServerStream +} + +type layerStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *layerStreamServiceStreamServer) Send(m *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..769a50d3 --- /dev/null +++ b/release/go/spacemesh/v2beta1/network.pb.go @@ -0,0 +1,301 @@ +// 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 ( + _ "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" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type NetworkInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GenesisTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=genesis_time,json=genesisTime,proto3" json:"genesis_time,omitempty"` // genesis time of the network, represented as a timestamp + LayerDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=layer_duration,json=layerDuration,proto3" json:"layer_duration,omitempty"` // duration of each layer in the network, specified as a duration + GenesisId []byte `protobuf:"bytes,4,opt,name=genesis_id,json=genesisId,proto3" json:"genesis_id,omitempty"` + Hrp string `protobuf:"bytes,5,opt,name=hrp,proto3" json:"hrp,omitempty"` + EffectiveGenesisLayer uint32 `protobuf:"varint,6,opt,name=effective_genesis_layer,json=effectiveGenesisLayer,proto3" json:"effective_genesis_layer,omitempty"` // effective genesis layer, i.e., first layer after genesis initialization period + LayersPerEpoch uint32 `protobuf:"varint,7,opt,name=layers_per_epoch,json=layersPerEpoch,proto3" json:"layers_per_epoch,omitempty"` // number of layers per epoch + LabelsPerUnit uint64 `protobuf:"varint,8,opt,name=labels_per_unit,json=labelsPerUnit,proto3" json:"labels_per_unit,omitempty"` +} + +func (x *NetworkInfoResponse) Reset() { + *x = NetworkInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_network_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkInfoResponse) ProtoMessage() {} + +func (x *NetworkInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_network_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkInfoResponse.ProtoReflect.Descriptor instead. +func (*NetworkInfoResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_network_proto_rawDescGZIP(), []int{0} +} + +func (x *NetworkInfoResponse) GetGenesisTime() *timestamppb.Timestamp { + if x != nil { + return x.GenesisTime + } + return nil +} + +func (x *NetworkInfoResponse) GetLayerDuration() *durationpb.Duration { + if x != nil { + return x.LayerDuration + } + return nil +} + +func (x *NetworkInfoResponse) GetGenesisId() []byte { + if x != nil { + return x.GenesisId + } + return nil +} + +func (x *NetworkInfoResponse) GetHrp() string { + if x != nil { + return x.Hrp + } + return "" +} + +func (x *NetworkInfoResponse) GetEffectiveGenesisLayer() uint32 { + if x != nil { + return x.EffectiveGenesisLayer + } + return 0 +} + +func (x *NetworkInfoResponse) GetLayersPerEpoch() uint32 { + if x != nil { + return x.LayersPerEpoch + } + return 0 +} + +func (x *NetworkInfoResponse) GetLabelsPerUnit() uint64 { + if x != nil { + return x.LabelsPerUnit + } + return 0 +} + +type NetworkInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NetworkInfoRequest) Reset() { + *x = NetworkInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_network_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkInfoRequest) ProtoMessage() {} + +func (x *NetworkInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_network_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkInfoRequest.ProtoReflect.Descriptor instead. +func (*NetworkInfoRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_network_proto_rawDescGZIP(), []int{1} +} + +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, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x22, 0xd1, 0x02, 0x0a, 0x13, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0c, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x68, 0x72, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, 0x70, 0x12, 0x36, + 0x0a, 0x17, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x15, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x50, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x50, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x73, + 0x0a, 0x0e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x55, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, + 0x74, 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_rawDescOnce sync.Once + file_spacemesh_v2beta1_network_proto_rawDescData = file_spacemesh_v2beta1_network_proto_rawDesc +) + +func file_spacemesh_v2beta1_network_proto_rawDescGZIP() []byte { + file_spacemesh_v2beta1_network_proto_rawDescOnce.Do(func() { + file_spacemesh_v2beta1_network_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2beta1_network_proto_rawDescData) + }) + return file_spacemesh_v2beta1_network_proto_rawDescData +} + +var file_spacemesh_v2beta1_network_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_spacemesh_v2beta1_network_proto_goTypes = []interface{}{ + (*NetworkInfoResponse)(nil), // 0: spacemesh.v2beta1.NetworkInfoResponse + (*NetworkInfoRequest)(nil), // 1: spacemesh.v2beta1.NetworkInfoRequest + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration +} +var file_spacemesh_v2beta1_network_proto_depIdxs = []int32{ + 2, // 0: spacemesh.v2beta1.NetworkInfoResponse.genesis_time:type_name -> google.protobuf.Timestamp + 3, // 1: spacemesh.v2beta1.NetworkInfoResponse.layer_duration:type_name -> google.protobuf.Duration + 1, // 2: spacemesh.v2beta1.NetworkService.Info:input_type -> spacemesh.v2beta1.NetworkInfoRequest + 0, // 3: spacemesh.v2beta1.NetworkService.Info:output_type -> spacemesh.v2beta1.NetworkInfoResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] 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 + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2beta1_network_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_network_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_network_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_spacemesh_v2beta1_network_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_network_proto_depIdxs, + MessageInfos: file_spacemesh_v2beta1_network_proto_msgTypes, + }.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..fdb1d4ab --- /dev/null +++ b/release/go/spacemesh/v2beta1/network.pb.gw.go @@ -0,0 +1,163 @@ +// 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" + "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 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 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..3c2709d7 --- /dev/null +++ b/release/go/spacemesh/v2beta1/network_grpc.pb.go @@ -0,0 +1,107 @@ +// 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" + 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 *NetworkInfoRequest, opts ...grpc.CallOption) (*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 *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) { + out := new(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, *NetworkInfoRequest) (*NetworkInfoResponse, error) +} + +// UnimplementedNetworkServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNetworkServiceServer struct { +} + +func (UnimplementedNetworkServiceServer) Info(context.Context, *NetworkInfoRequest) (*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(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.(*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..9d36ff30 --- /dev/null +++ b/release/go/spacemesh/v2beta1/node.pb.go @@ -0,0 +1,342 @@ +// 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 ( + _ "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" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type NodeStatusResponse_SyncStatus int32 + +const ( + NodeStatusResponse_SYNC_STATUS_UNSPECIFIED NodeStatusResponse_SyncStatus = 0 + NodeStatusResponse_SYNC_STATUS_OFFLINE NodeStatusResponse_SyncStatus = 1 + NodeStatusResponse_SYNC_STATUS_SYNCING NodeStatusResponse_SyncStatus = 2 + NodeStatusResponse_SYNC_STATUS_SYNCED NodeStatusResponse_SyncStatus = 3 +) + +// Enum value maps for NodeStatusResponse_SyncStatus. +var ( + NodeStatusResponse_SyncStatus_name = map[int32]string{ + 0: "SYNC_STATUS_UNSPECIFIED", + 1: "SYNC_STATUS_OFFLINE", + 2: "SYNC_STATUS_SYNCING", + 3: "SYNC_STATUS_SYNCED", + } + NodeStatusResponse_SyncStatus_value = map[string]int32{ + "SYNC_STATUS_UNSPECIFIED": 0, + "SYNC_STATUS_OFFLINE": 1, + "SYNC_STATUS_SYNCING": 2, + "SYNC_STATUS_SYNCED": 3, + } +) + +func (x NodeStatusResponse_SyncStatus) Enum() *NodeStatusResponse_SyncStatus { + p := new(NodeStatusResponse_SyncStatus) + *p = x + return p +} + +func (x NodeStatusResponse_SyncStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (NodeStatusResponse_SyncStatus) Descriptor() protoreflect.EnumDescriptor { + return file_spacemesh_v2beta1_node_proto_enumTypes[0].Descriptor() +} + +func (NodeStatusResponse_SyncStatus) Type() protoreflect.EnumType { + return &file_spacemesh_v2beta1_node_proto_enumTypes[0] +} + +func (x NodeStatusResponse_SyncStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use NodeStatusResponse_SyncStatus.Descriptor instead. +func (NodeStatusResponse_SyncStatus) EnumDescriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_node_proto_rawDescGZIP(), []int{0, 0} +} + +type NodeStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConnectedPeers uint64 `protobuf:"varint,1,opt,name=connected_peers,json=connectedPeers,proto3" json:"connected_peers,omitempty"` // number of connected neighbors + Status NodeStatusResponse_SyncStatus `protobuf:"varint,2,opt,name=status,proto3,enum=spacemesh.v2beta1.NodeStatusResponse_SyncStatus" json:"status,omitempty"` + LatestLayer uint32 `protobuf:"varint,3,opt,name=latest_layer,json=latestLayer,proto3" json:"latest_layer,omitempty"` // latest layer node has seen from blocks + AppliedLayer uint32 `protobuf:"varint,4,opt,name=applied_layer,json=appliedLayer,proto3" json:"applied_layer,omitempty"` // last layer node has applied to the state + ProcessedLayer uint32 `protobuf:"varint,5,opt,name=processed_layer,json=processedLayer,proto3" json:"processed_layer,omitempty"` // last layer whose votes have been processed + CurrentLayer uint32 `protobuf:"varint,6,opt,name=current_layer,json=currentLayer,proto3" json:"current_layer,omitempty"` // current layer, based on clock time +} + +func (x *NodeStatusResponse) Reset() { + *x = NodeStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeStatusResponse) ProtoMessage() {} + +func (x *NodeStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_node_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeStatusResponse.ProtoReflect.Descriptor instead. +func (*NodeStatusResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_node_proto_rawDescGZIP(), []int{0} +} + +func (x *NodeStatusResponse) GetConnectedPeers() uint64 { + if x != nil { + return x.ConnectedPeers + } + return 0 +} + +func (x *NodeStatusResponse) GetStatus() NodeStatusResponse_SyncStatus { + if x != nil { + return x.Status + } + return NodeStatusResponse_SYNC_STATUS_UNSPECIFIED +} + +func (x *NodeStatusResponse) GetLatestLayer() uint32 { + if x != nil { + return x.LatestLayer + } + return 0 +} + +func (x *NodeStatusResponse) GetAppliedLayer() uint32 { + if x != nil { + return x.AppliedLayer + } + return 0 +} + +func (x *NodeStatusResponse) GetProcessedLayer() uint32 { + if x != nil { + return x.ProcessedLayer + } + return 0 +} + +func (x *NodeStatusResponse) GetCurrentLayer() uint32 { + if x != nil { + return x.CurrentLayer + } + return 0 +} + +type NodeStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NodeStatusRequest) Reset() { + *x = NodeStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_node_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeStatusRequest) ProtoMessage() {} + +func (x *NodeStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_node_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeStatusRequest.ProtoReflect.Descriptor instead. +func (*NodeStatusRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_node_proto_rawDescGZIP(), []int{1} +} + +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, 0x22, 0x92, 0x03, + 0x0a, 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, + 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x48, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x12, + 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x65, 0x64, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x22, 0x73, 0x0a, + 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x17, 0x53, + 0x59, 0x4e, 0x43, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x59, 0x4e, 0x43, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, + 0x01, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x59, + 0x4e, 0x43, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x45, 0x44, + 0x10, 0x03, 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x70, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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_rawDescOnce sync.Once + file_spacemesh_v2beta1_node_proto_rawDescData = file_spacemesh_v2beta1_node_proto_rawDesc +) + +func file_spacemesh_v2beta1_node_proto_rawDescGZIP() []byte { + file_spacemesh_v2beta1_node_proto_rawDescOnce.Do(func() { + file_spacemesh_v2beta1_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2beta1_node_proto_rawDescData) + }) + return file_spacemesh_v2beta1_node_proto_rawDescData +} + +var file_spacemesh_v2beta1_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_spacemesh_v2beta1_node_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_spacemesh_v2beta1_node_proto_goTypes = []interface{}{ + (NodeStatusResponse_SyncStatus)(0), // 0: spacemesh.v2beta1.NodeStatusResponse.SyncStatus + (*NodeStatusResponse)(nil), // 1: spacemesh.v2beta1.NodeStatusResponse + (*NodeStatusRequest)(nil), // 2: spacemesh.v2beta1.NodeStatusRequest +} +var file_spacemesh_v2beta1_node_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2beta1.NodeStatusResponse.status:type_name -> spacemesh.v2beta1.NodeStatusResponse.SyncStatus + 2, // 1: spacemesh.v2beta1.NodeService.Status:input_type -> spacemesh.v2beta1.NodeStatusRequest + 1, // 2: spacemesh.v2beta1.NodeService.Status:output_type -> spacemesh.v2beta1.NodeStatusResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] 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 + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2beta1_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_node_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_spacemesh_v2beta1_node_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_node_proto_depIdxs, + EnumInfos: file_spacemesh_v2beta1_node_proto_enumTypes, + MessageInfos: file_spacemesh_v2beta1_node_proto_msgTypes, + }.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..1b580800 --- /dev/null +++ b/release/go/spacemesh/v2beta1/node.pb.gw.go @@ -0,0 +1,163 @@ +// 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" + "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 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 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..763af85d --- /dev/null +++ b/release/go/spacemesh/v2beta1/node_grpc.pb.go @@ -0,0 +1,107 @@ +// 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" + 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 *NodeStatusRequest, opts ...grpc.CallOption) (*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 *NodeStatusRequest, opts ...grpc.CallOption) (*NodeStatusResponse, error) { + out := new(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, *NodeStatusRequest) (*NodeStatusResponse, error) +} + +// UnimplementedNodeServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNodeServiceServer struct { +} + +func (UnimplementedNodeServiceServer) Status(context.Context, *NodeStatusRequest) (*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(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.(*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..4174bb9d --- /dev/null +++ b/release/go/spacemesh/v2beta1/reward.pb.go @@ -0,0 +1,575 @@ +// 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" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Layer uint32 `protobuf:"varint,1,opt,name=layer,proto3" json:"layer,omitempty"` // layer award was paid in + Total uint64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` // total reward paid in smidge (sum of tx fee and layer reward) + LayerReward uint64 `protobuf:"varint,3,opt,name=layer_reward,json=layerReward,proto3" json:"layer_reward,omitempty"` // tx_fee = total - layer_reward + Coinbase string `protobuf:"bytes,5,opt,name=coinbase,proto3" json:"coinbase,omitempty"` // account awarded this reward + Smesher []byte `protobuf:"bytes,6,opt,name=smesher,proto3" json:"smesher,omitempty"` // id of smesher who earned this reward +} + +func (x *Reward) Reset() { + *x = Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reward) ProtoMessage() {} + +func (x *Reward) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reward.ProtoReflect.Descriptor instead. +func (*Reward) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_reward_proto_rawDescGZIP(), []int{0} +} + +func (x *Reward) GetLayer() uint32 { + if x != nil { + return x.Layer + } + return 0 +} + +func (x *Reward) GetTotal() uint64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *Reward) GetLayerReward() uint64 { + if x != nil { + return x.LayerReward + } + return 0 +} + +func (x *Reward) GetCoinbase() string { + if x != nil { + return x.Coinbase + } + return "" +} + +func (x *Reward) GetSmesher() []byte { + if x != nil { + return x.Smesher + } + return nil +} + +type RewardRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartLayer uint32 `protobuf:"varint,1,opt,name=start_layer,json=startLayer,proto3" json:"start_layer,omitempty"` + EndLayer uint32 `protobuf:"varint,2,opt,name=end_layer,json=endLayer,proto3" json:"end_layer,omitempty"` + // Types that are assignable to FilterBy: + // + // *RewardRequest_Coinbase + // *RewardRequest_Smesher + FilterBy isRewardRequest_FilterBy `protobuf_oneof:"filter_by"` + Offset uint64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data + Limit uint64 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch + SortOrder v2alpha1.SortOrder `protobuf:"varint,7,opt,name=sort_order,json=sortOrder,proto3,enum=spacemesh.v2alpha1.SortOrder" json:"sort_order,omitempty"` // specifies the sort order by layer (default is ASC) +} + +func (x *RewardRequest) Reset() { + *x = RewardRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardRequest) ProtoMessage() {} + +func (x *RewardRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RewardRequest.ProtoReflect.Descriptor instead. +func (*RewardRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_reward_proto_rawDescGZIP(), []int{1} +} + +func (x *RewardRequest) GetStartLayer() uint32 { + if x != nil { + return x.StartLayer + } + return 0 +} + +func (x *RewardRequest) GetEndLayer() uint32 { + if x != nil { + return x.EndLayer + } + return 0 +} + +func (m *RewardRequest) GetFilterBy() isRewardRequest_FilterBy { + if m != nil { + return m.FilterBy + } + return nil +} + +func (x *RewardRequest) GetCoinbase() string { + if x, ok := x.GetFilterBy().(*RewardRequest_Coinbase); ok { + return x.Coinbase + } + return "" +} + +func (x *RewardRequest) GetSmesher() []byte { + if x, ok := x.GetFilterBy().(*RewardRequest_Smesher); ok { + return x.Smesher + } + return nil +} + +func (x *RewardRequest) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *RewardRequest) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *RewardRequest) GetSortOrder() v2alpha1.SortOrder { + if x != nil { + return x.SortOrder + } + return v2alpha1.SortOrder(0) +} + +type isRewardRequest_FilterBy interface { + isRewardRequest_FilterBy() +} + +type RewardRequest_Coinbase struct { + Coinbase string `protobuf:"bytes,3,opt,name=coinbase,proto3,oneof"` +} + +type RewardRequest_Smesher struct { + Smesher []byte `protobuf:"bytes,4,opt,name=smesher,proto3,oneof"` +} + +func (*RewardRequest_Coinbase) isRewardRequest_FilterBy() {} + +func (*RewardRequest_Smesher) isRewardRequest_FilterBy() {} + +type RewardList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` +} + +func (x *RewardList) Reset() { + *x = RewardList{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardList) ProtoMessage() {} + +func (x *RewardList) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RewardList.ProtoReflect.Descriptor instead. +func (*RewardList) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_reward_proto_rawDescGZIP(), []int{2} +} + +func (x *RewardList) GetRewards() []*Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type RewardStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartLayer uint32 `protobuf:"varint,1,opt,name=start_layer,json=startLayer,proto3" json:"start_layer,omitempty"` + EndLayer uint32 `protobuf:"varint,2,opt,name=end_layer,json=endLayer,proto3" json:"end_layer,omitempty"` + // Types that are assignable to FilterBy: + // + // *RewardStreamRequest_Coinbase + // *RewardStreamRequest_Smesher + FilterBy isRewardStreamRequest_FilterBy `protobuf_oneof:"filter_by"` + Watch bool `protobuf:"varint,5,opt,name=watch,proto3" json:"watch,omitempty"` +} + +func (x *RewardStreamRequest) Reset() { + *x = RewardStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardStreamRequest) ProtoMessage() {} + +func (x *RewardStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_reward_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RewardStreamRequest.ProtoReflect.Descriptor instead. +func (*RewardStreamRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_reward_proto_rawDescGZIP(), []int{3} +} + +func (x *RewardStreamRequest) GetStartLayer() uint32 { + if x != nil { + return x.StartLayer + } + return 0 +} + +func (x *RewardStreamRequest) GetEndLayer() uint32 { + if x != nil { + return x.EndLayer + } + return 0 +} + +func (m *RewardStreamRequest) GetFilterBy() isRewardStreamRequest_FilterBy { + if m != nil { + return m.FilterBy + } + return nil +} + +func (x *RewardStreamRequest) GetCoinbase() string { + if x, ok := x.GetFilterBy().(*RewardStreamRequest_Coinbase); ok { + return x.Coinbase + } + return "" +} + +func (x *RewardStreamRequest) GetSmesher() []byte { + if x, ok := x.GetFilterBy().(*RewardStreamRequest_Smesher); ok { + return x.Smesher + } + return nil +} + +func (x *RewardStreamRequest) GetWatch() bool { + if x != nil { + return x.Watch + } + return false +} + +type isRewardStreamRequest_FilterBy interface { + isRewardStreamRequest_FilterBy() +} + +type RewardStreamRequest_Coinbase struct { + Coinbase string `protobuf:"bytes,3,opt,name=coinbase,proto3,oneof"` +} + +type RewardStreamRequest_Smesher struct { + Smesher []byte `protobuf:"bytes,4,opt,name=smesher,proto3,oneof"` +} + +func (*RewardStreamRequest_Coinbase) isRewardStreamRequest_FilterBy() {} + +func (*RewardStreamRequest_Smesher) isRewardStreamRequest_FilterBy() {} + +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, 0x1a, 0x21, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6d, + 0x65, 0x73, 0x68, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x6d, 0x65, + 0x73, 0x68, 0x65, 0x72, 0x22, 0x80, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x4c, + 0x61, 0x79, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x07, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x3c, 0x0a, 0x0a, + 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, + 0x09, 0x73, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x0b, 0x0a, 0x09, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x22, 0x41, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0xb0, 0x01, 0x0a, 0x13, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x61, + 0x79, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x4c, 0x61, 0x79, 0x65, 0x72, + 0x12, 0x1c, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1a, + 0x0a, 0x07, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, + 0x00, 0x52, 0x07, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, + 0x42, 0x0b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x32, 0x64, 0x0a, + 0x0d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 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, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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, 0x76, 0x0a, 0x13, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 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, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 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, 0x62, 0x65, 0x74, 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_rawDescOnce sync.Once + file_spacemesh_v2beta1_reward_proto_rawDescData = file_spacemesh_v2beta1_reward_proto_rawDesc +) + +func file_spacemesh_v2beta1_reward_proto_rawDescGZIP() []byte { + file_spacemesh_v2beta1_reward_proto_rawDescOnce.Do(func() { + file_spacemesh_v2beta1_reward_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2beta1_reward_proto_rawDescData) + }) + return file_spacemesh_v2beta1_reward_proto_rawDescData +} + +var file_spacemesh_v2beta1_reward_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_spacemesh_v2beta1_reward_proto_goTypes = []interface{}{ + (*Reward)(nil), // 0: spacemesh.v2beta1.Reward + (*RewardRequest)(nil), // 1: spacemesh.v2beta1.RewardRequest + (*RewardList)(nil), // 2: spacemesh.v2beta1.RewardList + (*RewardStreamRequest)(nil), // 3: spacemesh.v2beta1.RewardStreamRequest + (v2alpha1.SortOrder)(0), // 4: spacemesh.v2alpha1.SortOrder +} +var file_spacemesh_v2beta1_reward_proto_depIdxs = []int32{ + 4, // 0: spacemesh.v2beta1.RewardRequest.sort_order:type_name -> spacemesh.v2alpha1.SortOrder + 0, // 1: spacemesh.v2beta1.RewardList.rewards:type_name -> spacemesh.v2beta1.Reward + 1, // 2: spacemesh.v2beta1.RewardService.List:input_type -> spacemesh.v2beta1.RewardRequest + 3, // 3: spacemesh.v2beta1.RewardStreamService.Stream:input_type -> spacemesh.v2beta1.RewardStreamRequest + 2, // 4: spacemesh.v2beta1.RewardService.List:output_type -> spacemesh.v2beta1.RewardList + 0, // 5: spacemesh.v2beta1.RewardStreamService.Stream:output_type -> spacemesh.v2beta1.Reward + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] 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 + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2beta1_reward_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_reward_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_reward_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_reward_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_spacemesh_v2beta1_reward_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*RewardRequest_Coinbase)(nil), + (*RewardRequest_Smesher)(nil), + } + file_spacemesh_v2beta1_reward_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*RewardStreamRequest_Coinbase)(nil), + (*RewardStreamRequest_Smesher)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_reward_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_reward_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_reward_proto_depIdxs, + MessageInfos: file_spacemesh_v2beta1_reward_proto_msgTypes, + }.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..67d8ac86 --- /dev/null +++ b/release/go/spacemesh/v2beta1/reward.pb.gw.go @@ -0,0 +1,271 @@ +// 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" + "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 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 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 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..90a539bf --- /dev/null +++ b/release/go/spacemesh/v2beta1/reward_grpc.pb.go @@ -0,0 +1,222 @@ +// 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" + 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 *RewardRequest, opts ...grpc.CallOption) (*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 *RewardRequest, opts ...grpc.CallOption) (*RewardList, error) { + out := new(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, *RewardRequest) (*RewardList, error) +} + +// UnimplementedRewardServiceServer should be embedded to have forward compatible implementations. +type UnimplementedRewardServiceServer struct { +} + +func (UnimplementedRewardServiceServer) List(context.Context, *RewardRequest) (*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(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.(*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 *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 *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() (*Reward, error) + grpc.ClientStream +} + +type rewardStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *rewardStreamServiceStreamClient) Recv() (*Reward, error) { + m := new(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(*RewardStreamRequest, RewardStreamService_StreamServer) error +} + +// UnimplementedRewardStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedRewardStreamServiceServer struct { +} + +func (UnimplementedRewardStreamServiceServer) Stream(*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(RewardStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RewardStreamServiceServer).Stream(m, &rewardStreamServiceStreamServer{stream}) +} + +type RewardStreamService_StreamServer interface { + Send(*Reward) error + grpc.ServerStream +} + +type rewardStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *rewardStreamServiceStreamServer) Send(m *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..be6da427 --- /dev/null +++ b/release/go/spacemesh/v2beta1/tx.pb.go @@ -0,0 +1,1000 @@ +// 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" + status "google.golang.org/genproto/googleapis/rpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TransactionStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartLayer uint32 `protobuf:"varint,1,opt,name=start_layer,json=startLayer,proto3" json:"start_layer,omitempty"` // Required: starting layer for transaction streaming. + EndLayer *uint32 `protobuf:"varint,2,opt,name=end_layer,json=endLayer,proto3,oneof" json:"end_layer,omitempty"` // Ending layer for transaction streaming. + Txid [][]byte `protobuf:"bytes,3,rep,name=txid,proto3" json:"txid,omitempty"` // Filter: specific transaction IDs. + Principal *string `protobuf:"bytes,4,opt,name=principal,proto3,oneof" json:"principal,omitempty"` // Filter by principal address + Watch bool `protobuf:"varint,5,opt,name=watch,proto3" json:"watch,omitempty"` // Continue watching for new transactions. +} + +func (x *TransactionStreamRequest) Reset() { + *x = TransactionStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionStreamRequest) ProtoMessage() {} + +func (x *TransactionStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionStreamRequest.ProtoReflect.Descriptor instead. +func (*TransactionStreamRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *TransactionStreamRequest) GetStartLayer() uint32 { + if x != nil { + return x.StartLayer + } + return 0 +} + +func (x *TransactionStreamRequest) GetEndLayer() uint32 { + if x != nil && x.EndLayer != nil { + return *x.EndLayer + } + return 0 +} + +func (x *TransactionStreamRequest) GetTxid() [][]byte { + if x != nil { + return x.Txid + } + return nil +} + +func (x *TransactionStreamRequest) GetPrincipal() string { + if x != nil && x.Principal != nil { + return *x.Principal + } + return "" +} + +func (x *TransactionStreamRequest) GetWatch() bool { + if x != nil { + return x.Watch + } + return false +} + +type TransactionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartLayer *uint32 `protobuf:"varint,1,opt,name=start_layer,json=startLayer,proto3,oneof" json:"start_layer,omitempty"` // Starting layer for transactions. + EndLayer *uint32 `protobuf:"varint,2,opt,name=end_layer,json=endLayer,proto3,oneof" json:"end_layer,omitempty"` // Ending layer for transactions. + Txid [][]byte `protobuf:"bytes,3,rep,name=txid,proto3" json:"txid,omitempty"` // Filter: specific transaction IDs to filter. + Address *string `protobuf:"bytes,4,opt,name=address,proto3,oneof" json:"address,omitempty"` // Filter by address (principal or recipient) + Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` // Adjusts the starting point for data retrieval. + Limit uint64 `protobuf:"varint,7,opt,name=limit,proto3" json:"limit,omitempty"` // Specifies maximum number of items to fetch. + IncludeState bool `protobuf:"varint,8,opt,name=include_state,json=includeState,proto3" json:"include_state,omitempty"` // Whether to include transaction state in response. + IncludeResult bool `protobuf:"varint,9,opt,name=include_result,json=includeResult,proto3" json:"include_result,omitempty"` // Whether to include result of transactions in response. + SortOrder v2alpha1.SortOrder `protobuf:"varint,10,opt,name=sort_order,json=sortOrder,proto3,enum=spacemesh.v2alpha1.SortOrder" json:"sort_order,omitempty"` // specifies the sort order by layer (default is ASC) +} + +func (x *TransactionRequest) Reset() { + *x = TransactionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionRequest) ProtoMessage() {} + +func (x *TransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionRequest.ProtoReflect.Descriptor instead. +func (*TransactionRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *TransactionRequest) GetStartLayer() uint32 { + if x != nil && x.StartLayer != nil { + return *x.StartLayer + } + return 0 +} + +func (x *TransactionRequest) GetEndLayer() uint32 { + if x != nil && x.EndLayer != nil { + return *x.EndLayer + } + return 0 +} + +func (x *TransactionRequest) GetTxid() [][]byte { + if x != nil { + return x.Txid + } + return nil +} + +func (x *TransactionRequest) GetAddress() string { + if x != nil && x.Address != nil { + return *x.Address + } + return "" +} + +func (x *TransactionRequest) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *TransactionRequest) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *TransactionRequest) GetIncludeState() bool { + if x != nil { + return x.IncludeState + } + return false +} + +func (x *TransactionRequest) GetIncludeResult() bool { + if x != nil { + return x.IncludeResult + } + return false +} + +func (x *TransactionRequest) GetSortOrder() v2alpha1.SortOrder { + if x != nil { + return x.SortOrder + } + return v2alpha1.SortOrder(0) +} + +type TransactionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tx *v2alpha1.Transaction `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + TxResult *v2alpha1.TransactionResult `protobuf:"bytes,2,opt,name=tx_result,json=txResult,proto3" json:"tx_result,omitempty"` + TxState *v2alpha1.TransactionState `protobuf:"varint,3,opt,name=tx_state,json=txState,proto3,enum=spacemesh.v2alpha1.TransactionState,oneof" json:"tx_state,omitempty"` +} + +func (x *TransactionResponse) Reset() { + *x = TransactionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionResponse) ProtoMessage() {} + +func (x *TransactionResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionResponse.ProtoReflect.Descriptor instead. +func (*TransactionResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *TransactionResponse) GetTx() *v2alpha1.Transaction { + if x != nil { + return x.Tx + } + return nil +} + +func (x *TransactionResponse) GetTxResult() *v2alpha1.TransactionResult { + if x != nil { + return x.TxResult + } + return nil +} + +func (x *TransactionResponse) GetTxState() v2alpha1.TransactionState { + if x != nil && x.TxState != nil { + return *x.TxState + } + return v2alpha1.TransactionState(0) +} + +type TransactionList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Transactions []*TransactionResponse `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"` +} + +func (x *TransactionList) Reset() { + *x = TransactionList{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionList) ProtoMessage() {} + +func (x *TransactionList) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionList.ProtoReflect.Descriptor instead. +func (*TransactionList) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *TransactionList) GetTransactions() []*TransactionResponse { + if x != nil { + return x.Transactions + } + return nil +} + +type ParseTransactionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` // signed binary transaction + Verify bool `protobuf:"varint,2,opt,name=verify,proto3" json:"verify,omitempty"` // if true signature verification will be executed +} + +func (x *ParseTransactionRequest) Reset() { + *x = ParseTransactionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParseTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParseTransactionRequest) ProtoMessage() {} + +func (x *ParseTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParseTransactionRequest.ProtoReflect.Descriptor instead. +func (*ParseTransactionRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *ParseTransactionRequest) GetTransaction() []byte { + if x != nil { + return x.Transaction + } + return nil +} + +func (x *ParseTransactionRequest) GetVerify() bool { + if x != nil { + return x.Verify + } + return false +} + +type ParseTransactionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Tx *v2alpha1.Transaction `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"` +} + +func (x *ParseTransactionResponse) Reset() { + *x = ParseTransactionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParseTransactionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParseTransactionResponse) ProtoMessage() {} + +func (x *ParseTransactionResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParseTransactionResponse.ProtoReflect.Descriptor instead. +func (*ParseTransactionResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{5} +} + +func (x *ParseTransactionResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *ParseTransactionResponse) GetTx() *v2alpha1.Transaction { + if x != nil { + return x.Tx + } + return nil +} + +type SubmitTransactionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` // signed binary transaction +} + +func (x *SubmitTransactionRequest) Reset() { + *x = SubmitTransactionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitTransactionRequest) ProtoMessage() {} + +func (x *SubmitTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitTransactionRequest.ProtoReflect.Descriptor instead. +func (*SubmitTransactionRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *SubmitTransactionRequest) GetTransaction() []byte { + if x != nil { + return x.Transaction + } + return nil +} + +type SubmitTransactionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + TxId []byte `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` +} + +func (x *SubmitTransactionResponse) Reset() { + *x = SubmitTransactionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitTransactionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitTransactionResponse) ProtoMessage() {} + +func (x *SubmitTransactionResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitTransactionResponse.ProtoReflect.Descriptor instead. +func (*SubmitTransactionResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{7} +} + +func (x *SubmitTransactionResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *SubmitTransactionResponse) GetTxId() []byte { + if x != nil { + return x.TxId + } + return nil +} + +type EstimateGasRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` // signed binary transaction +} + +func (x *EstimateGasRequest) Reset() { + *x = EstimateGasRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EstimateGasRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EstimateGasRequest) ProtoMessage() {} + +func (x *EstimateGasRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EstimateGasRequest.ProtoReflect.Descriptor instead. +func (*EstimateGasRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *EstimateGasRequest) GetTransaction() []byte { + if x != nil { + return x.Transaction + } + return nil +} + +type EstimateGasResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + RecommendedMaxGas uint64 `protobuf:"varint,2,opt,name=recommended_max_gas,json=recommendedMaxGas,proto3" json:"recommended_max_gas,omitempty"` +} + +func (x *EstimateGasResponse) Reset() { + *x = EstimateGasResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EstimateGasResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EstimateGasResponse) ProtoMessage() {} + +func (x *EstimateGasResponse) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2beta1_tx_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EstimateGasResponse.ProtoReflect.Descriptor instead. +func (*EstimateGasResponse) Descriptor() ([]byte, []int) { + return file_spacemesh_v2beta1_tx_proto_rawDescGZIP(), []int{9} +} + +func (x *EstimateGasResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *EstimateGasResponse) GetRecommendedMaxGas() uint64 { + if x != nil { + return x.RecommendedMaxGas + } + return 0 +} + +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, + 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x1a, 0x21, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x61, + 0x79, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x4c, 0x61, 0x79, + 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, + 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, + 0x77, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, 0x74, + 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x22, 0xf1, + 0x02, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x65, + 0x6e, 0x64, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, + 0x52, 0x08, 0x65, 0x6e, 0x64, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x78, 0x69, + 0x64, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x02, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x23, + 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x6f, + 0x72, 0x74, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, + 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x09, 0x73, + 0x6f, 0x72, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x65, 0x6e, 0x64, + 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0xdd, 0x01, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x02, 0x74, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 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, 0x02, 0x74, 0x78, 0x12, 0x42, 0x0a, 0x09, 0x74, + 0x78, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 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, 0x75, 0x6c, 0x74, 0x52, 0x08, 0x74, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x44, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x24, 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, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x07, 0x74, 0x78, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x74, 0x78, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x22, 0x5d, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x53, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x22, 0x77, 0x0a, 0x18, 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, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, + 0x0a, 0x02, 0x74, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 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, 0x02, 0x74, 0x78, 0x22, + 0x3c, 0x0a, 0x18, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, + 0x19, 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, 0x2a, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x12, 0x45, + 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x13, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, + 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x11, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, + 0x4d, 0x61, 0x78, 0x47, 0x61, 0x73, 0x32, 0x8d, 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, 0x5f, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2b, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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, 0x26, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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, 0xae, 0x03, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 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, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 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, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x6b, 0x0a, 0x10, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 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, 0x2b, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, + 0x65, 0x74, 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, 0x6e, 0x0a, + 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 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, 0x62, 0x65, 0x74, 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, + 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, + 0x74, 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, 0x5c, 0x0a, + 0x0b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x12, 0x25, 0x2e, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x76, 0x32, 0x62, 0x65, 0x74, 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_rawDescOnce sync.Once + file_spacemesh_v2beta1_tx_proto_rawDescData = file_spacemesh_v2beta1_tx_proto_rawDesc +) + +func file_spacemesh_v2beta1_tx_proto_rawDescGZIP() []byte { + file_spacemesh_v2beta1_tx_proto_rawDescOnce.Do(func() { + file_spacemesh_v2beta1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2beta1_tx_proto_rawDescData) + }) + return file_spacemesh_v2beta1_tx_proto_rawDescData +} + +var file_spacemesh_v2beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_spacemesh_v2beta1_tx_proto_goTypes = []interface{}{ + (*TransactionStreamRequest)(nil), // 0: spacemesh.v2beta1.TransactionStreamRequest + (*TransactionRequest)(nil), // 1: spacemesh.v2beta1.TransactionRequest + (*TransactionResponse)(nil), // 2: spacemesh.v2beta1.TransactionResponse + (*TransactionList)(nil), // 3: spacemesh.v2beta1.TransactionList + (*ParseTransactionRequest)(nil), // 4: spacemesh.v2beta1.ParseTransactionRequest + (*ParseTransactionResponse)(nil), // 5: spacemesh.v2beta1.ParseTransactionResponse + (*SubmitTransactionRequest)(nil), // 6: spacemesh.v2beta1.SubmitTransactionRequest + (*SubmitTransactionResponse)(nil), // 7: spacemesh.v2beta1.SubmitTransactionResponse + (*EstimateGasRequest)(nil), // 8: spacemesh.v2beta1.EstimateGasRequest + (*EstimateGasResponse)(nil), // 9: spacemesh.v2beta1.EstimateGasResponse + (v2alpha1.SortOrder)(0), // 10: spacemesh.v2alpha1.SortOrder + (*v2alpha1.Transaction)(nil), // 11: spacemesh.v2alpha1.Transaction + (*v2alpha1.TransactionResult)(nil), // 12: spacemesh.v2alpha1.TransactionResult + (v2alpha1.TransactionState)(0), // 13: spacemesh.v2alpha1.TransactionState + (*status.Status)(nil), // 14: google.rpc.Status +} +var file_spacemesh_v2beta1_tx_proto_depIdxs = []int32{ + 10, // 0: spacemesh.v2beta1.TransactionRequest.sort_order:type_name -> spacemesh.v2alpha1.SortOrder + 11, // 1: spacemesh.v2beta1.TransactionResponse.tx:type_name -> spacemesh.v2alpha1.Transaction + 12, // 2: spacemesh.v2beta1.TransactionResponse.tx_result:type_name -> spacemesh.v2alpha1.TransactionResult + 13, // 3: spacemesh.v2beta1.TransactionResponse.tx_state:type_name -> spacemesh.v2alpha1.TransactionState + 2, // 4: spacemesh.v2beta1.TransactionList.transactions:type_name -> spacemesh.v2beta1.TransactionResponse + 14, // 5: spacemesh.v2beta1.ParseTransactionResponse.status:type_name -> google.rpc.Status + 11, // 6: spacemesh.v2beta1.ParseTransactionResponse.tx:type_name -> spacemesh.v2alpha1.Transaction + 14, // 7: spacemesh.v2beta1.SubmitTransactionResponse.status:type_name -> google.rpc.Status + 14, // 8: spacemesh.v2beta1.EstimateGasResponse.status:type_name -> google.rpc.Status + 0, // 9: spacemesh.v2beta1.TransactionStreamService.Stream:input_type -> spacemesh.v2beta1.TransactionStreamRequest + 1, // 10: spacemesh.v2beta1.TransactionService.List:input_type -> spacemesh.v2beta1.TransactionRequest + 4, // 11: spacemesh.v2beta1.TransactionService.ParseTransaction:input_type -> spacemesh.v2beta1.ParseTransactionRequest + 6, // 12: spacemesh.v2beta1.TransactionService.SubmitTransaction:input_type -> spacemesh.v2beta1.SubmitTransactionRequest + 8, // 13: spacemesh.v2beta1.TransactionService.EstimateGas:input_type -> spacemesh.v2beta1.EstimateGasRequest + 2, // 14: spacemesh.v2beta1.TransactionStreamService.Stream:output_type -> spacemesh.v2beta1.TransactionResponse + 3, // 15: spacemesh.v2beta1.TransactionService.List:output_type -> spacemesh.v2beta1.TransactionList + 5, // 16: spacemesh.v2beta1.TransactionService.ParseTransaction:output_type -> spacemesh.v2beta1.ParseTransactionResponse + 7, // 17: spacemesh.v2beta1.TransactionService.SubmitTransaction:output_type -> spacemesh.v2beta1.SubmitTransactionResponse + 9, // 18: spacemesh.v2beta1.TransactionService.EstimateGas:output_type -> spacemesh.v2beta1.EstimateGasResponse + 14, // [14:19] is the sub-list for method output_type + 9, // [9:14] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] 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 + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2beta1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParseTransactionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParseTransactionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitTransactionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitTransactionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EstimateGasRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EstimateGasResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_spacemesh_v2beta1_tx_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_spacemesh_v2beta1_tx_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_spacemesh_v2beta1_tx_proto_msgTypes[2].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2beta1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2beta1_tx_proto_goTypes, + DependencyIndexes: file_spacemesh_v2beta1_tx_proto_depIdxs, + MessageInfos: file_spacemesh_v2beta1_tx_proto_msgTypes, + }.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..f68dd7fc --- /dev/null +++ b/release/go/spacemesh/v2beta1/tx.pb.gw.go @@ -0,0 +1,502 @@ +// 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" + "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 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 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 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 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 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 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 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 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 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..49f52356 --- /dev/null +++ b/release/go/spacemesh/v2beta1/tx_grpc.pb.go @@ -0,0 +1,333 @@ +// 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" + 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 *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 *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() (*TransactionResponse, error) + grpc.ClientStream +} + +type transactionStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *transactionStreamServiceStreamClient) Recv() (*TransactionResponse, error) { + m := new(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(*TransactionStreamRequest, TransactionStreamService_StreamServer) error +} + +// UnimplementedTransactionStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedTransactionStreamServiceServer struct { +} + +func (UnimplementedTransactionStreamServiceServer) Stream(*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(TransactionStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(TransactionStreamServiceServer).Stream(m, &transactionStreamServiceStreamServer{stream}) +} + +type TransactionStreamService_StreamServer interface { + Send(*TransactionResponse) error + grpc.ServerStream +} + +type transactionStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *transactionStreamServiceStreamServer) Send(m *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 *TransactionRequest, opts ...grpc.CallOption) (*TransactionList, error) + ParseTransaction(ctx context.Context, in *ParseTransactionRequest, opts ...grpc.CallOption) (*ParseTransactionResponse, error) + SubmitTransaction(ctx context.Context, in *SubmitTransactionRequest, opts ...grpc.CallOption) (*SubmitTransactionResponse, error) + EstimateGas(ctx context.Context, in *EstimateGasRequest, opts ...grpc.CallOption) (*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 *TransactionRequest, opts ...grpc.CallOption) (*TransactionList, error) { + out := new(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 *ParseTransactionRequest, opts ...grpc.CallOption) (*ParseTransactionResponse, error) { + out := new(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 *SubmitTransactionRequest, opts ...grpc.CallOption) (*SubmitTransactionResponse, error) { + out := new(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 *EstimateGasRequest, opts ...grpc.CallOption) (*EstimateGasResponse, error) { + out := new(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, *TransactionRequest) (*TransactionList, error) + ParseTransaction(context.Context, *ParseTransactionRequest) (*ParseTransactionResponse, error) + SubmitTransaction(context.Context, *SubmitTransactionRequest) (*SubmitTransactionResponse, error) + EstimateGas(context.Context, *EstimateGasRequest) (*EstimateGasResponse, error) +} + +// UnimplementedTransactionServiceServer should be embedded to have forward compatible implementations. +type UnimplementedTransactionServiceServer struct { +} + +func (UnimplementedTransactionServiceServer) List(context.Context, *TransactionRequest) (*TransactionList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedTransactionServiceServer) ParseTransaction(context.Context, *ParseTransactionRequest) (*ParseTransactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParseTransaction not implemented") +} +func (UnimplementedTransactionServiceServer) SubmitTransaction(context.Context, *SubmitTransactionRequest) (*SubmitTransactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitTransaction not implemented") +} +func (UnimplementedTransactionServiceServer) EstimateGas(context.Context, *EstimateGasRequest) (*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(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.(*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(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.(*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(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.(*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(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.(*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..8ef54300 100644 --- a/release/openapi/swagger/src/api.swagger.json +++ b/release/openapi/swagger/src/api.swagger.json @@ -43,7 +43,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1AccountList" + "$ref": "#/definitions/spacemeshv2alpha1AccountList" } }, "default": { @@ -67,7 +67,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1ActivationsCountRequest" + "$ref": "#/definitions/spacemeshv2alpha1ActivationsCountRequest" } } ], @@ -75,7 +75,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1ActivationsCountResponse" + "$ref": "#/definitions/spacemeshv2alpha1ActivationsCountResponse" } }, "default": { @@ -99,7 +99,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1ActivationRequest" + "$ref": "#/definitions/spacemeshv2alpha1ActivationRequest" } } ], @@ -107,7 +107,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1ActivationList" + "$ref": "#/definitions/spacemeshv2alpha1ActivationList" } }, "default": { @@ -131,7 +131,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1LayerRequest" + "$ref": "#/definitions/spacemeshv2alpha1LayerRequest" } } ], @@ -139,7 +139,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1LayerList" + "$ref": "#/definitions/spacemeshv2alpha1LayerList" } }, "default": { @@ -163,7 +163,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1NetworkInfoRequest" + "$ref": "#/definitions/spacemeshv2alpha1NetworkInfoRequest" } } ], @@ -195,7 +195,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1NodeStatusRequest" + "$ref": "#/definitions/spacemeshv2alpha1NodeStatusRequest" } } ], @@ -203,7 +203,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1NodeStatusResponse" + "$ref": "#/definitions/spacemeshv2alpha1NodeStatusResponse" } }, "default": { @@ -227,7 +227,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1RewardRequest" + "$ref": "#/definitions/spacemeshv2alpha1RewardRequest" } } ], @@ -235,7 +235,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1RewardList" + "$ref": "#/definitions/spacemeshv2alpha1RewardList" } }, "default": { @@ -259,7 +259,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1EstimateGasRequest" + "$ref": "#/definitions/spacemeshv2alpha1EstimateGasRequest" } } ], @@ -267,7 +267,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1EstimateGasResponse" + "$ref": "#/definitions/spacemeshv2alpha1EstimateGasResponse" } }, "default": { @@ -291,7 +291,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v2alpha1TransactionRequest" + "$ref": "#/definitions/spacemeshv2alpha1TransactionRequest" } } ], @@ -299,7 +299,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v2alpha1TransactionList" + "$ref": "#/definitions/spacemeshv2alpha1TransactionList" } }, "default": { @@ -374,19 +374,361 @@ } } } + }, + "/spacemesh.v2beta1.AccountService/List": { + "post": { + "tags": [ + "AccountService" + ], + "operationId": "AccountService_List", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/spacemeshv2beta1AccountRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1AccountList" + } + }, + "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/spacemeshv2beta1ActivationsCountRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1ActivationsCountResponse" + } + }, + "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/spacemeshv2beta1ActivationRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1ActivationList" + } + }, + "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/spacemeshv2beta1LayerRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1LayerList" + } + }, + "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/spacemeshv2beta1NetworkInfoRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1NetworkInfoResponse" + } + }, + "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/spacemeshv2beta1NodeStatusRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1NodeStatusResponse" + } + }, + "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/spacemeshv2beta1RewardRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1RewardList" + } + }, + "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/spacemeshv2beta1EstimateGasRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1EstimateGasResponse" + } + }, + "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/spacemeshv2beta1TransactionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1TransactionList" + } + }, + "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/spacemeshv2beta1ParseTransactionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1ParseTransactionResponse" + } + }, + "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/spacemeshv2beta1SubmitTransactionRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/spacemeshv2beta1SubmitTransactionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } } }, "definitions": { - "NodeStatusResponseSyncStatus": { - "type": "string", - "default": "SYNC_STATUS_UNSPECIFIED", - "enum": [ - "SYNC_STATUS_UNSPECIFIED", - "SYNC_STATUS_OFFLINE", - "SYNC_STATUS_SYNCING", - "SYNC_STATUS_SYNCED" - ] - }, "TransactionTransactionType": { "type": "string", "default": "TRANSACTION_TYPE_UNSPECIFIED", @@ -454,6 +796,18 @@ } } }, + "spacemeshv2alpha1AccountList": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/spacemeshv2alpha1Account" + } + } + } + }, "spacemeshv2alpha1AccountRequest": { "type": "object", "properties": { @@ -528,6 +882,76 @@ } } }, + "spacemeshv2alpha1ActivationList": { + "type": "object", + "properties": { + "activations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/spacemeshv2alpha1Activation" + } + } + } + }, + "spacemeshv2alpha1ActivationRequest": { + "type": "object", + "properties": { + "coinbase": { + "description": "`coinbase` filter is not supported by database index and will result in sequential scan.", + "type": "string" + }, + "endEpoch": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + }, + "limit": { + "type": "string", + "format": "uint64" + }, + "offset": { + "type": "string", + "format": "uint64" + }, + "smesherId": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + }, + "startEpoch": { + "description": "Apply `start_epoch/end_epoch` filters together with `coinbase` filter for better performance.", + "type": "integer", + "format": "int64" + } + } + }, + "spacemeshv2alpha1ActivationsCountRequest": { + "type": "object", + "properties": { + "epoch": { + "type": "integer", + "format": "int64" + } + } + }, + "spacemeshv2alpha1ActivationsCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int64" + } + } + }, "spacemeshv2alpha1Block": { "type": "object", "properties": { @@ -538,6 +962,28 @@ } } }, + "spacemeshv2alpha1EstimateGasRequest": { + "type": "object", + "properties": { + "transaction": { + "type": "string", + "format": "byte", + "title": "signed binary transaction" + } + } + }, + "spacemeshv2alpha1EstimateGasResponse": { + "type": "object", + "properties": { + "recommendedMaxGas": { + "type": "string", + "format": "uint64" + }, + "status": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, "spacemeshv2alpha1Layer": { "type": "object", "properties": { @@ -578,6 +1024,48 @@ "LAYER_STATUS_VERIFIED" ] }, + "spacemeshv2alpha1LayerList": { + "type": "object", + "properties": { + "layers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/spacemeshv2alpha1Layer" + } + } + } + }, + "spacemeshv2alpha1LayerRequest": { + "type": "object", + "properties": { + "endLayer": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "string", + "format": "uint64", + "title": "specifies max number of items to fetch" + }, + "offset": { + "type": "string", + "format": "uint64", + "title": "adjusts the starting point for data" + }, + "sortOrder": { + "title": "specifies the sort order (default is ASC)", + "$ref": "#/definitions/v2alpha1SortOrder" + }, + "startLayer": { + "type": "integer", + "format": "int64" + } + } + }, + "spacemeshv2alpha1NetworkInfoRequest": { + "type": "object" + }, "spacemeshv2alpha1NetworkInfoResponse": { "type": "object", "properties": { @@ -598,21 +1086,67 @@ "hrp": { "type": "string" }, - "labelsPerUnit": { + "labelsPerUnit": { + "type": "string", + "format": "uint64" + }, + "layerDuration": { + "type": "string", + "title": "duration of each layer in the network, specified as a duration" + }, + "layersPerEpoch": { + "type": "integer", + "format": "int64", + "title": "number of layers per epoch" + } + } + }, + "spacemeshv2alpha1NodeStatusRequest": { + "type": "object" + }, + "spacemeshv2alpha1NodeStatusResponse": { + "type": "object", + "properties": { + "appliedLayer": { + "type": "integer", + "format": "int64", + "title": "last layer node has applied to the state" + }, + "connectedPeers": { "type": "string", - "format": "uint64" + "format": "uint64", + "title": "number of connected neighbors" }, - "layerDuration": { - "type": "string", - "title": "duration of each layer in the network, specified as a duration" + "currentLayer": { + "type": "integer", + "format": "int64", + "title": "current layer, based on clock time" }, - "layersPerEpoch": { + "latestLayer": { "type": "integer", "format": "int64", - "title": "number of layers per epoch" + "title": "latest layer node has seen from blocks" + }, + "processedLayer": { + "type": "integer", + "format": "int64", + "title": "last layer whose votes have been processed" + }, + "status": { + "$ref": "#/definitions/spacemeshv2alpha1NodeStatusResponseSyncStatus" } } }, + "spacemeshv2alpha1NodeStatusResponseSyncStatus": { + "type": "string", + "default": "SYNC_STATUS_UNSPECIFIED", + "enum": [ + "SYNC_STATUS_UNSPECIFIED", + "SYNC_STATUS_OFFLINE", + "SYNC_STATUS_SYNCING", + "SYNC_STATUS_SYNCED" + ] + }, "spacemeshv2alpha1Nonce": { "type": "object", "properties": { @@ -676,6 +1210,52 @@ } } }, + "spacemeshv2alpha1RewardList": { + "type": "object", + "properties": { + "rewards": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/spacemeshv2alpha1Reward" + } + } + } + }, + "spacemeshv2alpha1RewardRequest": { + "type": "object", + "properties": { + "coinbase": { + "type": "string" + }, + "endLayer": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "string", + "format": "uint64", + "title": "specifies max number of items to fetch" + }, + "offset": { + "type": "string", + "format": "uint64", + "title": "adjusts the starting point for data" + }, + "smesher": { + "type": "string", + "format": "byte" + }, + "sortOrder": { + "title": "specifies the sort order by layer (default is ASC)", + "$ref": "#/definitions/v2alpha1SortOrder" + }, + "startLayer": { + "type": "integer", + "format": "int64" + } + } + }, "spacemeshv2alpha1SubmitTransactionRequest": { "type": "object", "properties": { @@ -749,6 +1329,81 @@ } } }, + "spacemeshv2alpha1TransactionList": { + "type": "object", + "properties": { + "transactions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/spacemeshv2alpha1TransactionResponse" + } + } + } + }, + "spacemeshv2alpha1TransactionRequest": { + "type": "object", + "properties": { + "address": { + "type": "string", + "title": "Filter by address (principal or recipient)" + }, + "endLayer": { + "description": "Ending layer for transactions.", + "type": "integer", + "format": "int64" + }, + "includeResult": { + "description": "Whether to include result of transactions in response.", + "type": "boolean" + }, + "includeState": { + "description": "Whether to include transaction state in response.", + "type": "boolean" + }, + "limit": { + "description": "Specifies maximum number of items to fetch.", + "type": "string", + "format": "uint64" + }, + "offset": { + "description": "Adjusts the starting point for data retrieval.", + "type": "string", + "format": "uint64" + }, + "sortOrder": { + "title": "specifies the sort order by layer (default is ASC)", + "$ref": "#/definitions/v2alpha1SortOrder" + }, + "startLayer": { + "description": "Starting layer for transactions.", + "type": "integer", + "format": "int64" + }, + "txid": { + "description": "Filter: specific transaction IDs to filter.", + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, + "spacemeshv2alpha1TransactionResponse": { + "type": "object", + "properties": { + "tx": { + "$ref": "#/definitions/spacemeshv2alpha1Transaction" + }, + "txResult": { + "$ref": "#/definitions/spacemeshv2alpha1TransactionResult" + }, + "txState": { + "$ref": "#/definitions/spacemeshv2alpha1TransactionState" + } + } + }, "spacemeshv2alpha1TransactionResult": { "type": "object", "properties": { @@ -808,7 +1463,7 @@ "TRANSACTION_STATE_PROCESSED" ] }, - "v2alpha1AccountList": { + "spacemeshv2beta1AccountList": { "type": "object", "properties": { "accounts": { @@ -820,7 +1475,28 @@ } } }, - "v2alpha1ActivationList": { + "spacemeshv2beta1AccountRequest": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "limit": { + "type": "string", + "format": "uint64", + "title": "specifies max number of items to fetch// bech32 format including HRP" + }, + "offset": { + "type": "string", + "format": "uint64", + "title": "adjusts the starting point for data" + } + } + }, + "spacemeshv2beta1ActivationList": { "type": "object", "properties": { "activations": { @@ -832,7 +1508,7 @@ } } }, - "v2alpha1ActivationRequest": { + "spacemeshv2beta1ActivationRequest": { "type": "object", "properties": { "coinbase": { @@ -872,7 +1548,7 @@ } } }, - "v2alpha1ActivationsCountRequest": { + "spacemeshv2beta1ActivationsCountRequest": { "type": "object", "properties": { "epoch": { @@ -881,7 +1557,7 @@ } } }, - "v2alpha1ActivationsCountResponse": { + "spacemeshv2beta1ActivationsCountResponse": { "type": "object", "properties": { "count": { @@ -890,121 +1566,81 @@ } } }, - "v2alpha1ContentsDrainVault": { + "spacemeshv2beta1EstimateGasRequest": { "type": "object", "properties": { - "amount": { + "transaction": { "type": "string", - "format": "uint64" - }, - "destination": { - "type": "string" - }, - "vault": { - "type": "string" - } - } - }, - "v2alpha1ContentsMultiSigSpawn": { - "type": "object", - "properties": { - "pubkey": { - "type": "array", - "items": { - "type": "string" - } - }, - "required": { - "type": "integer", - "format": "int64", - "title": "number of required signatures" + "format": "byte", + "title": "signed binary transaction" } } }, - "v2alpha1ContentsSend": { + "spacemeshv2beta1EstimateGasResponse": { "type": "object", "properties": { - "amount": { + "recommendedMaxGas": { "type": "string", - "format": "uint64", - "title": "amount in smidge" + "format": "uint64" }, - "destination": { - "type": "string", - "title": "recipient account" - } - } - }, - "v2alpha1ContentsSingleSigSpawn": { - "type": "object", - "properties": { - "pubkey": { - "type": "string" + "status": { + "$ref": "#/definitions/googlerpcStatus" } } }, - "v2alpha1ContentsVaultSpawn": { + "spacemeshv2beta1Layer": { "type": "object", "properties": { - "initialUnlockAmount": { - "type": "string", - "format": "uint64" + "block": { + "title": "layer's block", + "$ref": "#/definitions/spacemeshv2alpha1Block" }, - "owner": { - "type": "string", - "title": "owner account" + "consensusHash": { + "type": "string" }, - "totalAmount": { + "cumulativeStateHash": { "type": "string", - "format": "uint64" + "format": "byte", + "title": "cumulative fingerprint that uniquely identifies state since genesis" }, - "vestingEnd": { + "number": { "type": "integer", "format": "int64", - "title": "as layer number" + "title": "layer number - not hash - layer content may change" }, - "vestingStart": { - "type": "integer", - "format": "int64", - "title": "as layer number" - } - } - }, - "v2alpha1EstimateGasRequest": { - "type": "object", - "properties": { - "transaction": { - "type": "string", - "format": "byte", - "title": "signed binary transaction" - } - } - }, - "v2alpha1EstimateGasResponse": { - "type": "object", - "properties": { - "recommendedMaxGas": { + "stateHash": { "type": "string", - "format": "uint64" + "format": "byte", + "title": "fingerprint of the computed state at the layer" }, "status": { - "$ref": "#/definitions/googlerpcStatus" + "$ref": "#/definitions/spacemeshv2beta1LayerLayerStatus" } } }, - "v2alpha1LayerList": { + "spacemeshv2beta1LayerLayerStatus": { + "type": "string", + "title": "- LAYER_STATUS_APPLIED: applied by hare\n - LAYER_STATUS_VERIFIED: verified by tortoise", + "default": "LAYER_STATUS_UNSPECIFIED", + "enum": [ + "LAYER_STATUS_UNSPECIFIED", + "LAYER_STATUS_APPLIED", + "LAYER_STATUS_VERIFIED" + ] + }, + "spacemeshv2beta1LayerList": { "type": "object", "properties": { "layers": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/spacemeshv2alpha1Layer" + "$ref": "#/definitions/spacemeshv2beta1Layer" } } } }, - "v2alpha1LayerRequest": { + "spacemeshv2beta1LayerRequest": { "type": "object", "properties": { "endLayer": { @@ -1031,13 +1667,48 @@ } } }, - "v2alpha1NetworkInfoRequest": { + "spacemeshv2beta1NetworkInfoRequest": { "type": "object" }, - "v2alpha1NodeStatusRequest": { + "spacemeshv2beta1NetworkInfoResponse": { + "type": "object", + "properties": { + "effectiveGenesisLayer": { + "type": "integer", + "format": "int64", + "title": "effective genesis layer, i.e., first layer after genesis initialization period" + }, + "genesisId": { + "type": "string", + "format": "byte" + }, + "genesisTime": { + "type": "string", + "format": "date-time", + "title": "genesis time of the network, represented as a timestamp" + }, + "hrp": { + "type": "string" + }, + "labelsPerUnit": { + "type": "string", + "format": "uint64" + }, + "layerDuration": { + "type": "string", + "title": "duration of each layer in the network, specified as a duration" + }, + "layersPerEpoch": { + "type": "integer", + "format": "int64", + "title": "number of layers per epoch" + } + } + }, + "spacemeshv2beta1NodeStatusRequest": { "type": "object" }, - "v2alpha1NodeStatusResponse": { + "spacemeshv2beta1NodeStatusResponse": { "type": "object", "properties": { "appliedLayer": { @@ -1066,23 +1737,87 @@ "title": "last layer whose votes have been processed" }, "status": { - "$ref": "#/definitions/NodeStatusResponseSyncStatus" + "$ref": "#/definitions/spacemeshv2beta1NodeStatusResponseSyncStatus" + } + } + }, + "spacemeshv2beta1NodeStatusResponseSyncStatus": { + "type": "string", + "default": "SYNC_STATUS_UNSPECIFIED", + "enum": [ + "SYNC_STATUS_UNSPECIFIED", + "SYNC_STATUS_OFFLINE", + "SYNC_STATUS_SYNCING", + "SYNC_STATUS_SYNCED" + ] + }, + "spacemeshv2beta1ParseTransactionRequest": { + "type": "object", + "properties": { + "transaction": { + "type": "string", + "format": "byte", + "title": "signed binary transaction" + }, + "verify": { + "type": "boolean", + "title": "if true signature verification will be executed" + } + } + }, + "spacemeshv2beta1ParseTransactionResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/googlerpcStatus" + }, + "tx": { + "$ref": "#/definitions/spacemeshv2alpha1Transaction" + } + } + }, + "spacemeshv2beta1Reward": { + "type": "object", + "properties": { + "coinbase": { + "type": "string", + "title": "account awarded this reward" + }, + "layer": { + "type": "integer", + "format": "int64", + "title": "layer award was paid in" + }, + "layerReward": { + "type": "string", + "format": "uint64", + "title": "tx_fee = total - layer_reward" + }, + "smesher": { + "type": "string", + "format": "byte", + "title": "id of smesher who earned this reward" + }, + "total": { + "type": "string", + "format": "uint64", + "title": "total reward paid in smidge (sum of tx fee and layer reward)" } } }, - "v2alpha1RewardList": { + "spacemeshv2beta1RewardList": { "type": "object", "properties": { "rewards": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/spacemeshv2alpha1Reward" + "$ref": "#/definitions/spacemeshv2beta1Reward" } } } }, - "v2alpha1RewardRequest": { + "spacemeshv2beta1RewardRequest": { "type": "object", "properties": { "coinbase": { @@ -1116,50 +1851,41 @@ } } }, - "v2alpha1SortOrder": { - "type": "string", - "default": "ASC", - "enum": [ - "ASC", - "DESC" - ] + "spacemeshv2beta1SubmitTransactionRequest": { + "type": "object", + "properties": { + "transaction": { + "type": "string", + "format": "byte", + "title": "signed binary transaction" + } + } }, - "v2alpha1TransactionContents": { + "spacemeshv2beta1SubmitTransactionResponse": { "type": "object", "properties": { - "drainVault": { - "$ref": "#/definitions/v2alpha1ContentsDrainVault" - }, - "multiSigSpawn": { - "$ref": "#/definitions/v2alpha1ContentsMultiSigSpawn" - }, - "send": { - "$ref": "#/definitions/v2alpha1ContentsSend" - }, - "singleSigSpawn": { - "$ref": "#/definitions/v2alpha1ContentsSingleSigSpawn" - }, - "vaultSpawn": { - "$ref": "#/definitions/v2alpha1ContentsVaultSpawn" + "status": { + "$ref": "#/definitions/googlerpcStatus" }, - "vestingSpawn": { - "$ref": "#/definitions/v2alpha1ContentsMultiSigSpawn" + "txId": { + "type": "string", + "format": "byte" } } }, - "v2alpha1TransactionList": { + "spacemeshv2beta1TransactionList": { "type": "object", "properties": { "transactions": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v2alpha1TransactionResponse" + "$ref": "#/definitions/spacemeshv2beta1TransactionResponse" } } } }, - "v2alpha1TransactionRequest": { + "spacemeshv2beta1TransactionRequest": { "type": "object", "properties": { "address": { @@ -1208,7 +1934,7 @@ } } }, - "v2alpha1TransactionResponse": { + "spacemeshv2beta1TransactionResponse": { "type": "object", "properties": { "tx": { @@ -1221,6 +1947,117 @@ "$ref": "#/definitions/spacemeshv2alpha1TransactionState" } } + }, + "v2alpha1ContentsDrainVault": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "format": "uint64" + }, + "destination": { + "type": "string" + }, + "vault": { + "type": "string" + } + } + }, + "v2alpha1ContentsMultiSigSpawn": { + "type": "object", + "properties": { + "pubkey": { + "type": "array", + "items": { + "type": "string" + } + }, + "required": { + "type": "integer", + "format": "int64", + "title": "number of required signatures" + } + } + }, + "v2alpha1ContentsSend": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "format": "uint64", + "title": "amount in smidge" + }, + "destination": { + "type": "string", + "title": "recipient account" + } + } + }, + "v2alpha1ContentsSingleSigSpawn": { + "type": "object", + "properties": { + "pubkey": { + "type": "string" + } + } + }, + "v2alpha1ContentsVaultSpawn": { + "type": "object", + "properties": { + "initialUnlockAmount": { + "type": "string", + "format": "uint64" + }, + "owner": { + "type": "string", + "title": "owner account" + }, + "totalAmount": { + "type": "string", + "format": "uint64" + }, + "vestingEnd": { + "type": "integer", + "format": "int64", + "title": "as layer number" + }, + "vestingStart": { + "type": "integer", + "format": "int64", + "title": "as layer number" + } + } + }, + "v2alpha1SortOrder": { + "type": "string", + "default": "ASC", + "enum": [ + "ASC", + "DESC" + ] + }, + "v2alpha1TransactionContents": { + "type": "object", + "properties": { + "drainVault": { + "$ref": "#/definitions/v2alpha1ContentsDrainVault" + }, + "multiSigSpawn": { + "$ref": "#/definitions/v2alpha1ContentsMultiSigSpawn" + }, + "send": { + "$ref": "#/definitions/v2alpha1ContentsSend" + }, + "singleSigSpawn": { + "$ref": "#/definitions/v2alpha1ContentsSingleSigSpawn" + }, + "vaultSpawn": { + "$ref": "#/definitions/v2alpha1ContentsVaultSpawn" + }, + "vestingSpawn": { + "$ref": "#/definitions/v2alpha1ContentsMultiSigSpawn" + } + } } }, "tags": [ diff --git a/spacemesh/v2beta1/account.proto b/spacemesh/v2beta1/account.proto new file mode 100644 index 00000000..7e0ebeab --- /dev/null +++ b/spacemesh/v2beta1/account.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/account.proto"; + +package spacemesh.v2beta1; + +message AccountRequest { + repeated string addresses = 1; + uint64 offset = 2; // adjusts the starting point for data + uint64 limit = 3; // specifies max number of items to fetch// bech32 format including HRP +}; + +message AccountList { + repeated spacemesh.v2alpha1.Account accounts = 1; +} + +service AccountService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(AccountRequest) returns (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..72141df9 --- /dev/null +++ b/spacemesh/v2beta1/activation.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/activation.proto"; + +package spacemesh.v2beta1; + +message ActivationStreamRequest { + uint32 start_epoch = 1; // Apply `start_epoch/end_epoch` filters together with `coinbase` filter for better performance. + uint32 end_epoch = 2; + repeated bytes id = 3; + repeated bytes smesher_id = 4; + string coinbase = 5; // `coinbase` filter is not supported by database index and will result in sequential scan. + bool watch = 6; +} + +message Activation { + bytes id = 1; + bytes smesher_id = 2; + uint32 publish_epoch = 3; + string coinbase = 4; + uint64 weight = 5; + uint64 height = 6; + uint32 num_units = 7; // number of effective PoST data commitment units +} + +service ActivationStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(ActivationStreamRequest) returns (stream Activation); +} + +message ActivationRequest { + uint32 start_epoch = 1; // Apply `start_epoch/end_epoch` filters together with `coinbase` filter for better performance. + uint32 end_epoch = 2; + repeated bytes id = 3; + repeated bytes smesher_id = 4; + string coinbase = 5; // `coinbase` filter is not supported by database index and will result in sequential scan. + uint64 offset = 6; + uint64 limit = 7; +} + +message ActivationList { + repeated spacemesh.v2alpha1.Activation activations = 1; +} + +message ActivationsCountRequest { + optional uint32 epoch = 1; +} + +message ActivationsCountResponse { + uint32 count = 1; +} + +service ActivationService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(ActivationRequest) returns (ActivationList); + rpc ActivationsCount(ActivationsCountRequest) returns (ActivationsCountResponse); +} diff --git a/spacemesh/v2beta1/layer.proto b/spacemesh/v2beta1/layer.proto new file mode 100644 index 00000000..d2be550d --- /dev/null +++ b/spacemesh/v2beta1/layer.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/layer.proto"; +import "spacemesh/v2alpha1/block.proto"; +import "spacemesh/v2alpha1/v2alpha1.proto"; + +package spacemesh.v2beta1; + +message LayerRequest { + uint32 start_layer = 1; + uint32 end_layer = 2; + uint64 offset = 3; // adjusts the starting point for data + uint64 limit = 4; // specifies max number of items to fetch + spacemesh.v2alpha1.SortOrder sort_order = 5; // specifies the sort order (default is ASC) +}; + +message LayerList { + repeated Layer layers = 1; +} + +service LayerService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(LayerRequest) returns (LayerList); +} + +message Layer { + uint32 number = 1; // layer number - not hash - layer content may change + enum LayerStatus { + LAYER_STATUS_UNSPECIFIED = 0; + LAYER_STATUS_APPLIED = 1; // applied by hare + LAYER_STATUS_VERIFIED = 2; // verified by tortoise + } + LayerStatus status = 2; + string consensus_hash = 3; + bytes state_hash = 4; // fingerprint of the computed state at the layer + bytes cumulative_state_hash = 5; // cumulative fingerprint that uniquely identifies state since genesis + spacemesh.v2alpha1.Block block = 6; // layer's block +} + +message LayerStreamRequest { + uint32 start_layer = 1; + uint32 end_layer = 2; + bool watch = 3; +}; + +service LayerStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(LayerStreamRequest) returns (stream 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..909c72cb --- /dev/null +++ b/spacemesh/v2beta1/network.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/network.proto"; + +package spacemesh.v2beta1; + +message NetworkInfoResponse { + google.protobuf.Timestamp genesis_time = 1; // genesis time of the network, represented as a timestamp + google.protobuf.Duration layer_duration = 3; // duration of each layer in the network, specified as a duration + bytes genesis_id = 4; + string hrp = 5; + uint32 effective_genesis_layer = 6; // effective genesis layer, i.e., first layer after genesis initialization period + uint32 layers_per_epoch = 7; // number of layers per epoch + uint64 labels_per_unit = 8; +} + +message NetworkInfoRequest {} + +service NetworkService { + option (google.api.api_visibility).restriction = "V2"; + + rpc Info(NetworkInfoRequest) returns (NetworkInfoResponse); +} diff --git a/spacemesh/v2beta1/node.proto b/spacemesh/v2beta1/node.proto new file mode 100644 index 00000000..07d15fdd --- /dev/null +++ b/spacemesh/v2beta1/node.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/node.proto"; + +package spacemesh.v2beta1; + +message NodeStatusResponse { + uint64 connected_peers = 1; // number of connected neighbors + enum SyncStatus { + SYNC_STATUS_UNSPECIFIED = 0; + SYNC_STATUS_OFFLINE = 1; + SYNC_STATUS_SYNCING = 2; + SYNC_STATUS_SYNCED = 3; + } + SyncStatus status = 2; + uint32 latest_layer = 3; // latest layer node has seen from blocks + uint32 applied_layer = 4; // last layer node has applied to the state + uint32 processed_layer = 5; // last layer whose votes have been processed + uint32 current_layer = 6; // current layer, based on clock time +} + +message NodeStatusRequest {} + +service NodeService { + option (google.api.api_visibility).restriction = "V2"; + + rpc Status(NodeStatusRequest) returns (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..b05a6472 --- /dev/null +++ b/spacemesh/v2beta1/reward.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/reward.proto"; +import "spacemesh/v2alpha1/v2alpha1.proto"; + +package spacemesh.v2beta1; + +message Reward { + uint32 layer = 1; // layer award was paid in + uint64 total = 2; // total reward paid in smidge (sum of tx fee and layer reward) + uint64 layer_reward = 3; // tx_fee = total - layer_reward + string coinbase = 5; // account awarded this reward + bytes smesher = 6; // id of smesher who earned this reward +} + +message RewardRequest { + uint32 start_layer = 1; + uint32 end_layer = 2; + oneof filter_by { + string coinbase = 3; + bytes smesher = 4; + } + uint64 offset = 5; // adjusts the starting point for data + uint64 limit = 6; // specifies max number of items to fetch + spacemesh.v2alpha1.SortOrder sort_order = 7; // specifies the sort order by layer (default is ASC) +} + +message RewardList { + repeated Reward rewards = 1; +} + +service RewardService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(RewardRequest) returns (RewardList); +} + +message RewardStreamRequest { + uint32 start_layer = 1; + uint32 end_layer = 2; + oneof filter_by { + string coinbase = 3; + bytes smesher = 4; + } + bool watch = 5; +} + + +service RewardStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(RewardStreamRequest) returns (stream 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..3bdf0e02 --- /dev/null +++ b/spacemesh/v2beta1/tx.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +import "google/rpc/status.proto"; +import "google/api/visibility.proto"; +import "spacemesh/v2alpha1/tx.proto"; +import "spacemesh/v2alpha1/v2alpha1.proto"; + +package spacemesh.v2beta1; + +message TransactionStreamRequest { + uint32 start_layer = 1; // Required: starting layer for transaction streaming. + optional uint32 end_layer = 2; // Ending layer for transaction streaming. + repeated bytes txid = 3; // Filter: specific transaction IDs. + optional string principal = 4; // Filter by principal address + bool watch = 5; // Continue watching for new transactions. +} + + +service TransactionStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(TransactionStreamRequest) returns (stream TransactionResponse); +} + +message TransactionRequest { + optional uint32 start_layer = 1; // Starting layer for transactions. + optional uint32 end_layer = 2; // Ending layer for transactions. + repeated bytes txid = 3; // Filter: specific transaction IDs to filter. + optional string address = 4; // Filter by address (principal or recipient) + uint64 offset = 6; // Adjusts the starting point for data retrieval. + uint64 limit = 7; // Specifies maximum number of items to fetch. + bool include_state = 8; // Whether to include transaction state in response. + bool include_result = 9; // Whether to include result of transactions in response. + spacemesh.v2alpha1.SortOrder sort_order = 10; // specifies the sort order by layer (default is ASC) +} + +message TransactionResponse { + spacemesh.v2alpha1.Transaction tx = 1; + spacemesh.v2alpha1.TransactionResult tx_result = 2; + optional spacemesh.v2alpha1.TransactionState tx_state = 3; +} + +message TransactionList { + repeated TransactionResponse transactions = 1; +} + +message ParseTransactionRequest { + bytes transaction = 1; // signed binary transaction + bool verify = 2; // if true signature verification will be executed +} + +message ParseTransactionResponse { + google.rpc.Status status = 1; + spacemesh.v2alpha1.Transaction tx = 2; +} + +message SubmitTransactionRequest { + bytes transaction = 1; // signed binary transaction +} + +message SubmitTransactionResponse { + google.rpc.Status status = 1; + bytes tx_id = 2; +} + +message EstimateGasRequest { + bytes transaction = 1; // signed binary transaction +} + +message EstimateGasResponse { + google.rpc.Status status = 1; + uint64 recommended_max_gas = 2; +} + +service TransactionService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(TransactionRequest) returns (TransactionList); + rpc ParseTransaction(ParseTransactionRequest) returns (ParseTransactionResponse); + rpc SubmitTransaction(SubmitTransactionRequest) returns (SubmitTransactionResponse); + rpc EstimateGas(EstimateGasRequest) returns (EstimateGasResponse); +} \ No newline at end of file