From e2d71261dd5a389e2af4480726f4a7910a804c98 Mon Sep 17 00:00:00 2001 From: Jeffrey Picard Date: Tue, 18 May 2021 06:02:55 -0400 Subject: [PATCH] more features --- main.go | 8 + protobuf/definitions/hub.proto | 60 ++- protobuf/go/hub.pb.go | 940 ++++++++++++++++++--------------- server/search.go | 254 ++++++--- 4 files changed, 762 insertions(+), 500 deletions(-) diff --git a/main.go b/main.go index c371503..30dc10c 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,8 @@ func parseArgs(searchRequest *pb.SearchRequest) { id := flag.String("id", "", "_id") author := flag.String("author", "", "author") title := flag.String("title", "", "title") + channelName := flag.String("channelName", "", "channel name") + description := flag.String("description", "", "description") flag.Parse() @@ -43,6 +45,12 @@ func parseArgs(searchRequest *pb.SearchRequest) { if *title != "" { searchRequest.Title = []string{*title} } + if *channelName != "" { + searchRequest.ChannelId = &pb.InvertibleField{Invert: false, Value: []string{*channelName}} + } + if *description != "" { + searchRequest.Description = []string{*description} + } } func main() { diff --git a/protobuf/definitions/hub.proto b/protobuf/definitions/hub.proto index 8ffbcc4..6208395 100644 --- a/protobuf/definitions/hub.proto +++ b/protobuf/definitions/hub.proto @@ -8,7 +8,12 @@ service Hub { rpc Search (SearchRequest) returns (SearchReply) {} } -message RangeQuery { +message InvertibleField { + bool invert = 1; + repeated string value = 2; +} + +message RangeField { enum Op { EQ = 0; LTE = 1; @@ -25,46 +30,46 @@ message SearchRequest { string name = 2; int32 amount_order = 3; int32 limit = 4; - string order_by = 5; + repeated string order_by = 5; int32 offset = 6; bool is_controlling = 7; string last_take_over_height = 20; - repeated string claim_id = 21; + InvertibleField claim_id = 21; repeated string claim_name = 22; repeated string normalized = 23; - RangeQuery tx_position = 24; - RangeQuery amount = 25; - RangeQuery timestamp = 26; - RangeQuery creation_timestamp = 27; - RangeQuery height = 28; - RangeQuery creation_height = 29; - RangeQuery activation_height = 30; - RangeQuery expiration_height = 31; - RangeQuery release_time = 32; + RangeField tx_position = 24; + RangeField amount = 25; + RangeField timestamp = 26; + RangeField creation_timestamp = 27; + RangeField height = 28; + RangeField creation_height = 29; + RangeField activation_height = 30; + RangeField expiration_height = 31; + RangeField release_time = 32; repeated string short_url = 33; repeated string canonical_url = 34; repeated string title = 35; repeated string author = 36; repeated string description = 37; repeated string claim_type = 38; - RangeQuery reposted = 39; + RangeField reposted = 39; repeated string stream_type = 40; repeated string media_type = 41; - RangeQuery fee_amount = 42; + RangeField fee_amount = 42; repeated string fee_currency = 43; - RangeQuery duration = 44; + RangeField duration = 44; string reposted_claim_hash = 45; - RangeQuery censor_type = 46; + RangeField censor_type = 46; string claims_in_channel = 47; - RangeQuery channel_join = 48; - string signature_valid = 49; - RangeQuery effective_amount = 50; - RangeQuery support_amount = 51; - RangeQuery trending_group = 52; - RangeQuery trending_mixed = 53; - RangeQuery trending_local = 54; - RangeQuery trending_global = 55; - repeated string channel_id = 56; + RangeField channel_join = 48; + bool signature_valid = 49; + RangeField effective_amount = 50; + RangeField support_amount = 51; + RangeField trending_group = 52; + RangeField trending_mixed = 53; + RangeField trending_local = 54; + RangeField trending_global = 55; + InvertibleField channel_id = 56; repeated string tx_id = 57; string tx_nout = 58; repeated string signature = 59; @@ -73,8 +78,11 @@ message SearchRequest { repeated string public_key_hash = 62; string public_key_id = 63; repeated bytes _id = 64; - repeated string tags = 65; + InvertibleField tags = 65; repeated string reposted_claim_id = 66; + bool has_channel_signature = 67; + bool has_source = 68; + int32 limit_claims_per_channel = 69; } message SearchReply { diff --git a/protobuf/go/hub.pb.go b/protobuf/go/hub.pb.go index 1bd29b6..757745f 100644 --- a/protobuf/go/hub.pb.go +++ b/protobuf/go/hub.pb.go @@ -20,26 +20,26 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type RangeQuery_Op int32 +type RangeField_Op int32 const ( - RangeQuery_EQ RangeQuery_Op = 0 - RangeQuery_LTE RangeQuery_Op = 1 - RangeQuery_GTE RangeQuery_Op = 2 - RangeQuery_LT RangeQuery_Op = 3 - RangeQuery_GT RangeQuery_Op = 4 + RangeField_EQ RangeField_Op = 0 + RangeField_LTE RangeField_Op = 1 + RangeField_GTE RangeField_Op = 2 + RangeField_LT RangeField_Op = 3 + RangeField_GT RangeField_Op = 4 ) -// Enum value maps for RangeQuery_Op. +// Enum value maps for RangeField_Op. var ( - RangeQuery_Op_name = map[int32]string{ + RangeField_Op_name = map[int32]string{ 0: "EQ", 1: "LTE", 2: "GTE", 3: "LT", 4: "GT", } - RangeQuery_Op_value = map[string]int32{ + RangeField_Op_value = map[string]int32{ "EQ": 0, "LTE": 1, "GTE": 2, @@ -48,31 +48,31 @@ var ( } ) -func (x RangeQuery_Op) Enum() *RangeQuery_Op { - p := new(RangeQuery_Op) +func (x RangeField_Op) Enum() *RangeField_Op { + p := new(RangeField_Op) *p = x return p } -func (x RangeQuery_Op) String() string { +func (x RangeField_Op) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (RangeQuery_Op) Descriptor() protoreflect.EnumDescriptor { +func (RangeField_Op) Descriptor() protoreflect.EnumDescriptor { return file_hub_proto_enumTypes[0].Descriptor() } -func (RangeQuery_Op) Type() protoreflect.EnumType { +func (RangeField_Op) Type() protoreflect.EnumType { return &file_hub_proto_enumTypes[0] } -func (x RangeQuery_Op) Number() protoreflect.EnumNumber { +func (x RangeField_Op) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use RangeQuery_Op.Descriptor instead. -func (RangeQuery_Op) EnumDescriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{0, 0} +// Deprecated: Use RangeField_Op.Descriptor instead. +func (RangeField_Op) EnumDescriptor() ([]byte, []int) { + return file_hub_proto_rawDescGZIP(), []int{1, 0} } type Error_Code int32 @@ -124,20 +124,20 @@ func (x Error_Code) Number() protoreflect.EnumNumber { // Deprecated: Use Error_Code.Descriptor instead. func (Error_Code) EnumDescriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{5, 0} + return file_hub_proto_rawDescGZIP(), []int{6, 0} } -type RangeQuery struct { +type InvertibleField struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Op RangeQuery_Op `protobuf:"varint,1,opt,name=op,proto3,enum=pb.RangeQuery_Op" json:"op"` - Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value"` + Invert bool `protobuf:"varint,1,opt,name=invert,proto3" json:"invert"` + Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value"` } -func (x *RangeQuery) Reset() { - *x = RangeQuery{} +func (x *InvertibleField) Reset() { + *x = InvertibleField{} if protoimpl.UnsafeEnabled { mi := &file_hub_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -145,13 +145,13 @@ func (x *RangeQuery) Reset() { } } -func (x *RangeQuery) String() string { +func (x *InvertibleField) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RangeQuery) ProtoMessage() {} +func (*InvertibleField) ProtoMessage() {} -func (x *RangeQuery) ProtoReflect() protoreflect.Message { +func (x *InvertibleField) ProtoReflect() protoreflect.Message { mi := &file_hub_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -163,19 +163,74 @@ func (x *RangeQuery) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RangeQuery.ProtoReflect.Descriptor instead. -func (*RangeQuery) Descriptor() ([]byte, []int) { +// Deprecated: Use InvertibleField.ProtoReflect.Descriptor instead. +func (*InvertibleField) Descriptor() ([]byte, []int) { return file_hub_proto_rawDescGZIP(), []int{0} } -func (x *RangeQuery) GetOp() RangeQuery_Op { +func (x *InvertibleField) GetInvert() bool { + if x != nil { + return x.Invert + } + return false +} + +func (x *InvertibleField) GetValue() []string { + if x != nil { + return x.Value + } + return nil +} + +type RangeField struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Op RangeField_Op `protobuf:"varint,1,opt,name=op,proto3,enum=pb.RangeField_Op" json:"op"` + Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value"` +} + +func (x *RangeField) Reset() { + *x = RangeField{} + if protoimpl.UnsafeEnabled { + mi := &file_hub_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RangeField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RangeField) ProtoMessage() {} + +func (x *RangeField) ProtoReflect() protoreflect.Message { + mi := &file_hub_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RangeField.ProtoReflect.Descriptor instead. +func (*RangeField) Descriptor() ([]byte, []int) { + return file_hub_proto_rawDescGZIP(), []int{1} +} + +func (x *RangeField) GetOp() RangeField_Op { if x != nil { return x.Op } - return RangeQuery_EQ + return RangeField_EQ } -func (x *RangeQuery) GetValue() []string { +func (x *RangeField) GetValue() []string { if x != nil { return x.Value } @@ -187,66 +242,69 @@ type SearchRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` - AmountOrder int32 `protobuf:"varint,3,opt,name=amount_order,json=amountOrder,proto3" json:"amount_order"` - Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit"` - OrderBy string `protobuf:"bytes,5,opt,name=order_by,json=orderBy,proto3" json:"order_by"` - Offset int32 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset"` - IsControlling bool `protobuf:"varint,7,opt,name=is_controlling,json=isControlling,proto3" json:"is_controlling"` - LastTakeOverHeight string `protobuf:"bytes,20,opt,name=last_take_over_height,json=lastTakeOverHeight,proto3" json:"last_take_over_height"` - ClaimId []string `protobuf:"bytes,21,rep,name=claim_id,json=claimId,proto3" json:"claim_id"` - ClaimName []string `protobuf:"bytes,22,rep,name=claim_name,json=claimName,proto3" json:"claim_name"` - Normalized []string `protobuf:"bytes,23,rep,name=normalized,proto3" json:"normalized"` - TxPosition *RangeQuery `protobuf:"bytes,24,opt,name=tx_position,json=txPosition,proto3" json:"tx_position"` - Amount *RangeQuery `protobuf:"bytes,25,opt,name=amount,proto3" json:"amount"` - Timestamp *RangeQuery `protobuf:"bytes,26,opt,name=timestamp,proto3" json:"timestamp"` - CreationTimestamp *RangeQuery `protobuf:"bytes,27,opt,name=creation_timestamp,json=creationTimestamp,proto3" json:"creation_timestamp"` - Height *RangeQuery `protobuf:"bytes,28,opt,name=height,proto3" json:"height"` - CreationHeight *RangeQuery `protobuf:"bytes,29,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height"` - ActivationHeight *RangeQuery `protobuf:"bytes,30,opt,name=activation_height,json=activationHeight,proto3" json:"activation_height"` - ExpirationHeight *RangeQuery `protobuf:"bytes,31,opt,name=expiration_height,json=expirationHeight,proto3" json:"expiration_height"` - ReleaseTime *RangeQuery `protobuf:"bytes,32,opt,name=release_time,json=releaseTime,proto3" json:"release_time"` - ShortUrl []string `protobuf:"bytes,33,rep,name=short_url,json=shortUrl,proto3" json:"short_url"` - CanonicalUrl []string `protobuf:"bytes,34,rep,name=canonical_url,json=canonicalUrl,proto3" json:"canonical_url"` - Title []string `protobuf:"bytes,35,rep,name=title,proto3" json:"title"` - Author []string `protobuf:"bytes,36,rep,name=author,proto3" json:"author"` - Description []string `protobuf:"bytes,37,rep,name=description,proto3" json:"description"` - ClaimType []string `protobuf:"bytes,38,rep,name=claim_type,json=claimType,proto3" json:"claim_type"` - Reposted *RangeQuery `protobuf:"bytes,39,opt,name=reposted,proto3" json:"reposted"` - StreamType []string `protobuf:"bytes,40,rep,name=stream_type,json=streamType,proto3" json:"stream_type"` - MediaType []string `protobuf:"bytes,41,rep,name=media_type,json=mediaType,proto3" json:"media_type"` - FeeAmount *RangeQuery `protobuf:"bytes,42,opt,name=fee_amount,json=feeAmount,proto3" json:"fee_amount"` - FeeCurrency []string `protobuf:"bytes,43,rep,name=fee_currency,json=feeCurrency,proto3" json:"fee_currency"` - Duration *RangeQuery `protobuf:"bytes,44,opt,name=duration,proto3" json:"duration"` - RepostedClaimHash string `protobuf:"bytes,45,opt,name=reposted_claim_hash,json=repostedClaimHash,proto3" json:"reposted_claim_hash"` - CensorType *RangeQuery `protobuf:"bytes,46,opt,name=censor_type,json=censorType,proto3" json:"censor_type"` - ClaimsInChannel string `protobuf:"bytes,47,opt,name=claims_in_channel,json=claimsInChannel,proto3" json:"claims_in_channel"` - ChannelJoin *RangeQuery `protobuf:"bytes,48,opt,name=channel_join,json=channelJoin,proto3" json:"channel_join"` - SignatureValid string `protobuf:"bytes,49,opt,name=signature_valid,json=signatureValid,proto3" json:"signature_valid"` - EffectiveAmount *RangeQuery `protobuf:"bytes,50,opt,name=effective_amount,json=effectiveAmount,proto3" json:"effective_amount"` - SupportAmount *RangeQuery `protobuf:"bytes,51,opt,name=support_amount,json=supportAmount,proto3" json:"support_amount"` - TrendingGroup *RangeQuery `protobuf:"bytes,52,opt,name=trending_group,json=trendingGroup,proto3" json:"trending_group"` - TrendingMixed *RangeQuery `protobuf:"bytes,53,opt,name=trending_mixed,json=trendingMixed,proto3" json:"trending_mixed"` - TrendingLocal *RangeQuery `protobuf:"bytes,54,opt,name=trending_local,json=trendingLocal,proto3" json:"trending_local"` - TrendingGlobal *RangeQuery `protobuf:"bytes,55,opt,name=trending_global,json=trendingGlobal,proto3" json:"trending_global"` - ChannelId []string `protobuf:"bytes,56,rep,name=channel_id,json=channelId,proto3" json:"channel_id"` - TxId []string `protobuf:"bytes,57,rep,name=tx_id,json=txId,proto3" json:"tx_id"` - TxNout string `protobuf:"bytes,58,opt,name=tx_nout,json=txNout,proto3" json:"tx_nout"` - Signature []string `protobuf:"bytes,59,rep,name=signature,proto3" json:"signature"` - SignatureDigest []string `protobuf:"bytes,60,rep,name=signature_digest,json=signatureDigest,proto3" json:"signature_digest"` - PublicKeyBytes []string `protobuf:"bytes,61,rep,name=public_key_bytes,json=publicKeyBytes,proto3" json:"public_key_bytes"` - PublicKeyHash []string `protobuf:"bytes,62,rep,name=public_key_hash,json=publicKeyHash,proto3" json:"public_key_hash"` - PublicKeyId string `protobuf:"bytes,63,opt,name=public_key_id,json=publicKeyId,proto3" json:"public_key_id"` - XId [][]byte `protobuf:"bytes,64,rep,name=_id,json=Id,proto3" json:"_id"` - Tags []string `protobuf:"bytes,65,rep,name=tags,proto3" json:"tags"` - RepostedClaimId []string `protobuf:"bytes,66,rep,name=reposted_claim_id,json=repostedClaimId,proto3" json:"reposted_claim_id"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` + AmountOrder int32 `protobuf:"varint,3,opt,name=amount_order,json=amountOrder,proto3" json:"amount_order"` + Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit"` + OrderBy []string `protobuf:"bytes,5,rep,name=order_by,json=orderBy,proto3" json:"order_by"` + Offset int32 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset"` + IsControlling bool `protobuf:"varint,7,opt,name=is_controlling,json=isControlling,proto3" json:"is_controlling"` + LastTakeOverHeight string `protobuf:"bytes,20,opt,name=last_take_over_height,json=lastTakeOverHeight,proto3" json:"last_take_over_height"` + ClaimId *InvertibleField `protobuf:"bytes,21,opt,name=claim_id,json=claimId,proto3" json:"claim_id"` + ClaimName []string `protobuf:"bytes,22,rep,name=claim_name,json=claimName,proto3" json:"claim_name"` + Normalized []string `protobuf:"bytes,23,rep,name=normalized,proto3" json:"normalized"` + TxPosition *RangeField `protobuf:"bytes,24,opt,name=tx_position,json=txPosition,proto3" json:"tx_position"` + Amount *RangeField `protobuf:"bytes,25,opt,name=amount,proto3" json:"amount"` + Timestamp *RangeField `protobuf:"bytes,26,opt,name=timestamp,proto3" json:"timestamp"` + CreationTimestamp *RangeField `protobuf:"bytes,27,opt,name=creation_timestamp,json=creationTimestamp,proto3" json:"creation_timestamp"` + Height *RangeField `protobuf:"bytes,28,opt,name=height,proto3" json:"height"` + CreationHeight *RangeField `protobuf:"bytes,29,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height"` + ActivationHeight *RangeField `protobuf:"bytes,30,opt,name=activation_height,json=activationHeight,proto3" json:"activation_height"` + ExpirationHeight *RangeField `protobuf:"bytes,31,opt,name=expiration_height,json=expirationHeight,proto3" json:"expiration_height"` + ReleaseTime *RangeField `protobuf:"bytes,32,opt,name=release_time,json=releaseTime,proto3" json:"release_time"` + ShortUrl []string `protobuf:"bytes,33,rep,name=short_url,json=shortUrl,proto3" json:"short_url"` + CanonicalUrl []string `protobuf:"bytes,34,rep,name=canonical_url,json=canonicalUrl,proto3" json:"canonical_url"` + Title []string `protobuf:"bytes,35,rep,name=title,proto3" json:"title"` + Author []string `protobuf:"bytes,36,rep,name=author,proto3" json:"author"` + Description []string `protobuf:"bytes,37,rep,name=description,proto3" json:"description"` + ClaimType []string `protobuf:"bytes,38,rep,name=claim_type,json=claimType,proto3" json:"claim_type"` + Reposted *RangeField `protobuf:"bytes,39,opt,name=reposted,proto3" json:"reposted"` + StreamType []string `protobuf:"bytes,40,rep,name=stream_type,json=streamType,proto3" json:"stream_type"` + MediaType []string `protobuf:"bytes,41,rep,name=media_type,json=mediaType,proto3" json:"media_type"` + FeeAmount *RangeField `protobuf:"bytes,42,opt,name=fee_amount,json=feeAmount,proto3" json:"fee_amount"` + FeeCurrency []string `protobuf:"bytes,43,rep,name=fee_currency,json=feeCurrency,proto3" json:"fee_currency"` + Duration *RangeField `protobuf:"bytes,44,opt,name=duration,proto3" json:"duration"` + RepostedClaimHash string `protobuf:"bytes,45,opt,name=reposted_claim_hash,json=repostedClaimHash,proto3" json:"reposted_claim_hash"` + CensorType *RangeField `protobuf:"bytes,46,opt,name=censor_type,json=censorType,proto3" json:"censor_type"` + ClaimsInChannel string `protobuf:"bytes,47,opt,name=claims_in_channel,json=claimsInChannel,proto3" json:"claims_in_channel"` + ChannelJoin *RangeField `protobuf:"bytes,48,opt,name=channel_join,json=channelJoin,proto3" json:"channel_join"` + SignatureValid bool `protobuf:"varint,49,opt,name=signature_valid,json=signatureValid,proto3" json:"signature_valid"` + EffectiveAmount *RangeField `protobuf:"bytes,50,opt,name=effective_amount,json=effectiveAmount,proto3" json:"effective_amount"` + SupportAmount *RangeField `protobuf:"bytes,51,opt,name=support_amount,json=supportAmount,proto3" json:"support_amount"` + TrendingGroup *RangeField `protobuf:"bytes,52,opt,name=trending_group,json=trendingGroup,proto3" json:"trending_group"` + TrendingMixed *RangeField `protobuf:"bytes,53,opt,name=trending_mixed,json=trendingMixed,proto3" json:"trending_mixed"` + TrendingLocal *RangeField `protobuf:"bytes,54,opt,name=trending_local,json=trendingLocal,proto3" json:"trending_local"` + TrendingGlobal *RangeField `protobuf:"bytes,55,opt,name=trending_global,json=trendingGlobal,proto3" json:"trending_global"` + ChannelId *InvertibleField `protobuf:"bytes,56,opt,name=channel_id,json=channelId,proto3" json:"channel_id"` + TxId []string `protobuf:"bytes,57,rep,name=tx_id,json=txId,proto3" json:"tx_id"` + TxNout string `protobuf:"bytes,58,opt,name=tx_nout,json=txNout,proto3" json:"tx_nout"` + Signature []string `protobuf:"bytes,59,rep,name=signature,proto3" json:"signature"` + SignatureDigest []string `protobuf:"bytes,60,rep,name=signature_digest,json=signatureDigest,proto3" json:"signature_digest"` + PublicKeyBytes []string `protobuf:"bytes,61,rep,name=public_key_bytes,json=publicKeyBytes,proto3" json:"public_key_bytes"` + PublicKeyHash []string `protobuf:"bytes,62,rep,name=public_key_hash,json=publicKeyHash,proto3" json:"public_key_hash"` + PublicKeyId string `protobuf:"bytes,63,opt,name=public_key_id,json=publicKeyId,proto3" json:"public_key_id"` + XId [][]byte `protobuf:"bytes,64,rep,name=_id,json=Id,proto3" json:"_id"` + Tags *InvertibleField `protobuf:"bytes,65,opt,name=tags,proto3" json:"tags"` + RepostedClaimId []string `protobuf:"bytes,66,rep,name=reposted_claim_id,json=repostedClaimId,proto3" json:"reposted_claim_id"` + HasChannelSignature bool `protobuf:"varint,67,opt,name=has_channel_signature,json=hasChannelSignature,proto3" json:"has_channel_signature"` + HasSource bool `protobuf:"varint,68,opt,name=has_source,json=hasSource,proto3" json:"has_source"` + LimitClaimsPerChannel int32 `protobuf:"varint,69,opt,name=limit_claims_per_channel,json=limitClaimsPerChannel,proto3" json:"limit_claims_per_channel"` } func (x *SearchRequest) Reset() { *x = SearchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_hub_proto_msgTypes[1] + mi := &file_hub_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -259,7 +317,7 @@ func (x *SearchRequest) String() string { func (*SearchRequest) ProtoMessage() {} func (x *SearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_hub_proto_msgTypes[1] + mi := &file_hub_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -272,7 +330,7 @@ func (x *SearchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. func (*SearchRequest) Descriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{1} + return file_hub_proto_rawDescGZIP(), []int{2} } func (x *SearchRequest) GetQuery() string { @@ -303,11 +361,11 @@ func (x *SearchRequest) GetLimit() int32 { return 0 } -func (x *SearchRequest) GetOrderBy() string { +func (x *SearchRequest) GetOrderBy() []string { if x != nil { return x.OrderBy } - return "" + return nil } func (x *SearchRequest) GetOffset() int32 { @@ -331,7 +389,7 @@ func (x *SearchRequest) GetLastTakeOverHeight() string { return "" } -func (x *SearchRequest) GetClaimId() []string { +func (x *SearchRequest) GetClaimId() *InvertibleField { if x != nil { return x.ClaimId } @@ -352,63 +410,63 @@ func (x *SearchRequest) GetNormalized() []string { return nil } -func (x *SearchRequest) GetTxPosition() *RangeQuery { +func (x *SearchRequest) GetTxPosition() *RangeField { if x != nil { return x.TxPosition } return nil } -func (x *SearchRequest) GetAmount() *RangeQuery { +func (x *SearchRequest) GetAmount() *RangeField { if x != nil { return x.Amount } return nil } -func (x *SearchRequest) GetTimestamp() *RangeQuery { +func (x *SearchRequest) GetTimestamp() *RangeField { if x != nil { return x.Timestamp } return nil } -func (x *SearchRequest) GetCreationTimestamp() *RangeQuery { +func (x *SearchRequest) GetCreationTimestamp() *RangeField { if x != nil { return x.CreationTimestamp } return nil } -func (x *SearchRequest) GetHeight() *RangeQuery { +func (x *SearchRequest) GetHeight() *RangeField { if x != nil { return x.Height } return nil } -func (x *SearchRequest) GetCreationHeight() *RangeQuery { +func (x *SearchRequest) GetCreationHeight() *RangeField { if x != nil { return x.CreationHeight } return nil } -func (x *SearchRequest) GetActivationHeight() *RangeQuery { +func (x *SearchRequest) GetActivationHeight() *RangeField { if x != nil { return x.ActivationHeight } return nil } -func (x *SearchRequest) GetExpirationHeight() *RangeQuery { +func (x *SearchRequest) GetExpirationHeight() *RangeField { if x != nil { return x.ExpirationHeight } return nil } -func (x *SearchRequest) GetReleaseTime() *RangeQuery { +func (x *SearchRequest) GetReleaseTime() *RangeField { if x != nil { return x.ReleaseTime } @@ -457,7 +515,7 @@ func (x *SearchRequest) GetClaimType() []string { return nil } -func (x *SearchRequest) GetReposted() *RangeQuery { +func (x *SearchRequest) GetReposted() *RangeField { if x != nil { return x.Reposted } @@ -478,7 +536,7 @@ func (x *SearchRequest) GetMediaType() []string { return nil } -func (x *SearchRequest) GetFeeAmount() *RangeQuery { +func (x *SearchRequest) GetFeeAmount() *RangeField { if x != nil { return x.FeeAmount } @@ -492,7 +550,7 @@ func (x *SearchRequest) GetFeeCurrency() []string { return nil } -func (x *SearchRequest) GetDuration() *RangeQuery { +func (x *SearchRequest) GetDuration() *RangeField { if x != nil { return x.Duration } @@ -506,7 +564,7 @@ func (x *SearchRequest) GetRepostedClaimHash() string { return "" } -func (x *SearchRequest) GetCensorType() *RangeQuery { +func (x *SearchRequest) GetCensorType() *RangeField { if x != nil { return x.CensorType } @@ -520,63 +578,63 @@ func (x *SearchRequest) GetClaimsInChannel() string { return "" } -func (x *SearchRequest) GetChannelJoin() *RangeQuery { +func (x *SearchRequest) GetChannelJoin() *RangeField { if x != nil { return x.ChannelJoin } return nil } -func (x *SearchRequest) GetSignatureValid() string { +func (x *SearchRequest) GetSignatureValid() bool { if x != nil { return x.SignatureValid } - return "" + return false } -func (x *SearchRequest) GetEffectiveAmount() *RangeQuery { +func (x *SearchRequest) GetEffectiveAmount() *RangeField { if x != nil { return x.EffectiveAmount } return nil } -func (x *SearchRequest) GetSupportAmount() *RangeQuery { +func (x *SearchRequest) GetSupportAmount() *RangeField { if x != nil { return x.SupportAmount } return nil } -func (x *SearchRequest) GetTrendingGroup() *RangeQuery { +func (x *SearchRequest) GetTrendingGroup() *RangeField { if x != nil { return x.TrendingGroup } return nil } -func (x *SearchRequest) GetTrendingMixed() *RangeQuery { +func (x *SearchRequest) GetTrendingMixed() *RangeField { if x != nil { return x.TrendingMixed } return nil } -func (x *SearchRequest) GetTrendingLocal() *RangeQuery { +func (x *SearchRequest) GetTrendingLocal() *RangeField { if x != nil { return x.TrendingLocal } return nil } -func (x *SearchRequest) GetTrendingGlobal() *RangeQuery { +func (x *SearchRequest) GetTrendingGlobal() *RangeField { if x != nil { return x.TrendingGlobal } return nil } -func (x *SearchRequest) GetChannelId() []string { +func (x *SearchRequest) GetChannelId() *InvertibleField { if x != nil { return x.ChannelId } @@ -639,7 +697,7 @@ func (x *SearchRequest) GetXId() [][]byte { return nil } -func (x *SearchRequest) GetTags() []string { +func (x *SearchRequest) GetTags() *InvertibleField { if x != nil { return x.Tags } @@ -653,6 +711,27 @@ func (x *SearchRequest) GetRepostedClaimId() []string { return nil } +func (x *SearchRequest) GetHasChannelSignature() bool { + if x != nil { + return x.HasChannelSignature + } + return false +} + +func (x *SearchRequest) GetHasSource() bool { + if x != nil { + return x.HasSource + } + return false +} + +func (x *SearchRequest) GetLimitClaimsPerChannel() int32 { + if x != nil { + return x.LimitClaimsPerChannel + } + return 0 +} + type SearchReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -669,7 +748,7 @@ type SearchReply struct { func (x *SearchReply) Reset() { *x = SearchReply{} if protoimpl.UnsafeEnabled { - mi := &file_hub_proto_msgTypes[2] + mi := &file_hub_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -682,7 +761,7 @@ func (x *SearchReply) String() string { func (*SearchReply) ProtoMessage() {} func (x *SearchReply) ProtoReflect() protoreflect.Message { - mi := &file_hub_proto_msgTypes[2] + mi := &file_hub_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -695,7 +774,7 @@ func (x *SearchReply) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchReply.ProtoReflect.Descriptor instead. func (*SearchReply) Descriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{2} + return file_hub_proto_rawDescGZIP(), []int{3} } func (x *SearchReply) GetTxos() []*Output { @@ -757,7 +836,7 @@ type Output struct { func (x *Output) Reset() { *x = Output{} if protoimpl.UnsafeEnabled { - mi := &file_hub_proto_msgTypes[3] + mi := &file_hub_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -770,7 +849,7 @@ func (x *Output) String() string { func (*Output) ProtoMessage() {} func (x *Output) ProtoReflect() protoreflect.Message { - mi := &file_hub_proto_msgTypes[3] + mi := &file_hub_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -783,7 +862,7 @@ func (x *Output) ProtoReflect() protoreflect.Message { // Deprecated: Use Output.ProtoReflect.Descriptor instead. func (*Output) Descriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{3} + return file_hub_proto_rawDescGZIP(), []int{4} } func (x *Output) GetTxHash() []byte { @@ -871,7 +950,7 @@ type ClaimMeta struct { func (x *ClaimMeta) Reset() { *x = ClaimMeta{} if protoimpl.UnsafeEnabled { - mi := &file_hub_proto_msgTypes[4] + mi := &file_hub_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -884,7 +963,7 @@ func (x *ClaimMeta) String() string { func (*ClaimMeta) ProtoMessage() {} func (x *ClaimMeta) ProtoReflect() protoreflect.Message { - mi := &file_hub_proto_msgTypes[4] + mi := &file_hub_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -897,7 +976,7 @@ func (x *ClaimMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use ClaimMeta.ProtoReflect.Descriptor instead. func (*ClaimMeta) Descriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{4} + return file_hub_proto_rawDescGZIP(), []int{5} } func (x *ClaimMeta) GetChannel() *Output { @@ -1032,7 +1111,7 @@ type Error struct { func (x *Error) Reset() { *x = Error{} if protoimpl.UnsafeEnabled { - mi := &file_hub_proto_msgTypes[5] + mi := &file_hub_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1045,7 +1124,7 @@ func (x *Error) String() string { func (*Error) ProtoMessage() {} func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_hub_proto_msgTypes[5] + mi := &file_hub_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1058,7 +1137,7 @@ func (x *Error) ProtoReflect() protoreflect.Message { // Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{5} + return file_hub_proto_rawDescGZIP(), []int{6} } func (x *Error) GetCode() Error_Code { @@ -1094,7 +1173,7 @@ type Blocked struct { func (x *Blocked) Reset() { *x = Blocked{} if protoimpl.UnsafeEnabled { - mi := &file_hub_proto_msgTypes[6] + mi := &file_hub_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1107,7 +1186,7 @@ func (x *Blocked) String() string { func (*Blocked) ProtoMessage() {} func (x *Blocked) ProtoReflect() protoreflect.Message { - mi := &file_hub_proto_msgTypes[6] + mi := &file_hub_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1120,7 +1199,7 @@ func (x *Blocked) ProtoReflect() protoreflect.Message { // Deprecated: Use Blocked.ProtoReflect.Descriptor instead. func (*Blocked) Descriptor() ([]byte, []int) { - return file_hub_proto_rawDescGZIP(), []int{6} + return file_hub_proto_rawDescGZIP(), []int{7} } func (x *Blocked) GetCount() uint32 { @@ -1141,235 +1220,252 @@ var File_hub_proto protoreflect.FileDescriptor var file_hub_proto_rawDesc = []byte{ 0x0a, 0x09, 0x68, 0x75, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, - 0x75, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x21, 0x0a, - 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x4f, 0x70, 0x52, 0x02, 0x6f, 0x70, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2e, 0x0a, 0x02, 0x4f, 0x70, 0x12, 0x06, 0x0a, 0x02, - 0x45, 0x51, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x54, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, - 0x03, 0x47, 0x54, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x03, 0x12, 0x06, - 0x0a, 0x02, 0x47, 0x54, 0x10, 0x04, 0x22, 0xde, 0x10, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x25, - 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x31, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x74, 0x61, - 0x6b, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x14, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x61, 0x6b, 0x65, 0x4f, 0x76, - 0x65, 0x72, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x15, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x16, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x18, 0x17, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x0b, 0x74, 0x78, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0a, 0x74, 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x19, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x37, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3b, 0x0a, 0x11, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1e, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3b, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1f, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x12, 0x31, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, - 0x75, 0x72, 0x6c, 0x18, 0x21, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, - 0x55, 0x72, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, - 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x22, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x6e, 0x6f, - 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, - 0x65, 0x18, 0x23, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x24, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x25, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x26, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x74, 0x65, 0x64, 0x18, 0x27, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x28, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x29, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x09, 0x66, 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x65, 0x65, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x63, 0x79, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x65, 0x65, 0x43, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x2a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x2f, 0x0a, 0x0b, 0x63, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x2e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0a, 0x63, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x5f, 0x69, 0x6e, 0x5f, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x49, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x31, - 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x30, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4a, 0x6f, 0x69, - 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x18, 0x31, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x10, 0x65, 0x66, - 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x32, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x0f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x33, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0d, 0x73, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0e, - 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x34, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, - 0x6d, 0x69, 0x78, 0x65, 0x64, 0x18, 0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, - 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0d, 0x74, 0x72, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x69, 0x78, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x36, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x12, 0x37, 0x0a, 0x0f, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x37, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0e, 0x74, 0x72, 0x65, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x38, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, - 0x69, 0x64, 0x18, 0x39, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x17, - 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x6e, 0x6f, 0x75, 0x74, 0x18, 0x3a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x74, 0x78, 0x4e, 0x6f, 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x3b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x3c, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x12, 0x28, 0x0a, 0x10, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x18, 0x3d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x3e, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x5f, 0x69, 0x64, 0x18, 0x3f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x40, 0x20, - 0x03, 0x28, 0x0c, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, - 0x41, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x72, + 0x3f, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x75, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x21, + 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x4f, 0x70, 0x52, 0x02, 0x6f, + 0x70, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2e, 0x0a, 0x02, 0x4f, 0x70, 0x12, 0x06, 0x0a, + 0x02, 0x45, 0x51, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x54, 0x45, 0x10, 0x01, 0x12, 0x07, + 0x0a, 0x03, 0x47, 0x54, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x03, 0x12, + 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, 0x04, 0x22, 0xa9, 0x12, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, + 0x25, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, + 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x31, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x74, + 0x61, 0x6b, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x61, 0x6b, 0x65, 0x4f, + 0x76, 0x65, 0x72, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, + 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x72, 0x6d, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x17, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, + 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x0b, 0x74, 0x78, 0x5f, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x74, + 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x3d, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x11, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x37, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, + 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, + 0x3b, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3b, 0x0a, 0x11, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x31, 0x0a, 0x0c, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, + 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x21, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x55, 0x72, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x6e, + 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x22, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0c, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x23, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x24, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x25, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x26, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, + 0x08, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x18, 0x27, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, + 0x08, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x28, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x29, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x66, 0x65, 0x65, + 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x09, 0x66, + 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x65, 0x65, 0x5f, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, + 0x66, 0x65, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x2a, 0x0a, 0x08, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x08, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x72, 0x65, 0x70, 0x6f, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x2d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2f, 0x0a, 0x0b, 0x63, 0x65, 0x6e, 0x73, 0x6f, + 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x2e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, + 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x63, 0x65, + 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x73, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x2f, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x49, 0x6e, 0x43, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, + 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x30, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x31, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x12, 0x39, 0x0a, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x32, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x65, 0x66, 0x66, 0x65, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0e, 0x73, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x33, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x34, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x64, 0x18, 0x35, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x69, 0x78, 0x65, 0x64, + 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x18, 0x36, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x37, 0x0a, 0x0f, 0x74, 0x72, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x37, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x52, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x12, 0x32, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x38, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x74, + 0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x39, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, + 0x6e, 0x6f, 0x75, 0x74, 0x18, 0x3a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x4e, 0x6f, + 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x3b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x18, 0x3c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x3d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x3e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, + 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x3f, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x49, + 0x64, 0x12, 0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x40, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x02, + 0x49, 0x64, 0x12, 0x27, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x41, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x6c, 0x65, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x42, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x22, 0xd2, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, 0x04, 0x74, 0x78, 0x6f, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x52, 0x04, 0x74, 0x78, 0x6f, 0x73, 0x12, 0x29, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, - 0x5f, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, - 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x54, 0x78, - 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x12, 0x25, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x07, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x9f, 0x01, 0x0a, - 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, - 0x6e, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x25, 0x0a, 0x05, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x12, 0x21, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xa3, - 0x05, 0x0a, 0x09, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x07, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x06, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, - 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, - 0x55, 0x72, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, - 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x6e, 0x6f, - 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0d, 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, - 0x28, 0x0a, 0x10, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x61, 0x6b, 0x65, 0x4f, - 0x76, 0x65, 0x72, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x61, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, - 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2a, 0x0a, 0x11, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, - 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x49, - 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x74, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, - 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x25, 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, - 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x0a, - 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x64, 0x18, - 0x17, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, - 0x69, 0x78, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0d, 0x74, 0x72, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x74, - 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x19, - 0x20, 0x01, 0x28, 0x02, 0x52, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x22, 0xa9, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x22, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x70, - 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x25, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x41, 0x0a, - 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, - 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, - 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x03, - 0x22, 0x45, 0x0a, 0x07, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x24, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, - 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x32, 0x35, 0x0a, 0x03, 0x48, 0x75, 0x62, 0x12, 0x2e, - 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x62, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x26, - 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x62, 0x72, - 0x79, 0x69, 0x6f, 0x2f, 0x68, 0x75, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x68, 0x61, 0x73, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x43, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x68, 0x61, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x68, + 0x61, 0x73, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x44, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x68, 0x61, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x45, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x22, 0xd2, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, 0x04, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x04, 0x74, + 0x78, 0x6f, 0x73, 0x12, 0x29, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x74, 0x78, 0x6f, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x54, 0x78, 0x6f, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x07, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x6e, 0x6f, 0x75, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x25, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, + 0x21, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, + 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xa3, 0x05, 0x0a, 0x09, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x22, + 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x55, 0x72, 0x6c, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, + 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x10, 0x74, + 0x61, 0x6b, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x61, 0x6b, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x48, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2b, + 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x73, 0x5f, 0x69, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x49, 0x6e, 0x43, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, + 0x12, 0x29, 0x0a, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x65, 0x66, 0x66, 0x65, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x15, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x69, 0x78, 0x65, 0x64, + 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x19, 0x20, 0x01, 0x28, 0x02, + 0x52, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x22, 0xa9, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x12, 0x25, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x41, 0x0a, 0x04, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x44, + 0x45, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x12, + 0x0b, 0x0a, 0x07, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x03, 0x22, 0x45, 0x0a, 0x07, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, + 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x32, 0x35, 0x0a, 0x03, 0x48, 0x75, 0x62, 0x12, 0x2e, 0x0a, 0x06, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x62, 0x72, 0x79, 0x69, 0x6f, 0x2f, + 0x68, 0x75, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1385,57 +1481,61 @@ func file_hub_proto_rawDescGZIP() []byte { } var file_hub_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_hub_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_hub_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_hub_proto_goTypes = []interface{}{ - (RangeQuery_Op)(0), // 0: pb.RangeQuery.Op - (Error_Code)(0), // 1: pb.Error.Code - (*RangeQuery)(nil), // 2: pb.RangeQuery - (*SearchRequest)(nil), // 3: pb.SearchRequest - (*SearchReply)(nil), // 4: pb.SearchReply - (*Output)(nil), // 5: pb.Output - (*ClaimMeta)(nil), // 6: pb.ClaimMeta - (*Error)(nil), // 7: pb.Error - (*Blocked)(nil), // 8: pb.Blocked + (RangeField_Op)(0), // 0: pb.RangeField.Op + (Error_Code)(0), // 1: pb.Error.Code + (*InvertibleField)(nil), // 2: pb.InvertibleField + (*RangeField)(nil), // 3: pb.RangeField + (*SearchRequest)(nil), // 4: pb.SearchRequest + (*SearchReply)(nil), // 5: pb.SearchReply + (*Output)(nil), // 6: pb.Output + (*ClaimMeta)(nil), // 7: pb.ClaimMeta + (*Error)(nil), // 8: pb.Error + (*Blocked)(nil), // 9: pb.Blocked } var file_hub_proto_depIdxs = []int32{ - 0, // 0: pb.RangeQuery.op:type_name -> pb.RangeQuery.Op - 2, // 1: pb.SearchRequest.tx_position:type_name -> pb.RangeQuery - 2, // 2: pb.SearchRequest.amount:type_name -> pb.RangeQuery - 2, // 3: pb.SearchRequest.timestamp:type_name -> pb.RangeQuery - 2, // 4: pb.SearchRequest.creation_timestamp:type_name -> pb.RangeQuery - 2, // 5: pb.SearchRequest.height:type_name -> pb.RangeQuery - 2, // 6: pb.SearchRequest.creation_height:type_name -> pb.RangeQuery - 2, // 7: pb.SearchRequest.activation_height:type_name -> pb.RangeQuery - 2, // 8: pb.SearchRequest.expiration_height:type_name -> pb.RangeQuery - 2, // 9: pb.SearchRequest.release_time:type_name -> pb.RangeQuery - 2, // 10: pb.SearchRequest.reposted:type_name -> pb.RangeQuery - 2, // 11: pb.SearchRequest.fee_amount:type_name -> pb.RangeQuery - 2, // 12: pb.SearchRequest.duration:type_name -> pb.RangeQuery - 2, // 13: pb.SearchRequest.censor_type:type_name -> pb.RangeQuery - 2, // 14: pb.SearchRequest.channel_join:type_name -> pb.RangeQuery - 2, // 15: pb.SearchRequest.effective_amount:type_name -> pb.RangeQuery - 2, // 16: pb.SearchRequest.support_amount:type_name -> pb.RangeQuery - 2, // 17: pb.SearchRequest.trending_group:type_name -> pb.RangeQuery - 2, // 18: pb.SearchRequest.trending_mixed:type_name -> pb.RangeQuery - 2, // 19: pb.SearchRequest.trending_local:type_name -> pb.RangeQuery - 2, // 20: pb.SearchRequest.trending_global:type_name -> pb.RangeQuery - 5, // 21: pb.SearchReply.txos:type_name -> pb.Output - 5, // 22: pb.SearchReply.extra_txos:type_name -> pb.Output - 8, // 23: pb.SearchReply.blocked:type_name -> pb.Blocked - 6, // 24: pb.Output.claim:type_name -> pb.ClaimMeta - 7, // 25: pb.Output.error:type_name -> pb.Error - 5, // 26: pb.ClaimMeta.channel:type_name -> pb.Output - 5, // 27: pb.ClaimMeta.repost:type_name -> pb.Output - 1, // 28: pb.Error.code:type_name -> pb.Error.Code - 8, // 29: pb.Error.blocked:type_name -> pb.Blocked - 5, // 30: pb.Blocked.channel:type_name -> pb.Output - 3, // 31: pb.Hub.Search:input_type -> pb.SearchRequest - 4, // 32: pb.Hub.Search:output_type -> pb.SearchReply - 32, // [32:33] is the sub-list for method output_type - 31, // [31:32] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 0, // 0: pb.RangeField.op:type_name -> pb.RangeField.Op + 2, // 1: pb.SearchRequest.claim_id:type_name -> pb.InvertibleField + 3, // 2: pb.SearchRequest.tx_position:type_name -> pb.RangeField + 3, // 3: pb.SearchRequest.amount:type_name -> pb.RangeField + 3, // 4: pb.SearchRequest.timestamp:type_name -> pb.RangeField + 3, // 5: pb.SearchRequest.creation_timestamp:type_name -> pb.RangeField + 3, // 6: pb.SearchRequest.height:type_name -> pb.RangeField + 3, // 7: pb.SearchRequest.creation_height:type_name -> pb.RangeField + 3, // 8: pb.SearchRequest.activation_height:type_name -> pb.RangeField + 3, // 9: pb.SearchRequest.expiration_height:type_name -> pb.RangeField + 3, // 10: pb.SearchRequest.release_time:type_name -> pb.RangeField + 3, // 11: pb.SearchRequest.reposted:type_name -> pb.RangeField + 3, // 12: pb.SearchRequest.fee_amount:type_name -> pb.RangeField + 3, // 13: pb.SearchRequest.duration:type_name -> pb.RangeField + 3, // 14: pb.SearchRequest.censor_type:type_name -> pb.RangeField + 3, // 15: pb.SearchRequest.channel_join:type_name -> pb.RangeField + 3, // 16: pb.SearchRequest.effective_amount:type_name -> pb.RangeField + 3, // 17: pb.SearchRequest.support_amount:type_name -> pb.RangeField + 3, // 18: pb.SearchRequest.trending_group:type_name -> pb.RangeField + 3, // 19: pb.SearchRequest.trending_mixed:type_name -> pb.RangeField + 3, // 20: pb.SearchRequest.trending_local:type_name -> pb.RangeField + 3, // 21: pb.SearchRequest.trending_global:type_name -> pb.RangeField + 2, // 22: pb.SearchRequest.channel_id:type_name -> pb.InvertibleField + 2, // 23: pb.SearchRequest.tags:type_name -> pb.InvertibleField + 6, // 24: pb.SearchReply.txos:type_name -> pb.Output + 6, // 25: pb.SearchReply.extra_txos:type_name -> pb.Output + 9, // 26: pb.SearchReply.blocked:type_name -> pb.Blocked + 7, // 27: pb.Output.claim:type_name -> pb.ClaimMeta + 8, // 28: pb.Output.error:type_name -> pb.Error + 6, // 29: pb.ClaimMeta.channel:type_name -> pb.Output + 6, // 30: pb.ClaimMeta.repost:type_name -> pb.Output + 1, // 31: pb.Error.code:type_name -> pb.Error.Code + 9, // 32: pb.Error.blocked:type_name -> pb.Blocked + 6, // 33: pb.Blocked.channel:type_name -> pb.Output + 4, // 34: pb.Hub.Search:input_type -> pb.SearchRequest + 5, // 35: pb.Hub.Search:output_type -> pb.SearchReply + 35, // [35:36] is the sub-list for method output_type + 34, // [34:35] is the sub-list for method input_type + 34, // [34:34] is the sub-list for extension type_name + 34, // [34:34] is the sub-list for extension extendee + 0, // [0:34] is the sub-list for field type_name } func init() { file_hub_proto_init() } @@ -1445,7 +1545,7 @@ func file_hub_proto_init() { } if !protoimpl.UnsafeEnabled { file_hub_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RangeQuery); i { + switch v := v.(*InvertibleField); i { case 0: return &v.state case 1: @@ -1457,7 +1557,7 @@ func file_hub_proto_init() { } } file_hub_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest); i { + switch v := v.(*RangeField); i { case 0: return &v.state case 1: @@ -1469,7 +1569,7 @@ func file_hub_proto_init() { } } file_hub_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchReply); i { + switch v := v.(*SearchRequest); i { case 0: return &v.state case 1: @@ -1481,7 +1581,7 @@ func file_hub_proto_init() { } } file_hub_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Output); i { + switch v := v.(*SearchReply); i { case 0: return &v.state case 1: @@ -1493,7 +1593,7 @@ func file_hub_proto_init() { } } file_hub_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClaimMeta); i { + switch v := v.(*Output); i { case 0: return &v.state case 1: @@ -1505,7 +1605,7 @@ func file_hub_proto_init() { } } file_hub_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Error); i { + switch v := v.(*ClaimMeta); i { case 0: return &v.state case 1: @@ -1517,6 +1617,18 @@ func file_hub_proto_init() { } } file_hub_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hub_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Blocked); i { case 0: return &v.state @@ -1529,7 +1641,7 @@ func file_hub_proto_init() { } } } - file_hub_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_hub_proto_msgTypes[4].OneofWrappers = []interface{}{ (*Output_Claim)(nil), (*Output_Error)(nil), } @@ -1539,7 +1651,7 @@ func file_hub_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_hub_proto_rawDesc, NumEnums: 2, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/server/search.go b/server/search.go index 0c01432..1eb0027 100644 --- a/server/search.go +++ b/server/search.go @@ -16,6 +16,11 @@ type record struct { Nout uint32 `json:"tx_nout"` } +type orderField struct { + Field string + is_asc bool +} + func ReverseBytes(s []byte) { for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { s[i], s[j] = s[j], s[i] @@ -30,7 +35,7 @@ func StrArrToInterface(arr []string) []interface{} { return searchVals } -func AddTermsQuery(arr []string, name string, q *elastic.BoolQuery) *elastic.BoolQuery { +func AddTermsField(arr []string, name string, q *elastic.BoolQuery) *elastic.BoolQuery { if len(arr) > 0 { searchVals := StrArrToInterface(arr) return q.Must(elastic.NewTermsQuery(name, searchVals...)) @@ -38,30 +43,42 @@ func AddTermsQuery(arr []string, name string, q *elastic.BoolQuery) *elastic.Boo return q } -func AddRangeQuery(rq *pb.RangeQuery, name string, q *elastic.BoolQuery) *elastic.BoolQuery { +func AddRangeField(rq *pb.RangeField, name string, q *elastic.BoolQuery) *elastic.BoolQuery { if rq == nil { return q } if len(rq.Value) > 1 { - if rq.Op != pb.RangeQuery_EQ { + if rq.Op != pb.RangeField_EQ { return q } - return AddTermsQuery(rq.Value, name, q) + return AddTermsField(rq.Value, name, q) } - if rq.Op == pb.RangeQuery_EQ { - return AddTermsQuery(rq.Value, name, q) - } else if rq.Op == pb.RangeQuery_LT { + if rq.Op == pb.RangeField_EQ { + return AddTermsField(rq.Value, name, q) + } else if rq.Op == pb.RangeField_LT { return q.Must(elastic.NewRangeQuery(name).Lt(rq.Value)) - } else if rq.Op == pb.RangeQuery_LTE { + } else if rq.Op == pb.RangeField_LTE { return q.Must(elastic.NewRangeQuery(name).Lte(rq.Value)) - } else if rq.Op == pb.RangeQuery_GT { + } else if rq.Op == pb.RangeField_GT { return q.Must(elastic.NewRangeQuery(name).Gt(rq.Value)) - } else { // pb.RangeQuery_GTE + } else { // pb.RangeField_GTE return q.Must(elastic.NewRangeQuery(name).Gte(rq.Value)) } } +func AddInvertibleField(field *pb.InvertibleField, name string, q *elastic.BoolQuery) *elastic.BoolQuery { + if field == nil { + return q + } + searchVals := StrArrToInterface(field.Value) + if field.Invert { + return q.MustNot(elastic.NewTermsQuery(name, searchVals...)) + } else { + return q.Must(elastic.NewTermsQuery(name, searchVals...)) + } +} + func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchReply, error) { // TODO: reuse elastic client across requests client, err := elastic.NewClient(elastic.SetSniff(false)) @@ -75,6 +92,48 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchRe "repost": 3, "collection": 4, } + + streamTypes := map[string]int { + "video": 1, + "audio": 2, + "image": 3, + "document": 4, + "binary": 5, + "model": 6, + } + + replacements := map[string]string { + "name": "normalized", + "txid": "tx_id", + "claim_hash": "_id", + } + + textFields := map[string]bool { + "author": true, + "canonical_url": true, + "channel_id": true, + "claim_name": true, + "description": true, + "claim_id": true, + "media_type": true, + "normalized": true, + "public_key_bytes": true, + "public_key_hash": true, + "short_url": true, + "signature": true, + "signature_digest": true, + "stream_type": true, + "title": true, + "tx_id": true, + "fee_currency": true, + "reposted_claim_id": true, + "tags": true, + } + + var from = 0 + var size = 10 + var orderBy []orderField + // Ping the Elasticsearch server to get e.g. the version number //_, code, err := client.Ping("http://127.0.0.1:9200").Do(ctx) //if err != nil { @@ -90,10 +149,36 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchRe if in.AmountOrder > 0 { in.Limit = 1 - in.OrderBy = "effective_amount" + in.OrderBy = []string{"effective_amount"} in.Offset = in.AmountOrder - 1 } + if in.Limit > 0 { + size = int(in.Limit) + } + + if in.Offset > 0 { + from = int(in.Offset) + } + + if len(in.OrderBy) > 0 { + for _, x := range in.OrderBy { + var toAppend string + var is_asc = false + if x[0] == '^' { + is_asc = true + x = x[1:] + } + if _, ok := replacements[x]; ok { + toAppend = replacements[x] + } + if _, ok := textFields[x]; ok { + toAppend = x + ".keyword" + } + orderBy = append(orderBy, orderField{toAppend, is_asc}) + } + } + if len(in.ClaimType) > 0 { searchVals := make([]interface{}, len(in.ClaimType)) for i := 0; i < len(in.ClaimType); i++ { @@ -102,6 +187,15 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchRe q = q.Must(elastic.NewTermsQuery("claim_type", searchVals...)) } + // FIXME is this a text field or not? + if len(in.StreamType) > 0 { + searchVals := make([]interface{}, len(in.StreamType)) + for i := 0; i < len(in.StreamType); i++ { + searchVals[i] = streamTypes[in.StreamType[i]] + } + q = q.Must(elastic.NewTermsQuery("stream_type.keyword", searchVals...)) + } + if len(in.XId) > 0 { searchVals := make([]interface{}, len(in.XId)) for i := 0; i < len(in.XId); i++ { @@ -116,12 +210,20 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchRe } - if len(in.ClaimId) > 0 { - searchVals := StrArrToInterface(in.ClaimId) - if len(in.ClaimId) == 1 && len(in.ClaimId[0]) < 20 { - q = q.Must(elastic.NewPrefixQuery("claim_id.keyword", in.ClaimId[0])) + if in.ClaimId != nil { + searchVals := StrArrToInterface(in.ClaimId.Value) + if len(in.ClaimId.Value) == 1 && len(in.ClaimId.Value[0]) < 20 { + if in.ClaimId.Invert { + q = q.MustNot(elastic.NewPrefixQuery("claim_id.keyword", in.ClaimId.Value[0])) + } else { + q = q.Must(elastic.NewPrefixQuery("claim_id.keyword", in.ClaimId.Value[0])) + } } else { - q = q.Must(elastic.NewTermsQuery("claim_id.keyword", searchVals...)) + if in.ClaimId.Invert { + q = q.MustNot(elastic.NewTermsQuery("claim_id.keyword", searchVals...)) + } else { + q = q.Must(elastic.NewTermsQuery("claim_id.keyword", searchVals...)) + } } } @@ -130,45 +232,73 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchRe q = q.Must(elastic.NewTermQuery("public_key_hash.keyword", value)) } - q = AddTermsQuery(in.PublicKeyHash, "public_key_hash.keyword", q) - q = AddTermsQuery(in.Author, "author.keyword", q) - q = AddTermsQuery(in.Title, "title.keyword", q) - q = AddTermsQuery(in.CanonicalUrl, "canonical_url.keyword", q) - q = AddTermsQuery(in.ChannelId, "channel_id.keyword", q) - q = AddTermsQuery(in.ClaimName, "claim_name.keyword", q) - q = AddTermsQuery(in.Description, "description.keyword", q) - q = AddTermsQuery(in.MediaType, "media_type.keyword", q) - q = AddTermsQuery(in.Normalized, "normalized.keyword", q) - q = AddTermsQuery(in.PublicKeyBytes, "public_key_bytes.keyword", q) - q = AddTermsQuery(in.ShortUrl, "short_url.keyword", q) - q = AddTermsQuery(in.Signature, "signature.keyword", q) - q = AddTermsQuery(in.SignatureDigest, "signature_digest.keyword", q) - q = AddTermsQuery(in.StreamType, "stream_type.keyword", q) - q = AddTermsQuery(in.TxId, "tx_id.keyword", q) - q = AddTermsQuery(in.FeeCurrency, "fee_currency.keyword", q) - q = AddTermsQuery(in.RepostedClaimId, "reposted_claim_id.keyword", q) - q = AddTermsQuery(in.Tags, "tags.keyword", q) + if in.HasChannelSignature { + q = q.Should(elastic.NewBoolQuery().Must(elastic.NewExistsQuery("signature_digest"))) + if in.SignatureValid { + q = q.Should(elastic.NewTermQuery("signature_valid", in.SignatureValid)) + } + } else if in.SignatureValid { + //FIXME Might need to abstract this to another message so we can tell if the param is passed + //without relying on it's truth value + q = q.MinimumNumberShouldMatch(1) + q = q.Should(elastic.NewBoolQuery().MustNot(elastic.NewExistsQuery("signature_digest"))) + q = q.Should(elastic.NewTermQuery("signature_valid", in.SignatureValid)) + } - q = AddRangeQuery(in.TxPosition, "tx_position", q) - q = AddRangeQuery(in.Amount, "amount", q) - q = AddRangeQuery(in.Timestamp, "timestamp", q) - q = AddRangeQuery(in.CreationTimestamp, "creation_timestamp", q) - q = AddRangeQuery(in.Height, "height", q) - q = AddRangeQuery(in.CreationHeight, "creation_height", q) - q = AddRangeQuery(in.ActivationHeight, "activation_height", q) - q = AddRangeQuery(in.ExpirationHeight, "expiration_height", q) - q = AddRangeQuery(in.ReleaseTime, "release_time", q) - q = AddRangeQuery(in.Reposted, "reposted", q) - q = AddRangeQuery(in.FeeAmount, "fee_amount", q) - q = AddRangeQuery(in.Duration, "duration", q) - q = AddRangeQuery(in.CensorType, "censor_type", q) - q = AddRangeQuery(in.ChannelJoin, "channel_join", q) - q = AddRangeQuery(in.EffectiveAmount, "effective_amount", q) - q = AddRangeQuery(in.SupportAmount, "support_amount", q) - q = AddRangeQuery(in.TrendingGroup, "trending_group", q) - q = AddRangeQuery(in.TrendingMixed, "trending_mixed", q) - q = AddRangeQuery(in.TrendingLocal, "trending_local", q) - q = AddRangeQuery(in.TrendingGlobal, "trending_global", q) + if in.HasSource { + q = q.MinimumNumberShouldMatch(1) + isStreamOrReport := elastic.NewTermsQuery("claim_type", claimTypes["stream"], claimTypes["repost"]) + q = q.Should(elastic.NewBoolQuery().Must(isStreamOrReport, elastic.NewMatchQuery("has_source", in.HasSource))) + q = q.Should(elastic.NewBoolQuery().MustNot(isStreamOrReport)) + q = q.Should(elastic.NewBoolQuery().Must(elastic.NewTermQuery("reposted_claim_type", claimTypes["channel"]))) + } + + var collapse *elastic.CollapseBuilder + if in.LimitClaimsPerChannel > 0 { + innerHit := elastic.NewInnerHit().Size(int(in.LimitClaimsPerChannel)).Name("channel_id.keyword") + collapse = elastic.NewCollapseBuilder("channel_id.keyword").InnerHit(innerHit) + } + + + q = AddTermsField(in.PublicKeyHash, "public_key_hash.keyword", q) + q = AddTermsField(in.Author, "author.keyword", q) + q = AddTermsField(in.Title, "title.keyword", q) + q = AddTermsField(in.CanonicalUrl, "canonical_url.keyword", q) + q = AddTermsField(in.ClaimName, "claim_name.keyword", q) + q = AddTermsField(in.Description, "description.keyword", q) + q = AddTermsField(in.MediaType, "media_type.keyword", q) + q = AddTermsField(in.Normalized, "normalized.keyword", q) + q = AddTermsField(in.PublicKeyBytes, "public_key_bytes.keyword", q) + q = AddTermsField(in.ShortUrl, "short_url.keyword", q) + q = AddTermsField(in.Signature, "signature.keyword", q) + q = AddTermsField(in.SignatureDigest, "signature_digest.keyword", q) + q = AddTermsField(in.TxId, "tx_id.keyword", q) + q = AddTermsField(in.FeeCurrency, "fee_currency.keyword", q) + q = AddTermsField(in.RepostedClaimId, "reposted_claim_id.keyword", q) + + q = AddInvertibleField(in.ChannelId, "channel_id.keyword", q) + q = AddInvertibleField(in.Tags, "tags.keyword", q) + + q = AddRangeField(in.TxPosition, "tx_position", q) + q = AddRangeField(in.Amount, "amount", q) + q = AddRangeField(in.Timestamp, "timestamp", q) + q = AddRangeField(in.CreationTimestamp, "creation_timestamp", q) + q = AddRangeField(in.Height, "height", q) + q = AddRangeField(in.CreationHeight, "creation_height", q) + q = AddRangeField(in.ActivationHeight, "activation_height", q) + q = AddRangeField(in.ExpirationHeight, "expiration_height", q) + q = AddRangeField(in.ReleaseTime, "release_time", q) + q = AddRangeField(in.Reposted, "reposted", q) + q = AddRangeField(in.FeeAmount, "fee_amount", q) + q = AddRangeField(in.Duration, "duration", q) + q = AddRangeField(in.CensorType, "censor_type", q) + q = AddRangeField(in.ChannelJoin, "channel_join", q) + q = AddRangeField(in.EffectiveAmount, "effective_amount", q) + q = AddRangeField(in.SupportAmount, "support_amount", q) + q = AddRangeField(in.TrendingGroup, "trending_group", q) + q = AddRangeField(in.TrendingMixed, "trending_mixed", q) + q = AddRangeField(in.TrendingLocal, "trending_local", q) + q = AddRangeField(in.TrendingGlobal, "trending_global", q) if in.Query != "" { textQuery := elastic.NewSimpleQueryStringQuery(in.Query). @@ -182,14 +312,18 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.SearchRe q = q.Must(textQuery) } - - searchResult, err := client.Search(). + search := client.Search(). //Index("twitter"). // search in index "twitter" Query(q). // specify the query - //Sort("user", true). // sort by "user" field, ascending - From(0).Size(10). // take documents 0-9 - //Pretty(true). // pretty print request and response JSON - Do(ctx) // execute + From(from).Size(size) + if in.LimitClaimsPerChannel > 0 { + search = search.Collapse(collapse) + } + for _, x := range orderBy { + search = search.Sort(x.Field, x.is_asc) + } + + searchResult, err := search.Do(ctx) // execute if err != nil { return nil, err }