diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ddf584967fa..c7c84a5cf27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -734,6 +734,7 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8 * (upgrade) [#12603](https://github.com/cosmos/cosmos-sdk/pull/12603) feat: Move AppModule.BeginBlock and AppModule.EndBlock to extension interfaces * (telemetry) [#12405](https://github.com/cosmos/cosmos-sdk/pull/12405) Add *query* calls metric to telemetry. * (query) [#12253](https://github.com/cosmos/cosmos-sdk/pull/12253) Add `GenericFilteredPaginate` to the `query` package to improve UX. +* (client) [#15597](https://github.com/cosmos/cosmos-sdk/pull/15597) Add status endpoint for clients ### API Breaking Changes @@ -809,6 +810,7 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8 * [#11334](https://github.com/cosmos/cosmos-sdk/pull/11334) Move `x/gov/types/v1beta2` to `x/gov/types/v1`. * (x/auth/middleware) [#11413](https://github.com/cosmos/cosmos-sdk/pull/11413) Refactor tx middleware to be extensible on tx fee logic. Merged `MempoolFeeMiddleware` and `TxPriorityMiddleware` functionalities into `DeductFeeMiddleware`, make the logic extensible using the `TxFeeChecker` option, the current fee logic is preserved by the default `checkTxFeeWithValidatorMinGasPrices` implementation. Change `RejectExtensionOptionsMiddleware` to `NewExtensionOptionsMiddleware` which is extensible with the `ExtensionOptionChecker` option. Unpack the tx extension options `Any`s to interface `TxExtensionOptionI`. * (migrations) [#11556](https://github.com/cosmos/cosmos-sdk/pull/11556#issuecomment-1091385011) Remove migration code from 0.42 and below. To use previous migrations, checkout previous versions of the cosmos-sdk. +* (client) [#15597](https://github.com/cosmos/cosmos-sdk/pull/15597) `RegisterNodeService` now requires a config parameter ### Client Breaking Changes diff --git a/api/cosmos/base/node/v1beta1/query.pulsar.go b/api/cosmos/base/node/v1beta1/query.pulsar.go index 600b4d5d3668..ff8148beebbb 100644 --- a/api/cosmos/base/node/v1beta1/query.pulsar.go +++ b/api/cosmos/base/node/v1beta1/query.pulsar.go @@ -4,10 +4,12 @@ package nodev1beta1 import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -370,14 +372,18 @@ func (x *fastReflection_ConfigRequest) ProtoMethods() *protoiface.Methods { } var ( - md_ConfigResponse protoreflect.MessageDescriptor - fd_ConfigResponse_minimum_gas_price protoreflect.FieldDescriptor + md_ConfigResponse protoreflect.MessageDescriptor + fd_ConfigResponse_minimum_gas_price protoreflect.FieldDescriptor + fd_ConfigResponse_pruning_keep_recent protoreflect.FieldDescriptor + fd_ConfigResponse_pruning_interval protoreflect.FieldDescriptor ) func init() { file_cosmos_base_node_v1beta1_query_proto_init() md_ConfigResponse = File_cosmos_base_node_v1beta1_query_proto.Messages().ByName("ConfigResponse") fd_ConfigResponse_minimum_gas_price = md_ConfigResponse.Fields().ByName("minimum_gas_price") + fd_ConfigResponse_pruning_keep_recent = md_ConfigResponse.Fields().ByName("pruning_keep_recent") + fd_ConfigResponse_pruning_interval = md_ConfigResponse.Fields().ByName("pruning_interval") } var _ protoreflect.Message = (*fastReflection_ConfigResponse)(nil) @@ -451,6 +457,938 @@ func (x *fastReflection_ConfigResponse) Range(f func(protoreflect.FieldDescripto return } } + if x.PruningKeepRecent != "" { + value := protoreflect.ValueOfString(x.PruningKeepRecent) + if !f(fd_ConfigResponse_pruning_keep_recent, value) { + return + } + } + if x.PruningInterval != "" { + value := protoreflect.ValueOfString(x.PruningInterval) + if !f(fd_ConfigResponse_pruning_interval, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ConfigResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": + return x.MinimumGasPrice != "" + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_keep_recent": + return x.PruningKeepRecent != "" + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": + return x.PruningInterval != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": + x.MinimumGasPrice = "" + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_keep_recent": + x.PruningKeepRecent = "" + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": + x.PruningInterval = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ConfigResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": + value := x.MinimumGasPrice + return protoreflect.ValueOfString(value) + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_keep_recent": + value := x.PruningKeepRecent + return protoreflect.ValueOfString(value) + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": + value := x.PruningInterval + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": + x.MinimumGasPrice = value.Interface().(string) + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_keep_recent": + x.PruningKeepRecent = value.Interface().(string) + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": + x.PruningInterval = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": + panic(fmt.Errorf("field minimum_gas_price of message cosmos.base.node.v1beta1.ConfigResponse is not mutable")) + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_keep_recent": + panic(fmt.Errorf("field pruning_keep_recent of message cosmos.base.node.v1beta1.ConfigResponse is not mutable")) + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": + panic(fmt.Errorf("field pruning_interval of message cosmos.base.node.v1beta1.ConfigResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ConfigResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": + return protoreflect.ValueOfString("") + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_keep_recent": + return protoreflect.ValueOfString("") + case "cosmos.base.node.v1beta1.ConfigResponse.pruning_interval": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ConfigResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v1beta1.ConfigResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ConfigResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ConfigResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ConfigResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.MinimumGasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PruningKeepRecent) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PruningInterval) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ConfigResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.PruningInterval) > 0 { + i -= len(x.PruningInterval) + copy(dAtA[i:], x.PruningInterval) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PruningInterval))) + i-- + dAtA[i] = 0x1a + } + if len(x.PruningKeepRecent) > 0 { + i -= len(x.PruningKeepRecent) + copy(dAtA[i:], x.PruningKeepRecent) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PruningKeepRecent))) + i-- + dAtA[i] = 0x12 + } + if len(x.MinimumGasPrice) > 0 { + i -= len(x.MinimumGasPrice) + copy(dAtA[i:], x.MinimumGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinimumGasPrice))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ConfigResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MinimumGasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PruningKeepRecent", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.PruningKeepRecent = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PruningInterval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.PruningInterval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_StatusRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_base_node_v1beta1_query_proto_init() + md_StatusRequest = File_cosmos_base_node_v1beta1_query_proto.Messages().ByName("StatusRequest") +} + +var _ protoreflect.Message = (*fastReflection_StatusRequest)(nil) + +type fastReflection_StatusRequest StatusRequest + +func (x *StatusRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_StatusRequest)(x) +} + +func (x *StatusRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_node_v1beta1_query_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) +} + +var _fastReflection_StatusRequest_messageType fastReflection_StatusRequest_messageType +var _ protoreflect.MessageType = fastReflection_StatusRequest_messageType{} + +type fastReflection_StatusRequest_messageType struct{} + +func (x fastReflection_StatusRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_StatusRequest)(nil) +} +func (x fastReflection_StatusRequest_messageType) New() protoreflect.Message { + return new(fastReflection_StatusRequest) +} +func (x fastReflection_StatusRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_StatusRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_StatusRequest) Descriptor() protoreflect.MessageDescriptor { + return md_StatusRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_StatusRequest) Type() protoreflect.MessageType { + return _fastReflection_StatusRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_StatusRequest) New() protoreflect.Message { + return new(fastReflection_StatusRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_StatusRequest) Interface() protoreflect.ProtoMessage { + return (*StatusRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_StatusRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_StatusRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_StatusRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_StatusRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_StatusRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v1beta1.StatusRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_StatusRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_StatusRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_StatusRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*StatusRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*StatusRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*StatusRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_StatusResponse protoreflect.MessageDescriptor + fd_StatusResponse_earliest_store_height protoreflect.FieldDescriptor + fd_StatusResponse_height protoreflect.FieldDescriptor + fd_StatusResponse_timestamp protoreflect.FieldDescriptor + fd_StatusResponse_app_hash protoreflect.FieldDescriptor + fd_StatusResponse_validator_hash protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_node_v1beta1_query_proto_init() + md_StatusResponse = File_cosmos_base_node_v1beta1_query_proto.Messages().ByName("StatusResponse") + fd_StatusResponse_earliest_store_height = md_StatusResponse.Fields().ByName("earliest_store_height") + fd_StatusResponse_height = md_StatusResponse.Fields().ByName("height") + fd_StatusResponse_timestamp = md_StatusResponse.Fields().ByName("timestamp") + fd_StatusResponse_app_hash = md_StatusResponse.Fields().ByName("app_hash") + fd_StatusResponse_validator_hash = md_StatusResponse.Fields().ByName("validator_hash") +} + +var _ protoreflect.Message = (*fastReflection_StatusResponse)(nil) + +type fastReflection_StatusResponse StatusResponse + +func (x *StatusResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_StatusResponse)(x) +} + +func (x *StatusResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_node_v1beta1_query_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) +} + +var _fastReflection_StatusResponse_messageType fastReflection_StatusResponse_messageType +var _ protoreflect.MessageType = fastReflection_StatusResponse_messageType{} + +type fastReflection_StatusResponse_messageType struct{} + +func (x fastReflection_StatusResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_StatusResponse)(nil) +} +func (x fastReflection_StatusResponse_messageType) New() protoreflect.Message { + return new(fastReflection_StatusResponse) +} +func (x fastReflection_StatusResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_StatusResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_StatusResponse) Descriptor() protoreflect.MessageDescriptor { + return md_StatusResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_StatusResponse) Type() protoreflect.MessageType { + return _fastReflection_StatusResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_StatusResponse) New() protoreflect.Message { + return new(fastReflection_StatusResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_StatusResponse) Interface() protoreflect.ProtoMessage { + return (*StatusResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_StatusResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EarliestStoreHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.EarliestStoreHeight) + if !f(fd_StatusResponse_earliest_store_height, value) { + return + } + } + if x.Height != uint64(0) { + value := protoreflect.ValueOfUint64(x.Height) + if !f(fd_StatusResponse_height, value) { + return + } + } + if x.Timestamp != nil { + value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + if !f(fd_StatusResponse_timestamp, value) { + return + } + } + if len(x.AppHash) != 0 { + value := protoreflect.ValueOfBytes(x.AppHash) + if !f(fd_StatusResponse_app_hash, value) { + return + } + } + if len(x.ValidatorHash) != 0 { + value := protoreflect.ValueOfBytes(x.ValidatorHash) + if !f(fd_StatusResponse_validator_hash, value) { + return + } + } } // Has reports whether a field is populated. @@ -464,15 +1402,23 @@ func (x *fastReflection_ConfigResponse) Range(f func(protoreflect.FieldDescripto // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_ConfigResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_StatusResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": - return x.MinimumGasPrice != "" + case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": + return x.EarliestStoreHeight != uint64(0) + case "cosmos.base.node.v1beta1.StatusResponse.height": + return x.Height != uint64(0) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + return x.Timestamp != nil + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + return len(x.AppHash) != 0 + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + return len(x.ValidatorHash) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) } - panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusResponse does not contain field %s", fd.FullName())) } } @@ -482,15 +1428,23 @@ func (x *fastReflection_ConfigResponse) Has(fd protoreflect.FieldDescriptor) boo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConfigResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_StatusResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": - x.MinimumGasPrice = "" + case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": + x.EarliestStoreHeight = uint64(0) + case "cosmos.base.node.v1beta1.StatusResponse.height": + x.Height = uint64(0) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + x.Timestamp = nil + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + x.AppHash = nil + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + x.ValidatorHash = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) } - panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusResponse does not contain field %s", fd.FullName())) } } @@ -500,16 +1454,28 @@ func (x *fastReflection_ConfigResponse) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_ConfigResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_StatusResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": - value := x.MinimumGasPrice - return protoreflect.ValueOfString(value) + case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": + value := x.EarliestStoreHeight + return protoreflect.ValueOfUint64(value) + case "cosmos.base.node.v1beta1.StatusResponse.height": + value := x.Height + return protoreflect.ValueOfUint64(value) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + value := x.Timestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + value := x.AppHash + return protoreflect.ValueOfBytes(value) + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + value := x.ValidatorHash + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) } - panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusResponse does not contain field %s", descriptor.FullName())) } } @@ -523,15 +1489,23 @@ func (x *fastReflection_ConfigResponse) Get(descriptor protoreflect.FieldDescrip // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConfigResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_StatusResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": - x.MinimumGasPrice = value.Interface().(string) + case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": + x.EarliestStoreHeight = value.Uint() + case "cosmos.base.node.v1beta1.StatusResponse.height": + x.Height = value.Uint() + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + x.AppHash = value.Bytes() + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + x.ValidatorHash = value.Bytes() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) } - panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusResponse does not contain field %s", fd.FullName())) } } @@ -545,40 +1519,60 @@ func (x *fastReflection_ConfigResponse) Set(fd protoreflect.FieldDescriptor, val // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConfigResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_StatusResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": - panic(fmt.Errorf("field minimum_gas_price of message cosmos.base.node.v1beta1.ConfigResponse is not mutable")) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + if x.Timestamp == nil { + x.Timestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": + panic(fmt.Errorf("field earliest_store_height of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) + case "cosmos.base.node.v1beta1.StatusResponse.height": + panic(fmt.Errorf("field height of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + panic(fmt.Errorf("field app_hash of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + panic(fmt.Errorf("field validator_hash of message cosmos.base.node.v1beta1.StatusResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) } - panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_ConfigResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_StatusResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.base.node.v1beta1.ConfigResponse.minimum_gas_price": - return protoreflect.ValueOfString("") + case "cosmos.base.node.v1beta1.StatusResponse.earliest_store_height": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.base.node.v1beta1.StatusResponse.height": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.base.node.v1beta1.StatusResponse.timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.base.node.v1beta1.StatusResponse.app_hash": + return protoreflect.ValueOfBytes(nil) + case "cosmos.base.node.v1beta1.StatusResponse.validator_hash": + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.ConfigResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v1beta1.StatusResponse")) } - panic(fmt.Errorf("message cosmos.base.node.v1beta1.ConfigResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.base.node.v1beta1.StatusResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_ConfigResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_StatusResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v1beta1.ConfigResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v1beta1.StatusResponse", d.FullName())) } panic("unreachable") } @@ -586,7 +1580,7 @@ func (x *fastReflection_ConfigResponse) WhichOneof(d protoreflect.OneofDescripto // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_ConfigResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_StatusResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -597,7 +1591,7 @@ func (x *fastReflection_ConfigResponse) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConfigResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_StatusResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -609,7 +1603,7 @@ func (x *fastReflection_ConfigResponse) SetUnknown(fields protoreflect.RawFields // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_ConfigResponse) IsValid() bool { +func (x *fastReflection_StatusResponse) IsValid() bool { return x != nil } @@ -619,9 +1613,9 @@ func (x *fastReflection_ConfigResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ConfigResponse) + x := input.Message.Interface().(*StatusResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -633,7 +1627,21 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.MinimumGasPrice) + if x.EarliestStoreHeight != 0 { + n += 1 + runtime.Sov(uint64(x.EarliestStoreHeight)) + } + if x.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.Timestamp != nil { + l = options.Size(x.Timestamp) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AppHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ValidatorHash) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -647,7 +1655,7 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ConfigResponse) + x := input.Message.Interface().(*StatusResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -666,12 +1674,43 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.MinimumGasPrice) > 0 { - i -= len(x.MinimumGasPrice) - copy(dAtA[i:], x.MinimumGasPrice) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinimumGasPrice))) + if len(x.ValidatorHash) > 0 { + i -= len(x.ValidatorHash) + copy(dAtA[i:], x.ValidatorHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorHash))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x2a + } + if len(x.AppHash) > 0 { + i -= len(x.AppHash) + copy(dAtA[i:], x.AppHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppHash))) + i-- + dAtA[i] = 0x22 + } + if x.Timestamp != nil { + encoded, err := options.Marshal(x.Timestamp) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x10 + } + if x.EarliestStoreHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EarliestStoreHeight)) + i-- + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -684,7 +1723,7 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ConfigResponse) + x := input.Message.Interface().(*StatusResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -716,17 +1755,55 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EarliestStoreHeight", wireType) + } + x.EarliestStoreHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.EarliestStoreHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrice", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -736,23 +1813,95 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.MinimumGasPrice = string(dAtA[iNdEx:postIndex]) + if x.Timestamp == nil { + x.Timestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AppHash = append(x.AppHash[:0], dAtA[iNdEx:postIndex]...) + if x.AppHash == nil { + x.AppHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ValidatorHash = append(x.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) + if x.ValidatorHash == nil { + x.ValidatorHash = []byte{} + } iNdEx = postIndex default: iNdEx = preIndex @@ -836,6 +1985,9 @@ type ConfigResponse struct { unknownFields protoimpl.UnknownFields MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` + // pruning settings + PruningKeepRecent string `protobuf:"bytes,2,opt,name=pruning_keep_recent,json=pruningKeepRecent,proto3" json:"pruning_keep_recent,omitempty"` + PruningInterval string `protobuf:"bytes,3,opt,name=pruning_interval,json=pruningInterval,proto3" json:"pruning_interval,omitempty"` } func (x *ConfigResponse) Reset() { @@ -865,6 +2017,115 @@ func (x *ConfigResponse) GetMinimumGasPrice() string { return "" } +func (x *ConfigResponse) GetPruningKeepRecent() string { + if x != nil { + return x.PruningKeepRecent + } + return "" +} + +func (x *ConfigResponse) GetPruningInterval() string { + if x != nil { + return x.PruningInterval + } + return "" +} + +// StateRequest defines the request structure for the status of a node. +type StatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StatusRequest) Reset() { + *x = StatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_node_v1beta1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusRequest) ProtoMessage() {} + +// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. +func (*StatusRequest) Descriptor() ([]byte, []int) { + return file_cosmos_base_node_v1beta1_query_proto_rawDescGZIP(), []int{2} +} + +// StateResponse defines the response structure for the status of a node. +type StatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` // earliest block height available in the store + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // current block height + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // block height timestamp + AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` // app hash of the current block + ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` // validator hash provided by the consensus header +} + +func (x *StatusResponse) Reset() { + *x = StatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_node_v1beta1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusResponse) ProtoMessage() {} + +// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. +func (*StatusResponse) Descriptor() ([]byte, []int) { + return file_cosmos_base_node_v1beta1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *StatusResponse) GetEarliestStoreHeight() uint64 { + if x != nil { + return x.EarliestStoreHeight + } + return 0 +} + +func (x *StatusResponse) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *StatusResponse) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *StatusResponse) GetAppHash() []byte { + if x != nil { + return x.AppHash + } + return nil +} + +func (x *StatusResponse) GetValidatorHash() []byte { + if x != nil { + return x.ValidatorHash + } + return nil +} + var File_cosmos_base_node_v1beta1_query_proto protoreflect.FileDescriptor var file_cosmos_base_node_v1beta1_query_proto_rawDesc = []byte{ @@ -873,36 +2134,69 @@ var file_cosmos_base_node_v1beta1_query_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0f, - 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x3c, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, - 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x69, - 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x32, 0x91, 0x01, - 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, - 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, - 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x42, 0xe4, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, - 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6e, 0x6f, 0x64, 0x65, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x18, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, - 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, - 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x97, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, + 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x61, 0x73, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, + 0x5f, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x65, 0x70, 0x52, + 0x65, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, + 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0xde, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, + 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 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, 0x42, + 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, + 0x73, 0x68, 0x32, 0x99, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, + 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x85, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0xe4, + 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, + 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, + 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -917,19 +2211,25 @@ func file_cosmos_base_node_v1beta1_query_proto_rawDescGZIP() []byte { return file_cosmos_base_node_v1beta1_query_proto_rawDescData } -var file_cosmos_base_node_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_base_node_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_cosmos_base_node_v1beta1_query_proto_goTypes = []interface{}{ - (*ConfigRequest)(nil), // 0: cosmos.base.node.v1beta1.ConfigRequest - (*ConfigResponse)(nil), // 1: cosmos.base.node.v1beta1.ConfigResponse + (*ConfigRequest)(nil), // 0: cosmos.base.node.v1beta1.ConfigRequest + (*ConfigResponse)(nil), // 1: cosmos.base.node.v1beta1.ConfigResponse + (*StatusRequest)(nil), // 2: cosmos.base.node.v1beta1.StatusRequest + (*StatusResponse)(nil), // 3: cosmos.base.node.v1beta1.StatusResponse + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp } var file_cosmos_base_node_v1beta1_query_proto_depIdxs = []int32{ - 0, // 0: cosmos.base.node.v1beta1.Service.Config:input_type -> cosmos.base.node.v1beta1.ConfigRequest - 1, // 1: cosmos.base.node.v1beta1.Service.Config:output_type -> cosmos.base.node.v1beta1.ConfigResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 4, // 0: cosmos.base.node.v1beta1.StatusResponse.timestamp:type_name -> google.protobuf.Timestamp + 0, // 1: cosmos.base.node.v1beta1.Service.Config:input_type -> cosmos.base.node.v1beta1.ConfigRequest + 2, // 2: cosmos.base.node.v1beta1.Service.Status:input_type -> cosmos.base.node.v1beta1.StatusRequest + 1, // 3: cosmos.base.node.v1beta1.Service.Config:output_type -> cosmos.base.node.v1beta1.ConfigResponse + 3, // 4: cosmos.base.node.v1beta1.Service.Status:output_type -> cosmos.base.node.v1beta1.StatusResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] 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_cosmos_base_node_v1beta1_query_proto_init() } @@ -962,6 +2262,30 @@ func file_cosmos_base_node_v1beta1_query_proto_init() { return nil } } + file_cosmos_base_node_v1beta1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_node_v1beta1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusResponse); 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{ @@ -969,7 +2293,7 @@ func file_cosmos_base_node_v1beta1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_base_node_v1beta1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/base/node/v1beta1/query_grpc.pb.go b/api/cosmos/base/node/v1beta1/query_grpc.pb.go index c98b25f0e90c..cc79672ab921 100644 --- a/api/cosmos/base/node/v1beta1/query_grpc.pb.go +++ b/api/cosmos/base/node/v1beta1/query_grpc.pb.go @@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( Service_Config_FullMethodName = "/cosmos.base.node.v1beta1.Service/Config" + Service_Status_FullMethodName = "/cosmos.base.node.v1beta1.Service/Status" ) // ServiceClient is the client API for Service service. @@ -28,6 +29,8 @@ const ( type ServiceClient interface { // Config queries for the operator configuration. Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) + // Status queries for the node status. + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) } type serviceClient struct { @@ -47,12 +50,23 @@ func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...g return out, nil } +func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, Service_Status_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ServiceServer is the server API for Service service. // All implementations must embed UnimplementedServiceServer // for forward compatibility type ServiceServer interface { // Config queries for the operator configuration. Config(context.Context, *ConfigRequest) (*ConfigResponse, error) + // Status queries for the node status. + Status(context.Context, *StatusRequest) (*StatusResponse, error) mustEmbedUnimplementedServiceServer() } @@ -63,6 +77,9 @@ type UnimplementedServiceServer struct { func (UnimplementedServiceServer) Config(context.Context, *ConfigRequest) (*ConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") } +func (UnimplementedServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} // UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. @@ -94,6 +111,24 @@ func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_Status_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Service_ServiceDesc is the grpc.ServiceDesc for Service service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -105,6 +140,10 @@ var Service_ServiceDesc = grpc.ServiceDesc{ MethodName: "Config", Handler: _Service_Config_Handler, }, + { + MethodName: "Status", + Handler: _Service_Status_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/base/node/v1beta1/query.proto", diff --git a/client/grpc/node/query.pb.go b/client/grpc/node/query.pb.go index e0c097fd8ef6..8e56808aa627 100644 --- a/client/grpc/node/query.pb.go +++ b/client/grpc/node/query.pb.go @@ -6,21 +6,26 @@ package node import ( context "context" fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -68,6 +73,9 @@ var xxx_messageInfo_ConfigRequest proto.InternalMessageInfo // ConfigResponse defines the response structure for the Config gRPC query. type ConfigResponse struct { MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` + // pruning settings + PruningKeepRecent string `protobuf:"bytes,2,opt,name=pruning_keep_recent,json=pruningKeepRecent,proto3" json:"pruning_keep_recent,omitempty"` + PruningInterval string `protobuf:"bytes,3,opt,name=pruning_interval,json=pruningInterval,proto3" json:"pruning_interval,omitempty"` } func (m *ConfigResponse) Reset() { *m = ConfigResponse{} } @@ -110,9 +118,139 @@ func (m *ConfigResponse) GetMinimumGasPrice() string { return "" } +func (m *ConfigResponse) GetPruningKeepRecent() string { + if m != nil { + return m.PruningKeepRecent + } + return "" +} + +func (m *ConfigResponse) GetPruningInterval() string { + if m != nil { + return m.PruningInterval + } + return "" +} + +// StateRequest defines the request structure for the status of a node. +type StatusRequest struct { +} + +func (m *StatusRequest) Reset() { *m = StatusRequest{} } +func (m *StatusRequest) String() string { return proto.CompactTextString(m) } +func (*StatusRequest) ProtoMessage() {} +func (*StatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8324226a07064341, []int{2} +} +func (m *StatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusRequest.Merge(m, src) +} +func (m *StatusRequest) XXX_Size() int { + return m.Size() +} +func (m *StatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusRequest proto.InternalMessageInfo + +// StateResponse defines the response structure for the status of a node. +type StatusResponse struct { + EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Timestamp *time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` + AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` +} + +func (m *StatusResponse) Reset() { *m = StatusResponse{} } +func (m *StatusResponse) String() string { return proto.CompactTextString(m) } +func (*StatusResponse) ProtoMessage() {} +func (*StatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8324226a07064341, []int{3} +} +func (m *StatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusResponse.Merge(m, src) +} +func (m *StatusResponse) XXX_Size() int { + return m.Size() +} +func (m *StatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo + +func (m *StatusResponse) GetEarliestStoreHeight() uint64 { + if m != nil { + return m.EarliestStoreHeight + } + return 0 +} + +func (m *StatusResponse) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *StatusResponse) GetTimestamp() *time.Time { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *StatusResponse) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +func (m *StatusResponse) GetValidatorHash() []byte { + if m != nil { + return m.ValidatorHash + } + return nil +} + func init() { proto.RegisterType((*ConfigRequest)(nil), "cosmos.base.node.v1beta1.ConfigRequest") proto.RegisterType((*ConfigResponse)(nil), "cosmos.base.node.v1beta1.ConfigResponse") + proto.RegisterType((*StatusRequest)(nil), "cosmos.base.node.v1beta1.StatusRequest") + proto.RegisterType((*StatusResponse)(nil), "cosmos.base.node.v1beta1.StatusResponse") } func init() { @@ -120,25 +258,39 @@ func init() { } var fileDescriptor_8324226a07064341 = []byte{ - // 282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xb1, 0x4b, 0xc3, 0x40, - 0x18, 0xc5, 0x73, 0x0e, 0x15, 0x0f, 0xb4, 0x98, 0xa9, 0x14, 0x39, 0x4a, 0x10, 0x0c, 0x42, 0xef, - 0xa8, 0xae, 0x4e, 0x3a, 0x74, 0x95, 0xba, 0xb9, 0x94, 0xcb, 0xf5, 0xf3, 0x3c, 0x6c, 0xee, 0x4b, - 0x73, 0x97, 0x82, 0xab, 0xe0, 0xae, 0xf8, 0x4f, 0x39, 0x16, 0x5c, 0x1c, 0x25, 0xf1, 0x0f, 0x91, - 0x24, 0xed, 0xe0, 0x50, 0x3a, 0x1d, 0xbc, 0xfb, 0xbd, 0xf7, 0x3d, 0x1e, 0x3d, 0x55, 0xe8, 0x52, - 0x74, 0x22, 0x91, 0x0e, 0x84, 0xc5, 0x19, 0x88, 0xe5, 0x28, 0x01, 0x2f, 0x47, 0x62, 0x51, 0x40, - 0xfe, 0xcc, 0xb3, 0x1c, 0x3d, 0x86, 0xbd, 0x96, 0xe2, 0x35, 0xc5, 0x6b, 0x8a, 0xaf, 0xa9, 0xfe, - 0x89, 0x46, 0xd4, 0x73, 0x10, 0x32, 0x33, 0x42, 0x5a, 0x8b, 0x5e, 0x7a, 0x83, 0xd6, 0xb5, 0xbe, - 0xa8, 0x4b, 0x0f, 0x6f, 0xd0, 0x3e, 0x18, 0x3d, 0x81, 0x45, 0x01, 0xce, 0x47, 0x57, 0xf4, 0x68, - 0x23, 0xb8, 0x0c, 0xad, 0x83, 0xf0, 0x9c, 0x1e, 0xa7, 0xc6, 0x9a, 0xb4, 0x48, 0xa7, 0x5a, 0xba, - 0x69, 0x96, 0x1b, 0x05, 0x3d, 0x32, 0x20, 0xf1, 0xc1, 0xa4, 0xbb, 0xfe, 0x18, 0x4b, 0x77, 0x5b, - 0xcb, 0x17, 0xef, 0x84, 0xee, 0xdf, 0x41, 0xbe, 0x34, 0x0a, 0xc2, 0x57, 0x42, 0x3b, 0x6d, 0x54, - 0x78, 0xc6, 0xb7, 0xd5, 0xe3, 0xff, 0xae, 0xf7, 0xe3, 0xdd, 0x60, 0xdb, 0x2a, 0x8a, 0x5f, 0xbe, - 0x7e, 0x3f, 0xf6, 0xa2, 0x70, 0x20, 0xb6, 0xee, 0xa3, 0x1a, 0xc7, 0xf5, 0xf8, 0xb3, 0x64, 0x64, - 0x55, 0x32, 0xf2, 0x53, 0x32, 0xf2, 0x56, 0xb1, 0x60, 0x55, 0xb1, 0xe0, 0xbb, 0x62, 0xc1, 0xfd, - 0x50, 0x1b, 0xff, 0x58, 0x24, 0x5c, 0x61, 0xba, 0x49, 0x69, 0x9f, 0xa1, 0x9b, 0x3d, 0x09, 0x35, - 0x37, 0x60, 0xbd, 0xd0, 0x79, 0xa6, 0x9a, 0xdc, 0xa4, 0xd3, 0x4c, 0x76, 0xf9, 0x17, 0x00, 0x00, - 0xff, 0xff, 0x7d, 0x46, 0xb4, 0x93, 0x92, 0x01, 0x00, 0x00, + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6f, 0xd3, 0x3e, + 0x1c, 0xc5, 0x9b, 0xfe, 0xfa, 0xeb, 0x98, 0x61, 0x1d, 0xcb, 0x00, 0x95, 0x0a, 0x65, 0x55, 0x05, + 0xa2, 0x20, 0xcd, 0xd6, 0xca, 0x9d, 0xc3, 0x38, 0x6c, 0x88, 0x0b, 0x4a, 0x39, 0x71, 0x89, 0xdc, + 0xf4, 0xbb, 0xc4, 0x5a, 0x62, 0x7b, 0xb6, 0x53, 0x89, 0x2b, 0x12, 0xf7, 0x49, 0x1c, 0x10, 0xff, + 0x11, 0xc7, 0x49, 0x5c, 0x38, 0x01, 0x6a, 0xf9, 0x43, 0x50, 0x6c, 0x67, 0xa8, 0x87, 0x0d, 0x4e, + 0xb1, 0xdf, 0xfb, 0xd8, 0x79, 0x7a, 0x5f, 0xa3, 0x87, 0xa9, 0xd0, 0xa5, 0xd0, 0x64, 0x46, 0x35, + 0x10, 0x2e, 0xe6, 0x40, 0x16, 0x07, 0x33, 0x30, 0xf4, 0x80, 0x9c, 0x55, 0xa0, 0xde, 0x61, 0xa9, + 0x84, 0x11, 0x61, 0xdf, 0x51, 0xb8, 0xa6, 0x70, 0x4d, 0x61, 0x4f, 0x0d, 0x1e, 0x64, 0x42, 0x64, + 0x05, 0x10, 0x2a, 0x19, 0xa1, 0x9c, 0x0b, 0x43, 0x0d, 0x13, 0x5c, 0xbb, 0x73, 0x83, 0x3d, 0xef, + 0xda, 0xdd, 0xac, 0x3a, 0x21, 0x86, 0x95, 0xa0, 0x0d, 0x2d, 0xa5, 0x07, 0xee, 0x64, 0x22, 0x13, + 0x76, 0x49, 0xea, 0x95, 0x53, 0x47, 0xdb, 0x68, 0xeb, 0x85, 0xe0, 0x27, 0x2c, 0x8b, 0xe1, 0xac, + 0x02, 0x6d, 0x46, 0x9f, 0x02, 0xd4, 0x6b, 0x14, 0x2d, 0x05, 0xd7, 0x10, 0x3e, 0x45, 0x3b, 0x25, + 0xe3, 0xac, 0xac, 0xca, 0x24, 0xa3, 0x3a, 0x91, 0x8a, 0xa5, 0xd0, 0x0f, 0x86, 0xc1, 0x78, 0x33, + 0xde, 0xf6, 0xc6, 0x11, 0xd5, 0xaf, 0x6b, 0x39, 0xc4, 0x68, 0x57, 0xaa, 0x8a, 0x33, 0x9e, 0x25, + 0xa7, 0x00, 0x32, 0x51, 0x90, 0x02, 0x37, 0xfd, 0xb6, 0xa5, 0x77, 0xbc, 0xf5, 0x0a, 0x40, 0xc6, + 0xd6, 0x08, 0x9f, 0xa0, 0xdb, 0x0d, 0xcf, 0xb8, 0x01, 0xb5, 0xa0, 0x45, 0xff, 0x3f, 0x77, 0xb5, + 0xd7, 0x5f, 0x7a, 0xb9, 0x8e, 0x3a, 0x35, 0xd4, 0x54, 0xba, 0x89, 0xfa, 0x3d, 0x40, 0xbd, 0x46, + 0xf1, 0x51, 0x27, 0xe8, 0x2e, 0x50, 0x55, 0x30, 0xd0, 0x26, 0xd1, 0x46, 0x28, 0x48, 0x72, 0x60, + 0x59, 0x6e, 0x6c, 0xdc, 0x4e, 0xbc, 0xdb, 0x98, 0xd3, 0xda, 0x3b, 0xb6, 0x56, 0x78, 0x0f, 0x75, + 0x3d, 0xd4, 0xb6, 0x90, 0xdf, 0x85, 0xcf, 0xd1, 0xe6, 0x65, 0x87, 0x36, 0xd3, 0xcd, 0xc9, 0x00, + 0xbb, 0x96, 0x71, 0xd3, 0x32, 0x7e, 0xd3, 0x10, 0x87, 0x9d, 0xf3, 0x1f, 0x7b, 0x41, 0xfc, 0xe7, + 0x48, 0x78, 0x1f, 0xdd, 0xa0, 0x52, 0x26, 0x39, 0xd5, 0x79, 0xbf, 0x33, 0x0c, 0xc6, 0xb7, 0xe2, + 0x0d, 0x2a, 0xe5, 0x31, 0xd5, 0x79, 0xf8, 0x08, 0xf5, 0x16, 0xb4, 0x60, 0x73, 0x6a, 0x84, 0x72, + 0xc0, 0xff, 0x16, 0xd8, 0xba, 0x54, 0x6b, 0x6c, 0xf2, 0xb9, 0x8d, 0x36, 0xa6, 0xa0, 0x16, 0x75, + 0xb1, 0x1f, 0x02, 0xd4, 0x75, 0x73, 0x09, 0x1f, 0xe3, 0xab, 0xde, 0x08, 0x5e, 0x9b, 0xe5, 0x60, + 0xfc, 0x77, 0xd0, 0xf5, 0x36, 0x1a, 0xbf, 0xff, 0xfa, 0xeb, 0x63, 0x7b, 0x14, 0x0e, 0xc9, 0x95, + 0x8f, 0x34, 0x75, 0x3f, 0xaf, 0x73, 0xb8, 0xd2, 0xaf, 0xcb, 0xb1, 0x36, 0xa8, 0xeb, 0x72, 0xac, + 0xcf, 0xef, 0x5f, 0x72, 0x68, 0x7b, 0xe2, 0xf0, 0xe8, 0xcb, 0x32, 0x0a, 0x2e, 0x96, 0x51, 0xf0, + 0x73, 0x19, 0x05, 0xe7, 0xab, 0xa8, 0x75, 0xb1, 0x8a, 0x5a, 0xdf, 0x56, 0x51, 0xeb, 0xed, 0x7e, + 0xc6, 0x4c, 0x5e, 0xcd, 0x70, 0x2a, 0xca, 0xe6, 0x16, 0xf7, 0xd9, 0xd7, 0xf3, 0x53, 0x92, 0x16, + 0x0c, 0xb8, 0x21, 0x99, 0x92, 0xa9, 0xbd, 0x77, 0xd6, 0xb5, 0xb3, 0x7c, 0xf6, 0x3b, 0x00, 0x00, + 0xff, 0xff, 0x89, 0x73, 0x23, 0x6e, 0x9f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -155,6 +307,8 @@ const _ = grpc.SupportPackageIsVersion4 type ServiceClient interface { // Config queries for the operator configuration. Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) + // Status queries for the node status. + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) } type serviceClient struct { @@ -174,10 +328,21 @@ func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...g return out, nil } +func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.node.v1beta1.Service/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ServiceServer is the server API for Service service. type ServiceServer interface { // Config queries for the operator configuration. Config(context.Context, *ConfigRequest) (*ConfigResponse, error) + // Status queries for the node status. + Status(context.Context, *StatusRequest) (*StatusResponse, error) } // UnimplementedServiceServer can be embedded to have forward compatible implementations. @@ -187,6 +352,9 @@ type UnimplementedServiceServer struct { func (*UnimplementedServiceServer) Config(ctx context.Context, req *ConfigRequest) (*ConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") } +func (*UnimplementedServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) @@ -210,6 +378,24 @@ func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.node.v1beta1.Service/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Service_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.base.node.v1beta1.Service", HandlerType: (*ServiceServer)(nil), @@ -218,6 +404,10 @@ var _Service_serviceDesc = grpc.ServiceDesc{ MethodName: "Config", Handler: _Service_Config_Handler, }, + { + MethodName: "Status", + Handler: _Service_Status_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/base/node/v1beta1/query.proto", @@ -266,6 +456,20 @@ func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.PruningInterval) > 0 { + i -= len(m.PruningInterval) + copy(dAtA[i:], m.PruningInterval) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PruningInterval))) + i-- + dAtA[i] = 0x1a + } + if len(m.PruningKeepRecent) > 0 { + i -= len(m.PruningKeepRecent) + copy(dAtA[i:], m.PruningKeepRecent) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PruningKeepRecent))) + i-- + dAtA[i] = 0x12 + } if len(m.MinimumGasPrice) > 0 { i -= len(m.MinimumGasPrice) copy(dAtA[i:], m.MinimumGasPrice) @@ -276,6 +480,86 @@ func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *StatusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *StatusResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorHash) > 0 { + i -= len(m.ValidatorHash) + copy(dAtA[i:], m.ValidatorHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x22 + } + if m.Timestamp != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintQuery(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if m.EarliestStoreHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.EarliestStoreHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -306,6 +590,50 @@ func (m *ConfigResponse) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.PruningKeepRecent) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.PruningInterval) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *StatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *StatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EarliestStoreHeight != 0 { + n += 1 + sovQuery(uint64(m.EarliestStoreHeight)) + } + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.Timestamp != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp) + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValidatorHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -426,6 +754,312 @@ func (m *ConfigResponse) Unmarshal(dAtA []byte) error { } m.MinimumGasPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PruningKeepRecent", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PruningKeepRecent = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PruningInterval", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PruningInterval = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestStoreHeight", wireType) + } + m.EarliestStoreHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EarliestStoreHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorHash = append(m.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorHash == nil { + m.ValidatorHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/client/grpc/node/query.pb.gw.go b/client/grpc/node/query.pb.gw.go index c579f6e54575..d83f060bc4dd 100644 --- a/client/grpc/node/query.pb.gw.go +++ b/client/grpc/node/query.pb.gw.go @@ -51,6 +51,24 @@ func local_request_Service_Config_0(ctx context.Context, marshaler runtime.Marsh } +func request_Service_Status_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq StatusRequest + var metadata runtime.ServerMetadata + + msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_Status_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq StatusRequest + var metadata runtime.ServerMetadata + + msg, err := server.Status(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterServiceHandlerServer registers the http handlers for service Service to "mux". // UnaryRPC :call ServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -80,6 +98,29 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) + mux.Handle("GET", pattern_Service_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) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_Status_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -141,13 +182,37 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) + mux.Handle("GET", pattern_Service_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_Status_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_Service_Config_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v1beta1", "config"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v1beta1", "status"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Service_Config_0 = runtime.ForwardResponseMessage + + forward_Service_Status_0 = runtime.ForwardResponseMessage ) diff --git a/client/grpc/node/service.go b/client/grpc/node/service.go index bf176e12dbcb..0d4f27a42932 100644 --- a/client/grpc/node/service.go +++ b/client/grpc/node/service.go @@ -7,12 +7,13 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server/config" sdk "github.com/cosmos/cosmos-sdk/types" ) // RegisterNodeService registers the node gRPC service on the provided gRPC router. -func RegisterNodeService(clientCtx client.Context, server gogogrpc.Server) { - RegisterServiceServer(server, NewQueryServer(clientCtx)) +func RegisterNodeService(clientCtx client.Context, server gogogrpc.Server, cfg config.Config) { + RegisterServiceServer(server, NewQueryServer(clientCtx, cfg)) } // RegisterGRPCGatewayRoutes mounts the node gRPC service's GRPC-gateway routes @@ -25,9 +26,10 @@ var _ ServiceServer = queryServer{} type queryServer struct { clientCtx client.Context + cfg config.Config } -func NewQueryServer(clientCtx client.Context) ServiceServer { +func NewQueryServer(clientCtx client.Context, cfg config.Config) ServiceServer { return queryServer{ clientCtx: clientCtx, } @@ -37,6 +39,25 @@ func (s queryServer) Config(ctx context.Context, _ *ConfigRequest) (*ConfigRespo sdkCtx := sdk.UnwrapSDKContext(ctx) return &ConfigResponse{ - MinimumGasPrice: sdkCtx.MinGasPrices().String(), + MinimumGasPrice: sdkCtx.MinGasPrices().String(), + PruningKeepRecent: s.cfg.PruningKeepRecent, + PruningInterval: s.cfg.PruningInterval, + }, nil +} + +func (s queryServer) Status(ctx context.Context, _ *StatusRequest) (*StatusResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + blockTime := sdkCtx.BlockTime() + + return &StatusResponse{ + // TODO: Get earliest version from store. + // + // Ref: ... + // EarliestStoreHeight: sdkCtx.MultiStore(), + Height: uint64(sdkCtx.BlockHeight()), + Timestamp: &blockTime, + AppHash: sdkCtx.BlockHeader().AppHash, + ValidatorHash: sdkCtx.BlockHeader().NextValidatorsHash, }, nil } diff --git a/client/grpc/node/service_test.go b/client/grpc/node/service_test.go index 654b27c6f7e7..2cbc07d3dda8 100644 --- a/client/grpc/node/service_test.go +++ b/client/grpc/node/service_test.go @@ -6,11 +6,12 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server/config" sdk "github.com/cosmos/cosmos-sdk/types" ) func TestServiceServer_Config(t *testing.T) { - svr := NewQueryServer(client.Context{}) + svr := NewQueryServer(client.Context{}, *config.DefaultConfig()) ctx := sdk.Context{}.WithMinGasPrices(sdk.NewDecCoins(sdk.NewInt64DecCoin("stake", 15))) resp, err := svr.Config(ctx, &ConfigRequest{}) diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto index 8070f7b904f4..78fd9f6703a3 100644 --- a/proto/cosmos/base/node/v1beta1/query.proto +++ b/proto/cosmos/base/node/v1beta1/query.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package cosmos.base.node.v1beta1; import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/node"; @@ -11,6 +13,10 @@ service Service { rpc Config(ConfigRequest) returns (ConfigResponse) { option (google.api.http).get = "/cosmos/base/node/v1beta1/config"; } + // Status queries for the node status. + rpc Status(StatusRequest) returns (StatusResponse) { + option (google.api.http).get = "/cosmos/base/node/v1beta1/status"; + } } // ConfigRequest defines the request structure for the Config gRPC query. @@ -19,4 +25,19 @@ message ConfigRequest {} // ConfigResponse defines the response structure for the Config gRPC query. message ConfigResponse { string minimum_gas_price = 1; + // pruning settings + string pruning_keep_recent = 2; + string pruning_interval = 3; +} + +// StateRequest defines the request structure for the status of a node. +message StatusRequest {} + +// StateResponse defines the response structure for the status of a node. +message StatusResponse { + uint64 earliest_store_height = 1; // earliest block height available in the store + uint64 height = 2; // current block height + google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp + bytes app_hash = 4; // app hash of the current block + bytes validator_hash = 5; // validator hash provided by the consensus header } diff --git a/runtime/app.go b/runtime/app.go index 7388ec9faa23..90ad970f2490 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -167,8 +167,8 @@ func (a *App) RegisterTendermintService(clientCtx client.Context) { } // RegisterNodeService registers the node gRPC service on the app gRPC router. -func (a *App) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, a.GRPCQueryRouter()) +func (a *App) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + nodeservice.RegisterNodeService(clientCtx, a.GRPCQueryRouter(), cfg) } // Configurator returns the app's configurator. diff --git a/server/start.go b/server/start.go index 4d1eb9311e1c..d7301f76d6c5 100644 --- a/server/start.go +++ b/server/start.go @@ -350,7 +350,7 @@ func startInProcess(svrCtx *Context, clientCtx client.Context, appCreator types. app.RegisterTxService(clientCtx) app.RegisterTendermintService(clientCtx) - app.RegisterNodeService(clientCtx) + app.RegisterNodeService(clientCtx, config) } metrics, err := startTelemetry(config) diff --git a/server/types/app.go b/server/types/app.go index 6b8bf79e118b..3b51fe1920ee 100644 --- a/server/types/app.go +++ b/server/types/app.go @@ -50,7 +50,7 @@ type ( RegisterTendermintService(client.Context) // RegisterNodeService registers the node gRPC Query service. - RegisterNodeService(client.Context) + RegisterNodeService(client.Context, config.Config) // CommitMultiStore return the multistore instance CommitMultiStore() storetypes.CommitMultiStore diff --git a/simapp/app.go b/simapp/app.go index 3c1bbd414aa8..5f939f2c87ba 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -709,8 +709,8 @@ func (app *SimApp) RegisterTendermintService(clientCtx client.Context) { ) } -func (app *SimApp) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +func (app *SimApp) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } // GetMaccPerms returns a copy of the module account permissions diff --git a/testutil/network/util.go b/testutil/network/util.go index 6b049bfe23c5..7c5cdc800728 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -80,7 +80,7 @@ func startInProcess(cfg Config, val *Validator) error { app.RegisterTxService(val.ClientCtx) app.RegisterTendermintService(val.ClientCtx) - app.RegisterNodeService(val.ClientCtx) + app.RegisterNodeService(val.ClientCtx, *val.AppConfig) } ctx := context.Background()