From 695f30425576d342d0d2e461bc09d8d22da7819b Mon Sep 17 00:00:00 2001 From: Robin Lai Date: Mon, 2 Dec 2019 13:48:01 -0800 Subject: [PATCH 1/4] refactor hub.proto --- protos/hub/hub.pb.go | 1518 +++++++++++++----------------------------- protos/hub/hub.proto | 55 +- 2 files changed, 477 insertions(+), 1096 deletions(-) diff --git a/protos/hub/hub.pb.go b/protos/hub/hub.pb.go index 4ff913e..cc98856 100644 --- a/protos/hub/hub.pb.go +++ b/protos/hub/hub.pb.go @@ -7,9 +7,9 @@ import ( context "context" encoding_binary "encoding/binary" fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" _ "github.com/gogo/protobuf/types" golang_proto "github.com/golang/protobuf/proto" - _ "github.com/tron-us/protobuf/gogoproto" proto "github.com/tron-us/protobuf/proto" github_com_tron_us_protobuf_types "github.com/tron-us/protobuf/types" grpc "google.golang.org/grpc" @@ -484,28 +484,36 @@ func (*HostsData) XXX_MessageName() string { } type Host struct { - NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty" pg:"node_id"` - TimeCreate time.Time `protobuf:"bytes,2,opt,name=time_create,json=timeCreate,proto3,stdtime" json:"time_create" pg:"time_create"` - TimeUpdate time.Time `protobuf:"bytes,3,opt,name=time_update,json=timeUpdate,proto3,stdtime" json:"time_update" pg:"time_update"` - NodeIp string `protobuf:"bytes,4,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty" pg:"node_ip"` - Region string `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty" pg:"region"` - BtfsVersion string `protobuf:"bytes,6,opt,name=btfs_version,json=btfsVersion,proto3" json:"btfs_version,omitempty" pg:"btfs_version"` - Score float32 `protobuf:"fixed32,7,opt,name=score,proto3" json:"score,omitempty" pg:"score"` - HeartBeats int64 `protobuf:"varint,8,opt,name=heart_beats,json=heartBeats,proto3" json:"heart_beats,omitempty" pg:"heart_beats"` - Uptime float32 `protobuf:"fixed32,9,opt,name=uptime,proto3" json:"uptime,omitempty" pg:"uptime"` - Age int64 `protobuf:"varint,10,opt,name=age,proto3" json:"age,omitempty" pg:"age"` - Reputation float32 `protobuf:"fixed32,11,opt,name=reputation,proto3" json:"reputation,omitempty" pg:"reputation"` - UploadAvg float32 `protobuf:"fixed32,12,opt,name=upload_avg,json=uploadAvg,proto3" json:"upload_avg,omitempty" pg:"upload_avg"` - UploadVar float32 `protobuf:"fixed32,13,opt,name=upload_var,json=uploadVar,proto3" json:"upload_var,omitempty" pg:"upload_var"` - DownloadAvg float32 `protobuf:"fixed32,14,opt,name=download_avg,json=downloadAvg,proto3" json:"download_avg,omitempty" pg:"download_avg"` - DownloadVar float32 `protobuf:"fixed32,15,opt,name=download_var,json=downloadVar,proto3" json:"download_var,omitempty" pg:"download_var"` - Location *Location `protobuf:"bytes,16,opt,name=location,proto3" json:"location,omitempty" pg:"location"` - StorageInfo *StorageInfo `protobuf:"bytes,17,opt,name=storage_info,json=storageInfo,proto3" json:"storage_info,omitempty" pg:"storage_info"` - BandwidthInfo *BandwidthInfo `protobuf:"bytes,18,opt,name=bandwidth_info,json=bandwidthInfo,proto3" json:"bandwidth_info,omitempty" pg:"bandwidth_info"` - CollateralInfo *CollateralInfo `protobuf:"bytes,19,opt,name=collateral_info,json=collateralInfo,proto3" json:"collateral_info,omitempty" pg:"collateral_info"` - XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` - XXX_unrecognized []byte `json:"-" pg:"-"` - XXX_sizecache int32 `json:"-" pg:"-"` + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty" pg:"node_id"` + CreateTimestamp time.Time `protobuf:"bytes,2,opt,name=create_timestamp,json=createTimestamp,proto3,stdtime" json:"create_timestamp" pg:"create_timestamp"` + UpdateTimestamp time.Time `protobuf:"bytes,3,opt,name=update_timestamp,json=updateTimestamp,proto3,stdtime" json:"update_timestamp" pg:"update_timestamp"` + NodeIp string `protobuf:"bytes,4,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty" pg:"node_ip"` + Region string `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty" pg:"region"` + BtfsVersion string `protobuf:"bytes,6,opt,name=btfs_version,json=btfsVersion,proto3" json:"btfs_version,omitempty" pg:"btfs_version"` + Score float32 `protobuf:"fixed32,7,opt,name=score,proto3" json:"score,omitempty" pg:"score"` + HeartBeats int64 `protobuf:"varint,8,opt,name=heart_beats,json=heartBeats,proto3" json:"heart_beats,omitempty" pg:"heart_beats"` + Uptime float32 `protobuf:"fixed32,9,opt,name=uptime,proto3" json:"uptime,omitempty" pg:"uptime"` + Age int64 `protobuf:"varint,10,opt,name=age,proto3" json:"age,omitempty" pg:"age"` + Reputation float32 `protobuf:"fixed32,11,opt,name=reputation,proto3" json:"reputation,omitempty" pg:"reputation"` + UploadAverage float32 `protobuf:"fixed32,12,opt,name=upload_average,json=uploadAverage,proto3" json:"upload_average,omitempty" pg:"upload_average"` + UploadVariance float32 `protobuf:"fixed32,13,opt,name=upload_variance,json=uploadVariance,proto3" json:"upload_variance,omitempty" pg:"upload_variance"` + DownloadAverage float32 `protobuf:"fixed32,14,opt,name=download_average,json=downloadAverage,proto3" json:"download_average,omitempty" pg:"download_average"` + DownloadVariance float32 `protobuf:"fixed32,15,opt,name=download_variance,json=downloadVariance,proto3" json:"download_variance,omitempty" pg:"download_variance"` + Location Location `protobuf:"bytes,16,opt,name=location,proto3" json:"location" pg:"location"` + StorageVolumeCap float32 `protobuf:"fixed32,17,opt,name=storage_volume_cap,json=storageVolumeCap,proto3" json:"storage_volume_cap,omitempty" pg:"storage_volume_cap"` + StorageVolumeLeft float32 `protobuf:"fixed32,18,opt,name=storage_volume_left,json=storageVolumeLeft,proto3" json:"storage_volume_left,omitempty" pg:"storage_volume_left"` + StorageTimeMin uint64 `protobuf:"varint,19,opt,name=storage_time_min,json=storageTimeMin,proto3" json:"storage_time_min,omitempty" pg:"storage_time_min"` + StoragePriceAsk float32 `protobuf:"fixed32,20,opt,name=storage_price_ask,json=storagePriceAsk,proto3" json:"storage_price_ask,omitempty" pg:"storage_price_ask"` + StoragePriceEst float32 `protobuf:"fixed32,21,opt,name=storage_price_est,json=storagePriceEst,proto3" json:"storage_price_est,omitempty" pg:"storage_price_est"` + BandwidthLimit float64 `protobuf:"fixed64,22,opt,name=bandwidth_limit,json=bandwidthLimit,proto3" json:"bandwidth_limit,omitempty" pg:"bandwidth_limit"` + BandwidthPriceAsk float32 `protobuf:"fixed32,23,opt,name=bandwidth_price_ask,json=bandwidthPriceAsk,proto3" json:"bandwidth_price_ask,omitempty" pg:"bandwidth_price_ask"` + BandwidthPriceEst float32 `protobuf:"fixed32,24,opt,name=bandwidth_price_est,json=bandwidthPriceEst,proto3" json:"bandwidth_price_est,omitempty" pg:"bandwidth_price_est"` + CollateralStake uint64 `protobuf:"varint,25,opt,name=collateral_stake,json=collateralStake,proto3" json:"collateral_stake,omitempty" pg:"collateral_stake"` + CollateralLost uint64 `protobuf:"varint,26,opt,name=collateral_lost,json=collateralLost,proto3" json:"collateral_lost,omitempty" pg:"collateral_lost"` + CollateralBurn uint64 `protobuf:"varint,27,opt,name=collateral_burn,json=collateralBurn,proto3" json:"collateral_burn,omitempty" pg:"collateral_burn"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` } func (m *Host) Reset() { *m = Host{} } @@ -548,16 +556,16 @@ func (m *Host) GetNodeId() string { return "" } -func (m *Host) GetTimeCreate() time.Time { +func (m *Host) GetCreateTimestamp() time.Time { if m != nil { - return m.TimeCreate + return m.CreateTimestamp } return time.Time{} } -func (m *Host) GetTimeUpdate() time.Time { +func (m *Host) GetUpdateTimestamp() time.Time { if m != nil { - return m.TimeUpdate + return m.UpdateTimestamp } return time.Time{} } @@ -618,296 +626,142 @@ func (m *Host) GetReputation() float32 { return 0 } -func (m *Host) GetUploadAvg() float32 { +func (m *Host) GetUploadAverage() float32 { if m != nil { - return m.UploadAvg + return m.UploadAverage } return 0 } -func (m *Host) GetUploadVar() float32 { +func (m *Host) GetUploadVariance() float32 { if m != nil { - return m.UploadVar + return m.UploadVariance } return 0 } -func (m *Host) GetDownloadAvg() float32 { +func (m *Host) GetDownloadAverage() float32 { if m != nil { - return m.DownloadAvg + return m.DownloadAverage } return 0 } -func (m *Host) GetDownloadVar() float32 { +func (m *Host) GetDownloadVariance() float32 { if m != nil { - return m.DownloadVar + return m.DownloadVariance } return 0 } -func (m *Host) GetLocation() *Location { +func (m *Host) GetLocation() Location { if m != nil { return m.Location } - return nil -} - -func (m *Host) GetStorageInfo() *StorageInfo { - if m != nil { - return m.StorageInfo - } - return nil -} - -func (m *Host) GetBandwidthInfo() *BandwidthInfo { - if m != nil { - return m.BandwidthInfo - } - return nil + return Location{} } -func (m *Host) GetCollateralInfo() *CollateralInfo { +func (m *Host) GetStorageVolumeCap() float32 { if m != nil { - return m.CollateralInfo - } - return nil -} - -func (*Host) XXX_MessageName() string { - return "hub.Host" -} - -type Location struct { - Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty" pg:"lat"` - Lon float64 `protobuf:"fixed64,2,opt,name=lon,proto3" json:"lon,omitempty" pg:"lon"` - XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` - XXX_unrecognized []byte `json:"-" pg:"-"` - XXX_sizecache int32 `json:"-" pg:"-"` -} - -func (m *Location) Reset() { *m = Location{} } -func (m *Location) String() string { return proto.CompactTextString(m) } -func (*Location) ProtoMessage() {} -func (*Location) Descriptor() ([]byte, []int) { - return fileDescriptor_c704b5990190a69f, []int{7} -} -func (m *Location) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Location.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + return m.StorageVolumeCap } -} -func (m *Location) XXX_Merge(src proto.Message) { - xxx_messageInfo_Location.Merge(m, src) -} -func (m *Location) XXX_Size() int { - return m.Size() -} -func (m *Location) XXX_DiscardUnknown() { - xxx_messageInfo_Location.DiscardUnknown(m) + return 0 } -var xxx_messageInfo_Location proto.InternalMessageInfo - -func (m *Location) GetLat() float64 { +func (m *Host) GetStorageVolumeLeft() float32 { if m != nil { - return m.Lat + return m.StorageVolumeLeft } return 0 } -func (m *Location) GetLon() float64 { +func (m *Host) GetStorageTimeMin() uint64 { if m != nil { - return m.Lon + return m.StorageTimeMin } return 0 } -func (*Location) XXX_MessageName() string { - return "hub.Location" -} - -type StorageInfo struct { - StorageCap float32 `protobuf:"fixed32,1,opt,name=storage_cap,json=storageCap,proto3" json:"storage_cap,omitempty" pg:"storage_cap"` - StorageLeft float32 `protobuf:"fixed32,2,opt,name=storage_left,json=storageLeft,proto3" json:"storage_left,omitempty" pg:"storage_left"` - StorageMinTime int64 `protobuf:"varint,3,opt,name=storage_min_time,json=storageMinTime,proto3" json:"storage_min_time,omitempty" pg:"storage_min_time"` - StorageAskPrice float32 `protobuf:"fixed32,4,opt,name=storage_ask_price,json=storageAskPrice,proto3" json:"storage_ask_price,omitempty" pg:"storage_ask_price"` - StoragePriceEst float32 `protobuf:"fixed32,5,opt,name=storage_price_est,json=storagePriceEst,proto3" json:"storage_price_est,omitempty" pg:"storage_price_est"` - XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` - XXX_unrecognized []byte `json:"-" pg:"-"` - XXX_sizecache int32 `json:"-" pg:"-"` -} - -func (m *StorageInfo) Reset() { *m = StorageInfo{} } -func (m *StorageInfo) String() string { return proto.CompactTextString(m) } -func (*StorageInfo) ProtoMessage() {} -func (*StorageInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c704b5990190a69f, []int{8} -} -func (m *StorageInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StorageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StorageInfo.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 *StorageInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_StorageInfo.Merge(m, src) -} -func (m *StorageInfo) XXX_Size() int { - return m.Size() -} -func (m *StorageInfo) XXX_DiscardUnknown() { - xxx_messageInfo_StorageInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_StorageInfo proto.InternalMessageInfo - -func (m *StorageInfo) GetStorageCap() float32 { +func (m *Host) GetStoragePriceAsk() float32 { if m != nil { - return m.StorageCap + return m.StoragePriceAsk } return 0 } -func (m *StorageInfo) GetStorageLeft() float32 { +func (m *Host) GetStoragePriceEst() float32 { if m != nil { - return m.StorageLeft + return m.StoragePriceEst } return 0 } -func (m *StorageInfo) GetStorageMinTime() int64 { +func (m *Host) GetBandwidthLimit() float64 { if m != nil { - return m.StorageMinTime + return m.BandwidthLimit } return 0 } -func (m *StorageInfo) GetStorageAskPrice() float32 { +func (m *Host) GetBandwidthPriceAsk() float32 { if m != nil { - return m.StorageAskPrice + return m.BandwidthPriceAsk } return 0 } -func (m *StorageInfo) GetStoragePriceEst() float32 { +func (m *Host) GetBandwidthPriceEst() float32 { if m != nil { - return m.StoragePriceEst + return m.BandwidthPriceEst } return 0 } -func (*StorageInfo) XXX_MessageName() string { - return "hub.StorageInfo" -} - -type BandwidthInfo struct { - BandwidthLimit float32 `protobuf:"fixed32,1,opt,name=bandwidth_limit,json=bandwidthLimit,proto3" json:"bandwidth_limit,omitempty" pg:"bandwidth_limit"` - BandwidthAskPrice float32 `protobuf:"fixed32,2,opt,name=bandwidth_ask_price,json=bandwidthAskPrice,proto3" json:"bandwidth_ask_price,omitempty" pg:"bandwidth_ask_price"` - BandwidthPriceEst float32 `protobuf:"fixed32,3,opt,name=bandwidth_price_est,json=bandwidthPriceEst,proto3" json:"bandwidth_price_est,omitempty" pg:"bandwidth_price_est"` - XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` - XXX_unrecognized []byte `json:"-" pg:"-"` - XXX_sizecache int32 `json:"-" pg:"-"` -} - -func (m *BandwidthInfo) Reset() { *m = BandwidthInfo{} } -func (m *BandwidthInfo) String() string { return proto.CompactTextString(m) } -func (*BandwidthInfo) ProtoMessage() {} -func (*BandwidthInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c704b5990190a69f, []int{9} -} -func (m *BandwidthInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BandwidthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BandwidthInfo.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 *BandwidthInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_BandwidthInfo.Merge(m, src) -} -func (m *BandwidthInfo) XXX_Size() int { - return m.Size() -} -func (m *BandwidthInfo) XXX_DiscardUnknown() { - xxx_messageInfo_BandwidthInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_BandwidthInfo proto.InternalMessageInfo - -func (m *BandwidthInfo) GetBandwidthLimit() float32 { +func (m *Host) GetCollateralStake() uint64 { if m != nil { - return m.BandwidthLimit + return m.CollateralStake } return 0 } -func (m *BandwidthInfo) GetBandwidthAskPrice() float32 { +func (m *Host) GetCollateralLost() uint64 { if m != nil { - return m.BandwidthAskPrice + return m.CollateralLost } return 0 } -func (m *BandwidthInfo) GetBandwidthPriceEst() float32 { +func (m *Host) GetCollateralBurn() uint64 { if m != nil { - return m.BandwidthPriceEst + return m.CollateralBurn } return 0 } -func (*BandwidthInfo) XXX_MessageName() string { - return "hub.BandwidthInfo" +func (*Host) XXX_MessageName() string { + return "hub.Host" } -type CollateralInfo struct { - CollateralStake float32 `protobuf:"fixed32,1,opt,name=collateral_stake,json=collateralStake,proto3" json:"collateral_stake,omitempty" pg:"collateral_stake"` - CollateralLost float32 `protobuf:"fixed32,2,opt,name=collateral_lost,json=collateralLost,proto3" json:"collateral_lost,omitempty" pg:"collateral_lost"` - CollateralBurn float32 `protobuf:"fixed32,3,opt,name=collateral_burn,json=collateralBurn,proto3" json:"collateral_burn,omitempty" pg:"collateral_burn"` +type Location struct { + Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty" pg:"lat"` + Lon float64 `protobuf:"fixed64,2,opt,name=lon,proto3" json:"lon,omitempty" pg:"lon"` XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` XXX_unrecognized []byte `json:"-" pg:"-"` XXX_sizecache int32 `json:"-" pg:"-"` } -func (m *CollateralInfo) Reset() { *m = CollateralInfo{} } -func (m *CollateralInfo) String() string { return proto.CompactTextString(m) } -func (*CollateralInfo) ProtoMessage() {} -func (*CollateralInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c704b5990190a69f, []int{10} +func (m *Location) Reset() { *m = Location{} } +func (m *Location) String() string { return proto.CompactTextString(m) } +func (*Location) ProtoMessage() {} +func (*Location) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{7} } -func (m *CollateralInfo) XXX_Unmarshal(b []byte) error { +func (m *Location) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CollateralInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CollateralInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_Location.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -917,41 +771,34 @@ func (m *CollateralInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *CollateralInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollateralInfo.Merge(m, src) +func (m *Location) XXX_Merge(src proto.Message) { + xxx_messageInfo_Location.Merge(m, src) } -func (m *CollateralInfo) XXX_Size() int { +func (m *Location) XXX_Size() int { return m.Size() } -func (m *CollateralInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CollateralInfo.DiscardUnknown(m) +func (m *Location) XXX_DiscardUnknown() { + xxx_messageInfo_Location.DiscardUnknown(m) } -var xxx_messageInfo_CollateralInfo proto.InternalMessageInfo - -func (m *CollateralInfo) GetCollateralStake() float32 { - if m != nil { - return m.CollateralStake - } - return 0 -} +var xxx_messageInfo_Location proto.InternalMessageInfo -func (m *CollateralInfo) GetCollateralLost() float32 { +func (m *Location) GetLat() float64 { if m != nil { - return m.CollateralLost + return m.Lat } return 0 } -func (m *CollateralInfo) GetCollateralBurn() float32 { +func (m *Location) GetLon() float64 { if m != nil { - return m.CollateralBurn + return m.Lon } return 0 } -func (*CollateralInfo) XXX_MessageName() string { - return "hub.CollateralInfo" +func (*Location) XXX_MessageName() string { + return "hub.Location" } func init() { proto.RegisterEnum("hub.ResponseCode", ResponseCode_name, ResponseCode_value) @@ -972,89 +819,79 @@ func init() { golang_proto.RegisterType((*Host)(nil), "hub.Host") proto.RegisterType((*Location)(nil), "hub.Location") golang_proto.RegisterType((*Location)(nil), "hub.Location") - proto.RegisterType((*StorageInfo)(nil), "hub.StorageInfo") - golang_proto.RegisterType((*StorageInfo)(nil), "hub.StorageInfo") - proto.RegisterType((*BandwidthInfo)(nil), "hub.BandwidthInfo") - golang_proto.RegisterType((*BandwidthInfo)(nil), "hub.BandwidthInfo") - proto.RegisterType((*CollateralInfo)(nil), "hub.CollateralInfo") - golang_proto.RegisterType((*CollateralInfo)(nil), "hub.CollateralInfo") } func init() { proto.RegisterFile("protos/hub/hub.proto", fileDescriptor_c704b5990190a69f) } func init() { golang_proto.RegisterFile("protos/hub/hub.proto", fileDescriptor_c704b5990190a69f) } var fileDescriptor_c704b5990190a69f = []byte{ - // 1118 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0x5b, 0x45, - 0x10, 0xef, 0xda, 0x71, 0x62, 0xcf, 0xb3, 0x1d, 0x67, 0x5b, 0x8a, 0x09, 0xc2, 0x31, 0x16, 0x08, - 0xb7, 0x02, 0x07, 0xb9, 0x52, 0x11, 0x08, 0x21, 0xd9, 0xae, 0x49, 0x22, 0x25, 0x24, 0x5a, 0x27, - 0x3d, 0x70, 0x79, 0x5a, 0xfb, 0xad, 0x9d, 0xa7, 0xd8, 0x6f, 0x5f, 0xdf, 0xae, 0x53, 0xa9, 0xdf, - 0x01, 0x89, 0x63, 0x3f, 0x0e, 0xc7, 0x1c, 0x11, 0xdc, 0x29, 0x4a, 0x2e, 0x9c, 0xf8, 0x0c, 0x68, - 0xe7, 0xfd, 0x75, 0x9a, 0x03, 0x45, 0x1c, 0x22, 0xed, 0xfc, 0x66, 0x7e, 0x93, 0xdf, 0xec, 0xec, - 0x9b, 0x31, 0x3c, 0xf0, 0x03, 0xa9, 0xa5, 0xda, 0x3d, 0x5f, 0x8e, 0xcd, 0x5f, 0x07, 0x4d, 0x9a, - 0x3f, 0x5f, 0x8e, 0xb7, 0xbf, 0x9c, 0xb9, 0xda, 0x40, 0x13, 0xb9, 0xd8, 0xd5, 0x81, 0xf4, 0xbe, - 0x58, 0xaa, 0x5d, 0x74, 0x8f, 0x97, 0xd3, 0xdd, 0x99, 0x9c, 0x49, 0x34, 0xf0, 0x14, 0xd2, 0xb6, - 0x77, 0x66, 0x52, 0xce, 0xe6, 0x22, 0x8d, 0xd2, 0xee, 0x42, 0x28, 0xcd, 0x17, 0x7e, 0x18, 0xd0, - 0xfa, 0x06, 0xac, 0x91, 0xd0, 0xda, 0xf5, 0x66, 0x8a, 0x89, 0x17, 0xb4, 0x0a, 0x39, 0xd7, 0xa9, - 0x93, 0x26, 0x69, 0x97, 0x58, 0xce, 0x75, 0xe8, 0x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88, 0xd0, 0xfa, 0x1a, 0x0a, 0x7d, 0xa1, 0xb5, 0xeb, + 0x8d, 0x14, 0x13, 0x6f, 0x69, 0x19, 0x32, 0xae, 0x63, 0x91, 0x26, 0x69, 0xe7, 0x59, 0xc6, 0x75, + 0xe8, 0x73, 0xc8, 0x07, 0x42, 0xf9, 0xb6, 0x72, 0xdf, 0x0b, 0x2b, 0xd3, 0x24, 0xed, 0x65, 0x96, + 0x43, 0xa0, 0xef, 0xbe, 0x17, 0xad, 0x5f, 0x09, 0x14, 0xa7, 0xc5, 0xca, 0xa7, 0x2f, 0x20, 0x3b, + 0x94, 0x8e, 0x30, 0xf5, 0xe5, 0xad, 0x5a, 0x07, 0x85, 0x62, 0x42, 0x7a, 0x4a, 0xec, 0x48, 0x47, + 0x30, 0x93, 0xa6, 0x16, 0xac, 0x4e, 0x84, 0x52, 0x7c, 0x14, 0xb5, 0xcc, 0xb3, 0x24, 0xa4, 0x07, + 0x50, 0x0a, 0x62, 0xbe, 0x8d, 0x4a, 0xad, 0xa5, 0x26, 0x69, 0x17, 0xb6, 0xea, 0x9d, 0x68, 0x8c, + 0x4e, 0x32, 0x46, 0xe7, 0x34, 0x19, 0xa3, 0x9b, 0xbb, 0xf9, 0x7d, 0xe3, 0xd1, 0x8f, 0x7f, 0x6c, + 0x10, 0x56, 0x4c, 0x4a, 0x31, 0x49, 0xdf, 0x40, 0x49, 0xc5, 0xda, 0x6c, 0x87, 0x6b, 0x6e, 0x65, + 0x4d, 0xab, 0x48, 0x54, 0xa2, 0x7a, 0x97, 0x6b, 0xce, 0x8a, 0x6a, 0x26, 0x6a, 0xfd, 0x35, 0x33, + 0x14, 0x02, 0xf4, 0x15, 0xd4, 0x94, 0x96, 0x01, 0x1f, 0x09, 0xdb, 0x0f, 0xdc, 0xa1, 0xb0, 0xb9, + 0xba, 0x32, 0x13, 0x12, 0x56, 0x89, 0x13, 0x27, 0x88, 0x6f, 0xab, 0x2b, 0xda, 0x81, 0xc7, 0x03, + 0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 0xab, 0x8f, 0x68, 0x1d, 0xd6, 0xfb, 0x07, 0x7b, 0xdf, 0x6e, 0x9f, 0x9e, + 0xb1, 0x9e, 0xfd, 0xcd, 0x31, 0x3b, 0xda, 0x3e, 0xb5, 0x7b, 0x8c, 0x1d, 0xb3, 0x2a, 0xa1, 0xcf, + 0xe0, 0xc9, 0xce, 0xf1, 0xd1, 0xc9, 0xd9, 0x69, 0xcf, 0xde, 0xde, 0xdd, 0x65, 0xbd, 0x7e, 0x3f, + 0x4e, 0x65, 0x68, 0x05, 0x0a, 0xc7, 0xa7, 0xfb, 0x3d, 0x16, 0x03, 0x6b, 0x5b, 0x2e, 0xe4, 0xf6, + 0xc3, 0xc1, 0x77, 0xa1, 0x08, 0x7e, 0xa0, 0x5b, 0x50, 0xd8, 0x13, 0x3a, 0x79, 0x3d, 0x69, 0x75, + 0xee, 0xad, 0x65, 0xe2, 0x6d, 0xbd, 0x76, 0x0f, 0x51, 0x3e, 0x7d, 0x09, 0xb9, 0x3d, 0xa1, 0x8d, + 0xbb, 0xd2, 0xd2, 0xd4, 0xf9, 0x91, 0x5d, 0x9e, 0x0d, 0x95, 0xdf, 0x7d, 0x73, 0x73, 0xdb, 0x20, + 0xbf, 0xdc, 0x36, 0xc8, 0x9f, 0xb7, 0x0d, 0xf2, 0xd3, 0x5d, 0x83, 0xfc, 0x7c, 0xd7, 0x20, 0x37, + 0x77, 0x0d, 0x02, 0x05, 0x57, 0x76, 0xd0, 0x69, 0xb0, 0xa0, 0x8b, 0x7a, 0x4e, 0xd0, 0xec, 0x4e, + 0xc8, 0xf7, 0xf8, 0x3f, 0xd3, 0x60, 0xc5, 0x58, 0xdf, 0x97, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, + 0xc9, 0xa1, 0x55, 0x0e, 0x57, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1065,144 +902,108 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// SettingsClient is the client API for Settings service. +// HubQueryClient is the client API for HubQuery service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SettingsClient interface { +type HubQueryClient interface { GetSettings(ctx context.Context, in *SettingsReq, opts ...grpc.CallOption) (*SettingsResp, error) + GetHosts(ctx context.Context, in *HostsReq, opts ...grpc.CallOption) (*HostsResp, error) } -type settingsClient struct { +type hubQueryClient struct { cc *grpc.ClientConn } -func NewSettingsClient(cc *grpc.ClientConn) SettingsClient { - return &settingsClient{cc} +func NewHubQueryClient(cc *grpc.ClientConn) HubQueryClient { + return &hubQueryClient{cc} } -func (c *settingsClient) GetSettings(ctx context.Context, in *SettingsReq, opts ...grpc.CallOption) (*SettingsResp, error) { +func (c *hubQueryClient) GetSettings(ctx context.Context, in *SettingsReq, opts ...grpc.CallOption) (*SettingsResp, error) { out := new(SettingsResp) - err := c.cc.Invoke(ctx, "/hub.Settings/GetSettings", in, out, opts...) + err := c.cc.Invoke(ctx, "/hub.HubQuery/GetSettings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hubQueryClient) GetHosts(ctx context.Context, in *HostsReq, opts ...grpc.CallOption) (*HostsResp, error) { + out := new(HostsResp) + err := c.cc.Invoke(ctx, "/hub.HubQuery/GetHosts", in, out, opts...) if err != nil { return nil, err } return out, nil } -// SettingsServer is the server API for Settings service. -type SettingsServer interface { +// HubQueryServer is the server API for HubQuery service. +type HubQueryServer interface { GetSettings(context.Context, *SettingsReq) (*SettingsResp, error) + GetHosts(context.Context, *HostsReq) (*HostsResp, error) } -// UnimplementedSettingsServer can be embedded to have forward compatible implementations. -type UnimplementedSettingsServer struct { +// UnimplementedHubQueryServer can be embedded to have forward compatible implementations. +type UnimplementedHubQueryServer struct { } -func (*UnimplementedSettingsServer) GetSettings(ctx context.Context, req *SettingsReq) (*SettingsResp, error) { +func (*UnimplementedHubQueryServer) GetSettings(ctx context.Context, req *SettingsReq) (*SettingsResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSettings not implemented") } +func (*UnimplementedHubQueryServer) GetHosts(ctx context.Context, req *HostsReq) (*HostsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHosts not implemented") +} -func RegisterSettingsServer(s *grpc.Server, srv SettingsServer) { - s.RegisterService(&_Settings_serviceDesc, srv) +func RegisterHubQueryServer(s *grpc.Server, srv HubQueryServer) { + s.RegisterService(&_HubQuery_serviceDesc, srv) } -func _Settings_GetSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _HubQuery_GetSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SettingsReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(SettingsServer).GetSettings(ctx, in) + return srv.(HubQueryServer).GetSettings(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/hub.Settings/GetSettings", + FullMethod: "/hub.HubQuery/GetSettings", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SettingsServer).GetSettings(ctx, req.(*SettingsReq)) + return srv.(HubQueryServer).GetSettings(ctx, req.(*SettingsReq)) } return interceptor(ctx, in, info, handler) } -var _Settings_serviceDesc = grpc.ServiceDesc{ - ServiceName: "hub.Settings", - HandlerType: (*SettingsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetSettings", - Handler: _Settings_GetSettings_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "protos/hub/hub.proto", -} - -// HostsClient is the client API for Hosts service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type HostsClient interface { - GetHosts(ctx context.Context, in *HostsReq, opts ...grpc.CallOption) (*HostsResp, error) -} - -type hostsClient struct { - cc *grpc.ClientConn -} - -func NewHostsClient(cc *grpc.ClientConn) HostsClient { - return &hostsClient{cc} -} - -func (c *hostsClient) GetHosts(ctx context.Context, in *HostsReq, opts ...grpc.CallOption) (*HostsResp, error) { - out := new(HostsResp) - err := c.cc.Invoke(ctx, "/hub.Hosts/GetHosts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// HostsServer is the server API for Hosts service. -type HostsServer interface { - GetHosts(context.Context, *HostsReq) (*HostsResp, error) -} - -// UnimplementedHostsServer can be embedded to have forward compatible implementations. -type UnimplementedHostsServer struct { -} - -func (*UnimplementedHostsServer) GetHosts(ctx context.Context, req *HostsReq) (*HostsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHosts not implemented") -} - -func RegisterHostsServer(s *grpc.Server, srv HostsServer) { - s.RegisterService(&_Hosts_serviceDesc, srv) -} - -func _Hosts_GetHosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _HubQuery_GetHosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(HostsReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(HostsServer).GetHosts(ctx, in) + return srv.(HubQueryServer).GetHosts(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/hub.Hosts/GetHosts", + FullMethod: "/hub.HubQuery/GetHosts", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HostsServer).GetHosts(ctx, req.(*HostsReq)) + return srv.(HubQueryServer).GetHosts(ctx, req.(*HostsReq)) } return interceptor(ctx, in, info, handler) } -var _Hosts_serviceDesc = grpc.ServiceDesc{ - ServiceName: "hub.Hosts", - HandlerType: (*HostsServer)(nil), +var _HubQuery_serviceDesc = grpc.ServiceDesc{ + ServiceName: "hub.HubQuery", + HandlerType: (*HubQueryServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "GetSettings", + Handler: _HubQuery_GetSettings_Handler, + }, { MethodName: "GetHosts", - Handler: _Hosts_GetHosts_Handler, + Handler: _HubQuery_GetHosts_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -1539,83 +1340,123 @@ func (m *Host) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.CollateralInfo != nil { - { - size, err := m.CollateralInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHub(dAtA, i, uint64(size)) - } + if m.CollateralBurn != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.CollateralBurn)) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x9a + dAtA[i] = 0xd8 } - if m.BandwidthInfo != nil { - { - size, err := m.BandwidthInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHub(dAtA, i, uint64(size)) - } + if m.CollateralLost != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.CollateralLost)) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x92 + dAtA[i] = 0xd0 } - if m.StorageInfo != nil { - { - size, err := m.StorageInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHub(dAtA, i, uint64(size)) - } + if m.CollateralStake != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.CollateralStake)) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x8a + dAtA[i] = 0xc8 } - if m.Location != nil { - { - size, err := m.Location.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHub(dAtA, i, uint64(size)) - } + if m.BandwidthPriceEst != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthPriceEst)))) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x82 + dAtA[i] = 0xc5 } - if m.DownloadVar != 0 { + if m.BandwidthPriceAsk != 0 { i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.DownloadVar)))) + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthPriceAsk)))) i-- - dAtA[i] = 0x7d - } - if m.DownloadAvg != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.DownloadAvg)))) + dAtA[i] = 0x1 i-- - dAtA[i] = 0x75 + dAtA[i] = 0xbd } - if m.UploadVar != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.UploadVar)))) + if m.BandwidthLimit != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.BandwidthLimit)))) i-- - dAtA[i] = 0x6d + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb1 + } + if m.StoragePriceEst != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StoragePriceEst)))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xad + } + if m.StoragePriceAsk != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StoragePriceAsk)))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa5 + } + if m.StorageTimeMin != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.StorageTimeMin)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if m.StorageVolumeLeft != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageVolumeLeft)))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x95 + } + if m.StorageVolumeCap != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageVolumeCap)))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8d + } + { + size, err := m.Location.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + if m.DownloadVariance != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.DownloadVariance)))) + i-- + dAtA[i] = 0x7d + } + if m.DownloadAverage != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.DownloadAverage)))) + i-- + dAtA[i] = 0x75 + } + if m.UploadVariance != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.UploadVariance)))) + i-- + dAtA[i] = 0x6d } - if m.UploadAvg != 0 { + if m.UploadAverage != 0 { i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.UploadAvg)))) + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.UploadAverage)))) i-- dAtA[i] = 0x65 } @@ -1668,20 +1509,20 @@ func (m *Host) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - n9, err9 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.TimeUpdate, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeUpdate):]) - if err9 != nil { - return 0, err9 + n6, err6 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.UpdateTimestamp, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.UpdateTimestamp):]) + if err6 != nil { + return 0, err6 } - i -= n9 - i = encodeVarintHub(dAtA, i, uint64(n9)) + i -= n6 + i = encodeVarintHub(dAtA, i, uint64(n6)) i-- dAtA[i] = 0x1a - n10, err10 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.TimeCreate, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeCreate):]) - if err10 != nil { - return 0, err10 + n7, err7 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.CreateTimestamp, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.CreateTimestamp):]) + if err7 != nil { + return 0, err7 } - i -= n10 - i = encodeVarintHub(dAtA, i, uint64(n10)) + i -= n7 + i = encodeVarintHub(dAtA, i, uint64(n7)) i-- dAtA[i] = 0x12 if len(m.NodeId) > 0 { @@ -1733,152 +1574,6 @@ func (m *Location) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *StorageInfo) 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 *StorageInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StorageInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.StoragePriceEst != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StoragePriceEst)))) - i-- - dAtA[i] = 0x2d - } - if m.StorageAskPrice != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageAskPrice)))) - i-- - dAtA[i] = 0x25 - } - if m.StorageMinTime != 0 { - i = encodeVarintHub(dAtA, i, uint64(m.StorageMinTime)) - i-- - dAtA[i] = 0x18 - } - if m.StorageLeft != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageLeft)))) - i-- - dAtA[i] = 0x15 - } - if m.StorageCap != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageCap)))) - i-- - dAtA[i] = 0xd - } - return len(dAtA) - i, nil -} - -func (m *BandwidthInfo) 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 *BandwidthInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BandwidthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.BandwidthPriceEst != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthPriceEst)))) - i-- - dAtA[i] = 0x1d - } - if m.BandwidthAskPrice != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthAskPrice)))) - i-- - dAtA[i] = 0x15 - } - if m.BandwidthLimit != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthLimit)))) - i-- - dAtA[i] = 0xd - } - return len(dAtA) - i, nil -} - -func (m *CollateralInfo) 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 *CollateralInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CollateralInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.CollateralBurn != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.CollateralBurn)))) - i-- - dAtA[i] = 0x1d - } - if m.CollateralLost != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.CollateralLost)))) - i-- - dAtA[i] = 0x15 - } - if m.CollateralStake != 0 { - i -= 4 - encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.CollateralStake)))) - i-- - dAtA[i] = 0xd - } - return len(dAtA) - i, nil -} - func encodeVarintHub(dAtA []byte, offset int, v uint64) int { offset -= sovHub(v) base := offset @@ -2040,9 +1735,9 @@ func (m *Host) Size() (n int) { if l > 0 { n += 1 + l + sovHub(uint64(l)) } - l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeCreate) + l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.CreateTimestamp) n += 1 + l + sovHub(uint64(l)) - l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeUpdate) + l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.UpdateTimestamp) n += 1 + l + sovHub(uint64(l)) l = len(m.NodeIp) if l > 0 { @@ -2071,99 +1766,52 @@ func (m *Host) Size() (n int) { if m.Reputation != 0 { n += 5 } - if m.UploadAvg != 0 { + if m.UploadAverage != 0 { n += 5 } - if m.UploadVar != 0 { + if m.UploadVariance != 0 { n += 5 } - if m.DownloadAvg != 0 { + if m.DownloadAverage != 0 { n += 5 } - if m.DownloadVar != 0 { + if m.DownloadVariance != 0 { n += 5 } - if m.Location != nil { - l = m.Location.Size() - n += 2 + l + sovHub(uint64(l)) - } - if m.StorageInfo != nil { - l = m.StorageInfo.Size() - n += 2 + l + sovHub(uint64(l)) - } - if m.BandwidthInfo != nil { - l = m.BandwidthInfo.Size() - n += 2 + l + sovHub(uint64(l)) - } - if m.CollateralInfo != nil { - l = m.CollateralInfo.Size() - n += 2 + l + sovHub(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Location) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Lat != 0 { - n += 9 - } - if m.Lon != 0 { - n += 9 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StorageInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StorageCap != 0 { - n += 5 + l = m.Location.Size() + n += 2 + l + sovHub(uint64(l)) + if m.StorageVolumeCap != 0 { + n += 6 } - if m.StorageLeft != 0 { - n += 5 + if m.StorageVolumeLeft != 0 { + n += 6 } - if m.StorageMinTime != 0 { - n += 1 + sovHub(uint64(m.StorageMinTime)) + if m.StorageTimeMin != 0 { + n += 2 + sovHub(uint64(m.StorageTimeMin)) } - if m.StorageAskPrice != 0 { - n += 5 + if m.StoragePriceAsk != 0 { + n += 6 } if m.StoragePriceEst != 0 { - n += 5 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *BandwidthInfo) Size() (n int) { - if m == nil { - return 0 + n += 6 } - var l int - _ = l if m.BandwidthLimit != 0 { - n += 5 + n += 10 } - if m.BandwidthAskPrice != 0 { - n += 5 + if m.BandwidthPriceAsk != 0 { + n += 6 } if m.BandwidthPriceEst != 0 { - n += 5 + n += 6 + } + if m.CollateralStake != 0 { + n += 2 + sovHub(uint64(m.CollateralStake)) + } + if m.CollateralLost != 0 { + n += 2 + sovHub(uint64(m.CollateralLost)) + } + if m.CollateralBurn != 0 { + n += 2 + sovHub(uint64(m.CollateralBurn)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -2171,20 +1819,17 @@ func (m *BandwidthInfo) Size() (n int) { return n } -func (m *CollateralInfo) Size() (n int) { +func (m *Location) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.CollateralStake != 0 { - n += 5 - } - if m.CollateralLost != 0 { - n += 5 + if m.Lat != 0 { + n += 9 } - if m.CollateralBurn != 0 { - n += 5 + if m.Lon != 0 { + n += 9 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -3067,7 +2712,7 @@ func (m *Host) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeCreate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CreateTimestamp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3094,13 +2739,13 @@ func (m *Host) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.TimeCreate, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.CreateTimestamp, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeUpdate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UpdateTimestamp", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3127,7 +2772,7 @@ func (m *Host) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.TimeUpdate, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.UpdateTimestamp, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3300,7 +2945,7 @@ func (m *Host) Unmarshal(dAtA []byte) error { m.Reputation = float32(math.Float32frombits(v)) case 12: if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field UploadAvg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UploadAverage", wireType) } var v uint32 if (iNdEx + 4) > l { @@ -3308,10 +2953,10 @@ func (m *Host) Unmarshal(dAtA []byte) error { } v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) iNdEx += 4 - m.UploadAvg = float32(math.Float32frombits(v)) + m.UploadAverage = float32(math.Float32frombits(v)) case 13: if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field UploadVar", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UploadVariance", wireType) } var v uint32 if (iNdEx + 4) > l { @@ -3319,10 +2964,10 @@ func (m *Host) Unmarshal(dAtA []byte) error { } v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) iNdEx += 4 - m.UploadVar = float32(math.Float32frombits(v)) + m.UploadVariance = float32(math.Float32frombits(v)) case 14: if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field DownloadAvg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DownloadAverage", wireType) } var v uint32 if (iNdEx + 4) > l { @@ -3330,10 +2975,10 @@ func (m *Host) Unmarshal(dAtA []byte) error { } v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) iNdEx += 4 - m.DownloadAvg = float32(math.Float32frombits(v)) + m.DownloadAverage = float32(math.Float32frombits(v)) case 15: if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field DownloadVar", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DownloadVariance", wireType) } var v uint32 if (iNdEx + 4) > l { @@ -3341,7 +2986,7 @@ func (m *Host) Unmarshal(dAtA []byte) error { } v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) iNdEx += 4 - m.DownloadVar = float32(math.Float32frombits(v)) + m.DownloadVariance = float32(math.Float32frombits(v)) case 16: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) @@ -3371,18 +3016,37 @@ func (m *Host) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Location == nil { - m.Location = &Location{} - } if err := m.Location.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StorageInfo", wireType) + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageVolumeCap", wireType) } - var msglen int + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StorageVolumeCap = float32(math.Float32frombits(v)) + case 18: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageVolumeLeft", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StorageVolumeLeft = float32(math.Float32frombits(v)) + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageTimeMin", wireType) + } + m.StorageTimeMin = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHub @@ -3392,33 +3056,71 @@ func (m *Host) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.StorageTimeMin |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthHub + case 20: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StoragePriceAsk", wireType) } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHub + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StoragePriceAsk = float32(math.Float32frombits(v)) + case 21: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StoragePriceEst", wireType) + } + var v uint32 + if (iNdEx + 4) > l { return io.ErrUnexpectedEOF } - if m.StorageInfo == nil { - m.StorageInfo = &StorageInfo{} + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StoragePriceEst = float32(math.Float32frombits(v)) + case 22: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthLimit", wireType) } - if err := m.StorageInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BandwidthInfo", wireType) + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.BandwidthLimit = float64(math.Float64frombits(v)) + case 23: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthPriceAsk", wireType) } - var msglen int + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.BandwidthPriceAsk = float32(math.Float32frombits(v)) + case 24: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthPriceEst", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.BandwidthPriceEst = float32(math.Float32frombits(v)) + case 25: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralStake", wireType) + } + m.CollateralStake = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHub @@ -3428,33 +3130,16 @@ func (m *Host) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.CollateralStake |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthHub - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHub - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BandwidthInfo == nil { - m.BandwidthInfo = &BandwidthInfo{} - } - if err := m.BandwidthInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralInfo", wireType) + case 26: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralLost", wireType) } - var msglen int + m.CollateralLost = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHub @@ -3464,28 +3149,30 @@ func (m *Host) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.CollateralLost |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthHub - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthHub - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CollateralInfo == nil { - m.CollateralInfo = &CollateralInfo{} + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralBurn", wireType) } - if err := m.CollateralInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.CollateralBurn = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CollateralBurn |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipHub(dAtA[iNdEx:]) @@ -3587,297 +3274,6 @@ func (m *Location) Unmarshal(dAtA []byte) error { } return nil } -func (m *StorageInfo) 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 ErrIntOverflowHub - } - 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: StorageInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StorageInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field StorageCap", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.StorageCap = float32(math.Float32frombits(v)) - case 2: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field StorageLeft", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.StorageLeft = float32(math.Float32frombits(v)) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StorageMinTime", wireType) - } - m.StorageMinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHub - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StorageMinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field StorageAskPrice", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.StorageAskPrice = float32(math.Float32frombits(v)) - case 5: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field StoragePriceEst", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.StoragePriceEst = float32(math.Float32frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipHub(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthHub - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthHub - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BandwidthInfo) 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 ErrIntOverflowHub - } - 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: BandwidthInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BandwidthInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field BandwidthLimit", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.BandwidthLimit = float32(math.Float32frombits(v)) - case 2: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field BandwidthAskPrice", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.BandwidthAskPrice = float32(math.Float32frombits(v)) - case 3: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field BandwidthPriceEst", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.BandwidthPriceEst = float32(math.Float32frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipHub(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthHub - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthHub - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CollateralInfo) 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 ErrIntOverflowHub - } - 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: CollateralInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CollateralInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralStake", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.CollateralStake = float32(math.Float32frombits(v)) - case 2: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralLost", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.CollateralLost = float32(math.Float32frombits(v)) - case 3: - if wireType != 5 { - return fmt.Errorf("proto: wrong wireType = %d for field CollateralBurn", wireType) - } - var v uint32 - if (iNdEx + 4) > l { - return io.ErrUnexpectedEOF - } - v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) - iNdEx += 4 - m.CollateralBurn = float32(math.Float32frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipHub(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthHub - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthHub - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipHub(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protos/hub/hub.proto b/protos/hub/hub.proto index d6ca2ca..6d7cb4d 100644 --- a/protos/hub/hub.proto +++ b/protos/hub/hub.proto @@ -16,14 +16,11 @@ option java_multiple_files = true; option java_outer_classname = "HubProto"; option java_package = "io.btfs.hub"; -import "github.com/tron-us/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -service Settings { +service HubQuery { rpc GetSettings(SettingsReq) returns (SettingsResp); -} - -service Hosts { rpc GetHosts(HostsReq) returns (HostsResp); } @@ -80,11 +77,11 @@ message HostsData { message Host { string node_id = 1; - google.protobuf.Timestamp time_create = 2 [ + google.protobuf.Timestamp create_timestamp = 2 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; - google.protobuf.Timestamp time_update = 3 [ + google.protobuf.Timestamp update_timestamp = 3 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; @@ -96,37 +93,25 @@ message Host { float uptime = 9; int64 age = 10; float reputation = 11; - float upload_avg = 12; - float upload_var = 13; - float download_avg = 14; - float download_var = 15; - Location location = 16; - StorageInfo storage_info = 17; - BandwidthInfo bandwidth_info = 18; - CollateralInfo collateral_info = 19; + float upload_average = 12; + float upload_variance = 13; + float download_average = 14; + float download_variance = 15; + Location location = 16 [(gogoproto.nullable) = false]; + float storage_volume_cap = 17; + float storage_volume_left = 18; + uint64 storage_time_min = 19; + float storage_price_ask = 20; + float storage_price_est = 21; + double bandwidth_limit = 22; + float bandwidth_price_ask = 23; + float bandwidth_price_est = 24; + uint64 collateral_stake = 25; + uint64 collateral_lost = 26; + uint64 collateral_burn = 27; } message Location { double lat = 1; double lon = 2; } - -message StorageInfo { - float storage_cap = 1; - float storage_left = 2; - int64 storage_min_time = 3; - float storage_ask_price = 4; - float storage_price_est = 5; -} - -message BandwidthInfo { - float bandwidth_limit = 1; - float bandwidth_ask_price = 2; - float bandwidth_price_est = 3; -} - -message CollateralInfo { - float collateral_stake = 1; - float collateral_lost = 2; - float collateral_burn = 3; -} From 1731f1caa1948883d5580351c0392ed0abb50bfb Mon Sep 17 00:00:00 2001 From: Robin Lai Date: Mon, 2 Dec 2019 13:48:23 -0800 Subject: [PATCH 2/4] refactor grpc client helper --- utils/grpc/client.go | 153 ++++++++++++++++++ .../client_test.go} | 5 +- utils/grpc/escrow.go | 18 +++ utils/grpc/guard.go | 18 +++ utils/grpc/hub.go | 18 +++ utils/grpc/status.go | 18 +++ utils/grpc_helper.go | 102 ------------ 7 files changed, 227 insertions(+), 105 deletions(-) create mode 100644 utils/grpc/client.go rename utils/{grpc_helper_test.go => grpc/client_test.go} (96%) create mode 100644 utils/grpc/escrow.go create mode 100644 utils/grpc/guard.go create mode 100644 utils/grpc/hub.go create mode 100644 utils/grpc/status.go delete mode 100644 utils/grpc_helper.go diff --git a/utils/grpc/client.go b/utils/grpc/client.go new file mode 100644 index 0000000..898b430 --- /dev/null +++ b/utils/grpc/client.go @@ -0,0 +1,153 @@ +package grpc + +import ( + "context" + "crypto/tls" + "errors" + "fmt" + "github.com/tron-us/go-btfs-common/protos/escrow" + "github.com/tron-us/go-btfs-common/protos/guard" + "github.com/tron-us/go-btfs-common/protos/hub" + "github.com/tron-us/go-btfs-common/protos/status" + "google.golang.org/grpc" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + "net/url" + "regexp" + "strconv" + "strings" + "time" +) + +const ( + defaultSchema = "http" + defaultTimeout = 30 * time.Second +) + +var ( + domainRegexp = regexp.MustCompile(`^(localhost)|([a-zA-Z0-9-]{1,63}\.)+([a-zA-Z]{1,63})$`) + ipv4Regexp = regexp.MustCompile(`^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$`) +) + +func (g *ClientBuilder) doWithContext(ctx context.Context, f interface{}) error { + newCtx, cancel := context.WithTimeout(ctx, g.timeout) + if cancel != nil { + defer cancel() + } + conn, err := newGRPCConn(newCtx, g.addr) + if conn != nil { + defer conn.Close() + } + if err != nil { + return err + } + if conn == nil || conn.GetState() != connectivity.Ready { + return errors.New("failed to get connection") + } + switch f.(type) { + case func(context.Context, status.StatusClient) error: + return f.(func(context.Context, status.StatusClient) error)(ctx, status.NewStatusClient(conn)) + case func(context.Context, hub.HubQueryClient) error: + return f.(func(context.Context, hub.HubQueryClient) error)(ctx, hub.NewHubQueryClient(conn)) + case func(context.Context, guard.GuardServiceClient) error: + return f.(func(context.Context, guard.GuardServiceClient) error)(ctx, guard.NewGuardServiceClient(conn)) + case func(context.Context, escrow.EscrowServiceClient) error: + return f.(func(context.Context, escrow.EscrowServiceClient) error)(ctx, escrow.NewEscrowServiceClient(conn)) + default: + return fmt.Errorf("illegal function: %T", f) + } +} + +type ClientBuilder struct { + addr string + timeout time.Duration +} + +func (b *ClientBuilder) Timeout(to time.Duration) *ClientBuilder { + b.timeout = to + return b +} + +func builder(address string) ClientBuilder { + return ClientBuilder{ + addr: address, + timeout: defaultTimeout, + } +} + +func newGRPCConn(ctx context.Context, addr string) (*grpc.ClientConn, error) { + u, err := parse(addr) + if err != nil { + return nil, err + } + opts := []grpc.DialOption{grpc.WithBlock()} + if u.schema == "http" { + opts = append(opts, grpc.WithInsecure()) + } else if u.schema == "https" { + c := credentials.NewTLS(&tls.Config{}) + opts = append(opts, grpc.WithTransportCredentials(c)) + } else { + return nil, fmt.Errorf("not supported schema: %v", u.schema) + } + return grpc.DialContext(ctx, fmt.Sprintf("%s:%d", u.host, u.port), opts...) +} + +func parse(rawU string) (*parsedURL, error) { + if strings.Index(rawU, "//") == 0 { + rawU = defaultSchema + ":" + rawU + } + if !strings.Contains(rawU, "://") { + rawU = defaultSchema + "://" + rawU + } + u, err := url.Parse(rawU) + if err != nil { + return nil, err + } + h := u.Hostname() + if err := checkHost(h); err != nil { + return nil, err + } + result := new(parsedURL) + result.schema = u.Scheme + result.host = h + result.port, err = getPort(u) + if err != nil { + return nil, err + } + return result, nil +} + +func getPort(u *url.URL) (int, error) { + p := u.Port() + if p == "" { + switch u.Scheme { + case "http": + p = "80" + case "https": + p = "443" + default: + return -1, fmt.Errorf("not support schema: %v", u.Scheme) + } + } + return strconv.Atoi(p) +} + +func checkHost(host string) error { + if host == "" { + return errors.New("empty host") + } + host = strings.ToLower(host) + if domainRegexp.MatchString(host) { + return nil + } + if ipv4Regexp.MatchString(host) { + return nil + } + return fmt.Errorf("invalid host: %v", host) +} + +type parsedURL struct { + schema string + host string + port int +} diff --git a/utils/grpc_helper_test.go b/utils/grpc/client_test.go similarity index 96% rename from utils/grpc_helper_test.go rename to utils/grpc/client_test.go index 024eee1..f7a1767 100644 --- a/utils/grpc_helper_test.go +++ b/utils/grpc/client_test.go @@ -1,8 +1,7 @@ -package utils +package grpc import ( "context" - "google.golang.org/grpc" "google.golang.org/grpc/connectivity" "testing" "time" @@ -20,7 +19,7 @@ func TestNewGRPCConn(t *testing.T) { } for _, tt := range tests { ctx, cancelFunc := context.WithTimeout(context.Background(), 2*time.Second) - conn, err := NewGRPCConn(ctx, tt.in, grpc.WithBlock()) + conn, err := newGRPCConn(ctx, tt.in) if cancelFunc != nil { defer cancelFunc() } diff --git a/utils/grpc/escrow.go b/utils/grpc/escrow.go new file mode 100644 index 0000000..8f38ad1 --- /dev/null +++ b/utils/grpc/escrow.go @@ -0,0 +1,18 @@ +package grpc + +import ( + "context" + "github.com/tron-us/go-btfs-common/protos/escrow" +) + +func EscrowClient(addr string) *EscrowClientBuilder { + return &EscrowClientBuilder{builder(addr)} +} + +type EscrowClientBuilder struct { + ClientBuilder +} + +func (g *EscrowClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context, client escrow.EscrowServiceClient) error) error { + return g.doWithContext(ctx, f) +} diff --git a/utils/grpc/guard.go b/utils/grpc/guard.go new file mode 100644 index 0000000..ce1c345 --- /dev/null +++ b/utils/grpc/guard.go @@ -0,0 +1,18 @@ +package grpc + +import ( + "context" + "github.com/tron-us/go-btfs-common/protos/guard" +) + +func GuardClient(addr string) *GuardClientBuilder { + return &GuardClientBuilder{builder(addr)} +} + +type GuardClientBuilder struct { + ClientBuilder +} + +func (g *GuardClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context, client guard.GuardServiceClient) error) error { + return g.doWithContext(ctx, f) +} diff --git a/utils/grpc/hub.go b/utils/grpc/hub.go new file mode 100644 index 0000000..9fcb33e --- /dev/null +++ b/utils/grpc/hub.go @@ -0,0 +1,18 @@ +package grpc + +import ( + "context" + "github.com/tron-us/go-btfs-common/protos/hub" +) + +func HubQueryClient(addr string) *HubQueryClientBuilder { + return &HubQueryClientBuilder{builder(addr)} +} + +type HubQueryClientBuilder struct { + ClientBuilder +} + +func (g *HubQueryClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context, client hub.HubQueryClient) error) error { + return g.doWithContext(ctx, f) +} diff --git a/utils/grpc/status.go b/utils/grpc/status.go new file mode 100644 index 0000000..fdb77f2 --- /dev/null +++ b/utils/grpc/status.go @@ -0,0 +1,18 @@ +package grpc + +import ( + "context" + "github.com/tron-us/go-btfs-common/protos/status" +) + +func StatusClient(addr string) *StatusClientBuilder { + return &StatusClientBuilder{builder(addr)} +} + +type StatusClientBuilder struct { + ClientBuilder +} + +func (g *StatusClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context, client status.StatusClient) error) error { + return g.doWithContext(ctx, f) +} diff --git a/utils/grpc_helper.go b/utils/grpc_helper.go deleted file mode 100644 index fbfb5ba..0000000 --- a/utils/grpc_helper.go +++ /dev/null @@ -1,102 +0,0 @@ -package utils - -import ( - "context" - "crypto/tls" - "errors" - "fmt" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "net/url" - "regexp" - "strconv" - "strings" -) - -const ( - defaultSchema = "http" -) - -var ( - domainRegexp = regexp.MustCompile(`^(localhost)|([a-zA-Z0-9-]{1,63}\.)+([a-zA-Z]{1,63})$`) - ipv4Regexp = regexp.MustCompile(`^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$`) -) - -type parsedURL struct { - schema string - host string - port int -} - -func NewGRPCConn(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error) { - u, err := parse(address) - if err != nil { - return nil, err - } - if u.schema == "http" { - opts = append(opts, grpc.WithInsecure()) - } else if u.schema == "https" { - c := credentials.NewTLS(&tls.Config{}) - opts = append(opts, grpc.WithTransportCredentials(c)) - } else { - return nil, fmt.Errorf("not supported schema: %v", u.schema) - } - return grpc.DialContext(ctx, fmt.Sprintf("%s:%d", u.host, u.port), opts...) -} - -func parse(rawU string) (*parsedURL, error) { - if strings.Index(rawU, "//") == 0 { - rawU = defaultSchema + ":" + rawU - } - if !strings.Contains(rawU, "://") { - rawU = defaultSchema + "://" + rawU - } - u, err := url.Parse(rawU) - if err != nil { - return nil, err - } - h := u.Hostname() - if err := checkHost(h); err != nil { - return nil, err - } - result := new(parsedURL) - result.schema = u.Scheme - result.host = h - result.port, err = getPort(u) - if err != nil { - return nil, err - } - return result, nil -} - -func getPort(u *url.URL) (int, error) { - p := u.Port() - if p == "" { - switch u.Scheme { - case "http": - p = "80" - case "https": - p = "443" - default: - return -1, fmt.Errorf("not support schema: %v", u.Scheme) - } - } - return strconv.Atoi(p) -} - -func checkHost(host string) error { - if host == "" { - return errors.New("empty host") - } - - host = strings.ToLower(host) - if domainRegexp.MatchString(host) { - return nil - } - - if ipv4Regexp.MatchString(host) { - return nil - } - - return fmt.Errorf("invalid host: %v", host) -} From 98407667e4c7bab49d93381b5b30313b930d90b1 Mon Sep 17 00:00:00 2001 From: Robin Lai Date: Mon, 2 Dec 2019 13:52:49 -0800 Subject: [PATCH 3/4] update hub.proto --- protos/hub/hub.pb.go | 136 +++++++++++++++++++++---------------------- protos/hub/hub.proto | 2 +- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/protos/hub/hub.pb.go b/protos/hub/hub.pb.go index cc98856..02006bf 100644 --- a/protos/hub/hub.pb.go +++ b/protos/hub/hub.pb.go @@ -7,9 +7,9 @@ import ( context "context" encoding_binary "encoding/binary" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" _ "github.com/gogo/protobuf/types" golang_proto "github.com/golang/protobuf/proto" + _ "github.com/tron-us/protobuf/gogoproto" proto "github.com/tron-us/protobuf/proto" github_com_tron_us_protobuf_types "github.com/tron-us/protobuf/types" grpc "google.golang.org/grpc" @@ -825,73 +825,73 @@ func init() { proto.RegisterFile("protos/hub/hub.proto", fileDescriptor_c704b599 func init() { golang_proto.RegisterFile("protos/hub/hub.proto", fileDescriptor_c704b5990190a69f) } var fileDescriptor_c704b5990190a69f = []byte{ - // 1048 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x4f, 0x1b, 0x47, - 0x14, 0xce, 0x18, 0x03, 0xf6, 0xf3, 0xef, 0x09, 0x21, 0x1b, 0x47, 0x32, 0xae, 0xd5, 0xa8, 0x4e, - 0x9a, 0x1a, 0x89, 0x4a, 0xa9, 0xd4, 0x1b, 0x06, 0x17, 0x90, 0xa0, 0xd0, 0x31, 0x70, 0xe8, 0x65,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, 0xac, 0x4e, 0x84, 0x52, 0x7c, 0x14, 0xb5, 0xcc, 0xb3, 0x24, 0xa4, 0x07, - 0x50, 0x0a, 0x62, 0xbe, 0x8d, 0x4a, 0xad, 0xa5, 0x26, 0x69, 0x17, 0xb6, 0xea, 0x9d, 0x68, 0x8c, - 0x4e, 0x32, 0x46, 0xe7, 0x34, 0x19, 0xa3, 0x9b, 0xbb, 0xf9, 0x7d, 0xe3, 0xd1, 0x8f, 0x7f, 0x6c, - 0x10, 0x56, 0x4c, 0x4a, 0x31, 0x49, 0xdf, 0x40, 0x49, 0xc5, 0xda, 0x6c, 0x87, 0x6b, 0x6e, 0x65, - 0x4d, 0xab, 0x48, 0x54, 0xa2, 0x7a, 0x97, 0x6b, 0xce, 0x8a, 0x6a, 0x26, 0x6a, 0xfd, 0x35, 0x33, - 0x14, 0x02, 0xf4, 0x15, 0xd4, 0x94, 0x96, 0x01, 0x1f, 0x09, 0xdb, 0x0f, 0xdc, 0xa1, 0xb0, 0xb9, - 0xba, 0x32, 0x13, 0x12, 0x56, 0x89, 0x13, 0x27, 0x88, 0x6f, 0xab, 0x2b, 0xda, 0x81, 0xc7, 0x03, - 0xee, 0x39, 0xef, 0x5c, 0x47, 0x5f, 0xce, 0xb0, 0x33, 0x86, 0x5d, 0x4b, 0x53, 0x29, 0xbf, 0x0d, - 0xd5, 0xa4, 0x37, 0x8e, 0x6b, 0x4f, 0x5c, 0xcf, 0x8c, 0x4c, 0x58, 0x39, 0xc6, 0x71, 0x96, 0x23, - 0xd7, 0xa3, 0x9f, 0x41, 0x65, 0xda, 0x79, 0xec, 0x4e, 0x5c, 0x6d, 0x06, 0x22, 0xac, 0x9c, 0xc2, - 0x87, 0x88, 0xd2, 0x97, 0x50, 0x1d, 0xca, 0xf1, 0x98, 0x6b, 0x11, 0xf0, 0xb1, 0xad, 0x34, 0xbf, - 0x12, 0xd6, 0x72, 0xa4, 0x76, 0x8a, 0xf7, 0x11, 0x6e, 0x7d, 0x05, 0xb9,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, 0x3d, 0x69, 0x75, - 0xee, 0xad, 0x65, 0xe2, 0x6d, 0xbd, 0x76, 0x0f, 0x51, 0x3e, 0x7d, 0x09, 0xb9, 0x3d, 0xa1, 0x8d, - 0xbb, 0xd2, 0xd2, 0xd4, 0xf9, 0x91, 0x5d, 0x9e, 0x0d, 0x95, 0xdf, 0x7d, 0x73, 0x73, 0xdb, 0x20, - 0xbf, 0xdc, 0x36, 0xc8, 0x9f, 0xb7, 0x0d, 0xf2, 0xd3, 0x5d, 0x83, 0xfc, 0x7c, 0xd7, 0x20, 0x37, - 0x77, 0x0d, 0x02, 0x05, 0x57, 0x76, 0xd0, 0x69, 0xb0, 0xa0, 0x8b, 0x7a, 0x4e, 0xd0, 0xec, 0x4e, - 0xc8, 0xf7, 0xf8, 0x3f, 0xd3, 0x60, 0xc5, 0x58, 0xdf, 0x97, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, - 0xc9, 0xa1, 0x55, 0x0e, 0x57, 0x09, 0x00, 0x00, + // 1053 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x4f, 0x23, 0x47, + 0x10, 0xdd, 0x36, 0x06, 0xec, 0xf2, 0x77, 0x2f, 0xcb, 0xce, 0x7a, 0x25, 0xe3, 0x58, 0x59, 0xc5, + 0xbb, 0xd9, 0x98, 0x88, 0x48, 0x1b, 0x29, 0x37, 0x0c, 0x0e, 0x20, 0x41, 0x20, 0x6d, 0xe0, 0x90, + 0xcb, 0xa8, 0xed, 0x69, 0xcc, 0x08, 0x7b, 0x7a, 0x76, 0xba, 0x87, 0x55, 0xf6, 0x57, 0xe4, 0x98, + 0x9f, 0x93, 0x23, 0xc7, 0x28, 0x52, 0xae, 0x49, 0x04, 0x97, 0x9c, 0xf2, 0x1b, 0xa2, 0xea, 0xf9, + 0xb0, 0x0d, 0x8e, 0x94, 0x8d, 0x72, 0x40, 0xea, 0x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, 0x36, 0xc8, 0x1f, 0xb7, 0x0d, 0xf2, 0xe3, 0x5d, 0x83, + 0xfc, 0x74, 0xd7, 0x20, 0x37, 0x77, 0x0d, 0x02, 0x05, 0x57, 0x76, 0xd0, 0x69, 0xb0, 0xa0, 0x8b, + 0x7a, 0x4e, 0xd0, 0xec, 0x4e, 0xc8, 0x77, 0xf8, 0x6f, 0xd3, 0x60, 0xc5, 0x58, 0xdf, 0x17, 0x7f, + 0x07, 0x00, 0x00, 0xff, 0xff, 0x16, 0x90, 0xc4, 0xd2, 0x5a, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/protos/hub/hub.proto b/protos/hub/hub.proto index 6d7cb4d..20626b2 100644 --- a/protos/hub/hub.proto +++ b/protos/hub/hub.proto @@ -16,7 +16,7 @@ option java_multiple_files = true; option java_outer_classname = "HubProto"; option java_package = "io.btfs.hub"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/tron-us/protobuf/gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; service HubQuery { From b643c84f2c766793f98ba6ccc98cca5738468683 Mon Sep 17 00:00:00 2001 From: Robin Lai Date: Mon, 2 Dec 2019 14:22:03 -0800 Subject: [PATCH 4/4] refactor imports and extract variable --- utils/grpc/client.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/utils/grpc/client.go b/utils/grpc/client.go index 898b430..5e32cf2 100644 --- a/utils/grpc/client.go +++ b/utils/grpc/client.go @@ -5,18 +5,20 @@ import ( "crypto/tls" "errors" "fmt" + "net/url" + "regexp" + "strconv" + "strings" + "time" + "github.com/tron-us/go-btfs-common/protos/escrow" "github.com/tron-us/go-btfs-common/protos/guard" "github.com/tron-us/go-btfs-common/protos/hub" "github.com/tron-us/go-btfs-common/protos/status" + "google.golang.org/grpc" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" - "net/url" - "regexp" - "strconv" - "strings" - "time" ) const ( @@ -44,15 +46,15 @@ func (g *ClientBuilder) doWithContext(ctx context.Context, f interface{}) error if conn == nil || conn.GetState() != connectivity.Ready { return errors.New("failed to get connection") } - switch f.(type) { + switch v := f.(type) { case func(context.Context, status.StatusClient) error: - return f.(func(context.Context, status.StatusClient) error)(ctx, status.NewStatusClient(conn)) + return v(ctx, status.NewStatusClient(conn)) case func(context.Context, hub.HubQueryClient) error: - return f.(func(context.Context, hub.HubQueryClient) error)(ctx, hub.NewHubQueryClient(conn)) + return v(ctx, hub.NewHubQueryClient(conn)) case func(context.Context, guard.GuardServiceClient) error: - return f.(func(context.Context, guard.GuardServiceClient) error)(ctx, guard.NewGuardServiceClient(conn)) + return v(ctx, guard.NewGuardServiceClient(conn)) case func(context.Context, escrow.EscrowServiceClient) error: - return f.(func(context.Context, escrow.EscrowServiceClient) error)(ctx, escrow.NewEscrowServiceClient(conn)) + return v(ctx, escrow.NewEscrowServiceClient(conn)) default: return fmt.Errorf("illegal function: %T", f) }