diff --git a/go.mod b/go.mod index ee2066b6..c88f33bd 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( github.com/tendermint/tendermint v0.34.27 google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa google.golang.org/grpc v1.53.0 + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.26.1 k8s.io/apimachinery v0.26.1 @@ -156,7 +157,6 @@ require ( golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go/inventory/v1/service.pb.go b/go/inventory/v1/service.pb.go index fc05ccd8..02db95d0 100644 --- a/go/inventory/v1/service.pb.go +++ b/go/inventory/v1/service.pb.go @@ -12,9 +12,8 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" + emptypb "google.golang.org/protobuf/types/known/emptypb" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -28,71 +27,30 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// voidNoParam dummy param for RPC services -type VoidNoParam struct { -} - -func (m *VoidNoParam) Reset() { *m = VoidNoParam{} } -func (m *VoidNoParam) String() string { return proto.CompactTextString(m) } -func (*VoidNoParam) ProtoMessage() {} -func (*VoidNoParam) Descriptor() ([]byte, []int) { - return fileDescriptor_19b1fad552cee5dc, []int{0} -} -func (m *VoidNoParam) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VoidNoParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VoidNoParam.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 *VoidNoParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoidNoParam.Merge(m, src) -} -func (m *VoidNoParam) XXX_Size() int { - return m.Size() -} -func (m *VoidNoParam) XXX_DiscardUnknown() { - xxx_messageInfo_VoidNoParam.DiscardUnknown(m) -} - -var xxx_messageInfo_VoidNoParam proto.InternalMessageInfo - -func init() { - proto.RegisterType((*VoidNoParam)(nil), "akash.inventory.v1.VoidNoParam") -} - func init() { proto.RegisterFile("akash/inventory/v1/service.proto", fileDescriptor_19b1fad552cee5dc) } var fileDescriptor_19b1fad552cee5dc = []byte{ - // 312 bytes of a gzipped FileDescriptorProto + // 319 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcc, 0x4e, 0x2c, 0xce, 0xd0, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xab, - 0xd0, 0x83, 0xab, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, - 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0xe8, - 0x90, 0x92, 0xc5, 0x62, 0x66, 0x5e, 0x7e, 0x0a, 0xd4, 0x40, 0x29, 0x6c, 0x56, 0x26, 0xe7, 0x94, - 0x16, 0x97, 0xa4, 0x16, 0x41, 0x54, 0x28, 0xf1, 0x72, 0x71, 0x87, 0xe5, 0x67, 0xa6, 0xf8, 0xe5, - 0x07, 0x24, 0x16, 0x25, 0xe6, 0x1a, 0x6d, 0x64, 0xe4, 0x62, 0xf7, 0xcb, 0x4f, 0x49, 0x0d, 0x0a, - 0x70, 0x16, 0x8a, 0xe6, 0xe2, 0x0c, 0x2c, 0x4d, 0x2d, 0xaa, 0x04, 0xf1, 0x85, 0xe4, 0xf5, 0x30, - 0xdd, 0xa6, 0x87, 0xa4, 0x53, 0x4a, 0x02, 0x9b, 0x02, 0x90, 0x56, 0x25, 0xe1, 0xa6, 0xcb, 0x4f, - 0x26, 0x33, 0xf1, 0x0a, 0x71, 0xc0, 0x1c, 0x97, 0xc4, 0xa8, 0x25, 0xe4, 0xc9, 0xc5, 0x15, 0x5c, - 0x52, 0x94, 0x9a, 0x98, 0x4b, 0xa1, 0xe9, 0x06, 0x8c, 0x46, 0x47, 0x19, 0xb9, 0xb8, 0x9c, 0x21, - 0x9e, 0x02, 0x39, 0x3b, 0x8d, 0x8b, 0x07, 0xec, 0x6c, 0xa8, 0x10, 0x61, 0xb3, 0xa5, 0xb1, 0x29, - 0x80, 0xea, 0x56, 0x92, 0x00, 0x3b, 0x5e, 0x48, 0x88, 0x17, 0xe4, 0x78, 0xb8, 0x0a, 0x90, 0x0f, - 0xfc, 0xb9, 0x78, 0x21, 0x3e, 0xa0, 0x8a, 0x45, 0x06, 0x8c, 0x4e, 0x3e, 0x27, 0x1e, 0xc9, 0x31, - 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, - 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, - 0x9f, 0xab, 0x0f, 0x36, 0x42, 0x37, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x1b, 0xca, 0x03, 0xa5, - 0x8d, 0xf4, 0x7c, 0x94, 0x68, 0x4e, 0x62, 0x03, 0xc7, 0xaf, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, - 0xf3, 0x65, 0xa5, 0x58, 0x76, 0x02, 0x00, 0x00, + 0xd0, 0x83, 0xab, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, + 0xab, 0x48, 0x2a, 0x4d, 0xd3, 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0x92, 0x81, 0x4a, + 0x26, 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x43, + 0x65, 0x65, 0xb1, 0x58, 0x98, 0x97, 0x9f, 0x02, 0xb5, 0x4d, 0x0a, 0x9b, 0x7b, 0x92, 0x73, 0x4a, + 0x8b, 0x4b, 0x52, 0x8b, 0x20, 0x2a, 0x8c, 0xe6, 0x33, 0x72, 0xb1, 0xfb, 0xe5, 0xa7, 0xa4, 0x06, + 0x05, 0x38, 0x0b, 0x05, 0x71, 0x71, 0x06, 0x96, 0xa6, 0x16, 0x55, 0x82, 0xf8, 0x42, 0x62, 0x7a, + 0x10, 0x8b, 0xf5, 0x60, 0xae, 0xd2, 0x73, 0x05, 0xb9, 0x4a, 0x4a, 0x42, 0x0f, 0xd3, 0x07, 0x7a, + 0x20, 0x1d, 0x4a, 0xc2, 0x4d, 0x97, 0x9f, 0x4c, 0x66, 0xe2, 0x15, 0xe2, 0x80, 0x39, 0x22, 0x89, + 0x51, 0x4b, 0xc8, 0x81, 0x8b, 0x2b, 0xb8, 0xa4, 0x28, 0x35, 0x31, 0x97, 0x3c, 0x43, 0x0d, 0x18, + 0x8d, 0x36, 0x33, 0x72, 0x71, 0x39, 0x43, 0xdc, 0x0c, 0x72, 0x64, 0x2c, 0x17, 0x0f, 0xd8, 0x91, + 0x50, 0x21, 0x9c, 0x46, 0x4a, 0x63, 0x33, 0x12, 0xaa, 0x49, 0x49, 0x02, 0xec, 0x54, 0x21, 0x21, + 0x5e, 0x90, 0x53, 0xe1, 0x2a, 0x40, 0xee, 0x75, 0xe3, 0xe2, 0x85, 0xb8, 0x97, 0x12, 0xf3, 0x0d, + 0x18, 0x9d, 0x7c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, + 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x28, 0x3d, + 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x6c, 0x84, 0x6e, 0x5e, 0x6a, 0x49, + 0x79, 0x7e, 0x51, 0x36, 0x94, 0x07, 0x8a, 0xe8, 0xf4, 0x7c, 0x94, 0x38, 0x4b, 0x62, 0x03, 0x5b, + 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x86, 0xd8, 0xe4, 0x60, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -110,11 +68,11 @@ type NodeRPCClient interface { // QueryNode defines a method to query hardware state of the node // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - QueryNode(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (*Node, error) + QueryNode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Node, error) // StreamNode defines a method to stream hardware state of the node // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - StreamNode(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (NodeRPC_StreamNodeClient, error) + StreamNode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (NodeRPC_StreamNodeClient, error) } type nodeRPCClient struct { @@ -125,7 +83,7 @@ func NewNodeRPCClient(cc grpc1.ClientConn) NodeRPCClient { return &nodeRPCClient{cc} } -func (c *nodeRPCClient) QueryNode(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (*Node, error) { +func (c *nodeRPCClient) QueryNode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Node, error) { out := new(Node) err := c.cc.Invoke(ctx, "/akash.inventory.v1.NodeRPC/QueryNode", in, out, opts...) if err != nil { @@ -134,7 +92,7 @@ func (c *nodeRPCClient) QueryNode(ctx context.Context, in *VoidNoParam, opts ... return out, nil } -func (c *nodeRPCClient) StreamNode(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (NodeRPC_StreamNodeClient, error) { +func (c *nodeRPCClient) StreamNode(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (NodeRPC_StreamNodeClient, error) { stream, err := c.cc.NewStream(ctx, &_NodeRPC_serviceDesc.Streams[0], "/akash.inventory.v1.NodeRPC/StreamNode", opts...) if err != nil { return nil, err @@ -171,21 +129,21 @@ type NodeRPCServer interface { // QueryNode defines a method to query hardware state of the node // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - QueryNode(context.Context, *VoidNoParam) (*Node, error) + QueryNode(context.Context, *emptypb.Empty) (*Node, error) // StreamNode defines a method to stream hardware state of the node // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - StreamNode(*VoidNoParam, NodeRPC_StreamNodeServer) error + StreamNode(*emptypb.Empty, NodeRPC_StreamNodeServer) error } // UnimplementedNodeRPCServer can be embedded to have forward compatible implementations. type UnimplementedNodeRPCServer struct { } -func (*UnimplementedNodeRPCServer) QueryNode(ctx context.Context, req *VoidNoParam) (*Node, error) { +func (*UnimplementedNodeRPCServer) QueryNode(ctx context.Context, req *emptypb.Empty) (*Node, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryNode not implemented") } -func (*UnimplementedNodeRPCServer) StreamNode(req *VoidNoParam, srv NodeRPC_StreamNodeServer) error { +func (*UnimplementedNodeRPCServer) StreamNode(req *emptypb.Empty, srv NodeRPC_StreamNodeServer) error { return status.Errorf(codes.Unimplemented, "method StreamNode not implemented") } @@ -194,7 +152,7 @@ func RegisterNodeRPCServer(s grpc1.Server, srv NodeRPCServer) { } func _NodeRPC_QueryNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VoidNoParam) + in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } @@ -206,13 +164,13 @@ func _NodeRPC_QueryNode_Handler(srv interface{}, ctx context.Context, dec func(i FullMethod: "/akash.inventory.v1.NodeRPC/QueryNode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeRPCServer).QueryNode(ctx, req.(*VoidNoParam)) + return srv.(NodeRPCServer).QueryNode(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _NodeRPC_StreamNode_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(VoidNoParam) + m := new(emptypb.Empty) if err := stream.RecvMsg(m); err != nil { return err } @@ -258,11 +216,11 @@ type ClusterRPCClient interface { // QueryCluster defines a method to query hardware state of the cluster // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - QueryCluster(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (*Cluster, error) + QueryCluster(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Cluster, error) // StreamCluster defines a method to stream hardware state of the cluster // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - StreamCluster(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (ClusterRPC_StreamClusterClient, error) + StreamCluster(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (ClusterRPC_StreamClusterClient, error) } type clusterRPCClient struct { @@ -273,7 +231,7 @@ func NewClusterRPCClient(cc grpc1.ClientConn) ClusterRPCClient { return &clusterRPCClient{cc} } -func (c *clusterRPCClient) QueryCluster(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (*Cluster, error) { +func (c *clusterRPCClient) QueryCluster(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Cluster, error) { out := new(Cluster) err := c.cc.Invoke(ctx, "/akash.inventory.v1.ClusterRPC/QueryCluster", in, out, opts...) if err != nil { @@ -282,7 +240,7 @@ func (c *clusterRPCClient) QueryCluster(ctx context.Context, in *VoidNoParam, op return out, nil } -func (c *clusterRPCClient) StreamCluster(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (ClusterRPC_StreamClusterClient, error) { +func (c *clusterRPCClient) StreamCluster(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (ClusterRPC_StreamClusterClient, error) { stream, err := c.cc.NewStream(ctx, &_ClusterRPC_serviceDesc.Streams[0], "/akash.inventory.v1.ClusterRPC/StreamCluster", opts...) if err != nil { return nil, err @@ -319,21 +277,21 @@ type ClusterRPCServer interface { // QueryCluster defines a method to query hardware state of the cluster // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - QueryCluster(context.Context, *VoidNoParam) (*Cluster, error) + QueryCluster(context.Context, *emptypb.Empty) (*Cluster, error) // StreamCluster defines a method to stream hardware state of the cluster // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - StreamCluster(*VoidNoParam, ClusterRPC_StreamClusterServer) error + StreamCluster(*emptypb.Empty, ClusterRPC_StreamClusterServer) error } // UnimplementedClusterRPCServer can be embedded to have forward compatible implementations. type UnimplementedClusterRPCServer struct { } -func (*UnimplementedClusterRPCServer) QueryCluster(ctx context.Context, req *VoidNoParam) (*Cluster, error) { +func (*UnimplementedClusterRPCServer) QueryCluster(ctx context.Context, req *emptypb.Empty) (*Cluster, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryCluster not implemented") } -func (*UnimplementedClusterRPCServer) StreamCluster(req *VoidNoParam, srv ClusterRPC_StreamClusterServer) error { +func (*UnimplementedClusterRPCServer) StreamCluster(req *emptypb.Empty, srv ClusterRPC_StreamClusterServer) error { return status.Errorf(codes.Unimplemented, "method StreamCluster not implemented") } @@ -342,7 +300,7 @@ func RegisterClusterRPCServer(s grpc1.Server, srv ClusterRPCServer) { } func _ClusterRPC_QueryCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VoidNoParam) + in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } @@ -354,13 +312,13 @@ func _ClusterRPC_QueryCluster_Handler(srv interface{}, ctx context.Context, dec FullMethod: "/akash.inventory.v1.ClusterRPC/QueryCluster", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterRPCServer).QueryCluster(ctx, req.(*VoidNoParam)) + return srv.(ClusterRPCServer).QueryCluster(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } func _ClusterRPC_StreamCluster_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(VoidNoParam) + m := new(emptypb.Empty) if err := stream.RecvMsg(m); err != nil { return err } @@ -398,187 +356,3 @@ var _ClusterRPC_serviceDesc = grpc.ServiceDesc{ }, Metadata: "akash/inventory/v1/service.proto", } - -func (m *VoidNoParam) 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 *VoidNoParam) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VoidNoParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintService(dAtA []byte, offset int, v uint64) int { - offset -= sovService(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *VoidNoParam) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovService(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozService(x uint64) (n int) { - return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *VoidNoParam) 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 ErrIntOverflowService - } - 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: VoidNoParam: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VoidNoParam: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthService - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipService(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowService - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowService - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowService - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthService - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupService - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthService - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowService = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") -) diff --git a/go/inventory/v1/service.pb.gw.go b/go/inventory/v1/service.pb.gw.go index b0c9685c..85d71370 100644 --- a/go/inventory/v1/service.pb.gw.go +++ b/go/inventory/v1/service.pb.gw.go @@ -22,6 +22,7 @@ import ( "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" ) // Suppress "imported and not used" errors @@ -34,7 +35,7 @@ var _ = descriptor.ForMessage var _ = metadata.Join func request_NodeRPC_QueryNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodeRPCClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq VoidNoParam + var protoReq emptypb.Empty var metadata runtime.ServerMetadata msg, err := client.QueryNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -43,7 +44,7 @@ func request_NodeRPC_QueryNode_0(ctx context.Context, marshaler runtime.Marshale } func local_request_NodeRPC_QueryNode_0(ctx context.Context, marshaler runtime.Marshaler, server NodeRPCServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq VoidNoParam + var protoReq emptypb.Empty var metadata runtime.ServerMetadata msg, err := server.QueryNode(ctx, &protoReq) @@ -52,7 +53,7 @@ func local_request_NodeRPC_QueryNode_0(ctx context.Context, marshaler runtime.Ma } func request_ClusterRPC_QueryCluster_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterRPCClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq VoidNoParam + var protoReq emptypb.Empty var metadata runtime.ServerMetadata msg, err := client.QueryCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -61,7 +62,7 @@ func request_ClusterRPC_QueryCluster_0(ctx context.Context, marshaler runtime.Ma } func local_request_ClusterRPC_QueryCluster_0(ctx context.Context, marshaler runtime.Marshaler, server ClusterRPCServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq VoidNoParam + var protoReq emptypb.Empty var metadata runtime.ServerMetadata msg, err := server.QueryCluster(ctx, &protoReq) diff --git a/make/setup-cache.mk b/make/setup-cache.mk index e561cda0..a4597138 100644 --- a/make/setup-cache.mk +++ b/make/setup-cache.mk @@ -34,7 +34,9 @@ $(PROTOC_VERSION_FILE): $(AKASH_DEVCACHE) (cd /tmp; \ curl -sOL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"; \ unzip -oq ${PROTOC_ZIP} -d $(AKASH_DEVCACHE) bin/protoc; \ - unzip -oq ${PROTOC_ZIP} -d $(AKASH_DEVCACHE) 'include/google/protobuf/descriptor.proto'; \ + unzip -oq ${PROTOC_ZIP} -d $(AKASH_DEVCACHE) 'include/google/protobuf/descriptor.proto' \ + 'include/google/protobuf/struct.proto' \ + 'include/google/protobuf/empty.proto'; \ rm -f ${PROTOC_ZIP}) rm -rf "$(dir $@)" mkdir -p "$(dir $@)" diff --git a/proto/provider/akash/inventory/v1/service.proto b/proto/provider/akash/inventory/v1/service.proto index 9fa4ee8a..3e319209 100644 --- a/proto/provider/akash/inventory/v1/service.proto +++ b/proto/provider/akash/inventory/v1/service.proto @@ -1,21 +1,20 @@ syntax = "proto3"; package akash.inventory.v1; +import "google/protobuf/empty.proto"; import "google/api/annotations.proto"; import "akash/inventory/v1/node.proto"; import "akash/inventory/v1/cluster.proto"; option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; -// voidNoParam dummy param for RPC services -message VoidNoParam {} // NodeRPC defines the RPC server of node service NodeRPC { // QueryNode defines a method to query hardware state of the node // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - rpc QueryNode(VoidNoParam) returns (Node) { + rpc QueryNode(google.protobuf.Empty) returns (Node) { option (google.api.http) = { get: "/v1/node", response_body: "*" @@ -25,7 +24,7 @@ service NodeRPC { // StreamNode defines a method to stream hardware state of the node // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - rpc StreamNode(VoidNoParam) returns (stream Node); + rpc StreamNode(google.protobuf.Empty) returns (stream Node); } // ClusterRPC defines the RPC server of cluster @@ -33,7 +32,7 @@ service ClusterRPC { // QueryCluster defines a method to query hardware state of the cluster // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - rpc QueryCluster(VoidNoParam) returns (Cluster) { + rpc QueryCluster(google.protobuf.Empty) returns (Cluster) { option (google.api.http) = { get: "/v1/inventory", response_body: "*" @@ -42,5 +41,5 @@ service ClusterRPC { // StreamCluster defines a method to stream hardware state of the cluster // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME - rpc StreamCluster(VoidNoParam) returns (stream Cluster); + rpc StreamCluster(google.protobuf.Empty) returns (stream Cluster); }