forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protocol.pb.go
1540 lines (1391 loc) · 55.4 KB
/
protocol.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: discovery/protocol.proto
package discovery // import "github.com/hyperledger/fabric/protos/discovery"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import gossip "github.com/hyperledger/fabric/protos/gossip"
import msp "github.com/hyperledger/fabric/protos/msp"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// SignedRequest contains a serialized Request in the payload field
// and a signature.
// The identity that is used to verify the signature
// can be extracted from the authentication field of type AuthInfo
// in the Request itself after deserializing it.
type SignedRequest struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SignedRequest) Reset() { *m = SignedRequest{} }
func (m *SignedRequest) String() string { return proto.CompactTextString(m) }
func (*SignedRequest) ProtoMessage() {}
func (*SignedRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{0}
}
func (m *SignedRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SignedRequest.Unmarshal(m, b)
}
func (m *SignedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SignedRequest.Marshal(b, m, deterministic)
}
func (dst *SignedRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignedRequest.Merge(dst, src)
}
func (m *SignedRequest) XXX_Size() int {
return xxx_messageInfo_SignedRequest.Size(m)
}
func (m *SignedRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SignedRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SignedRequest proto.InternalMessageInfo
func (m *SignedRequest) GetPayload() []byte {
if m != nil {
return m.Payload
}
return nil
}
func (m *SignedRequest) GetSignature() []byte {
if m != nil {
return m.Signature
}
return nil
}
// Request contains authentication info about the client that sent the request
// and the queries it wishes to query the service
type Request struct {
// authentication contains information that the service uses to check
// the client's eligibility for the queries.
Authentication *AuthInfo `protobuf:"bytes,1,opt,name=authentication,proto3" json:"authentication,omitempty"`
// queries
Queries []*Query `protobuf:"bytes,2,rep,name=queries,proto3" json:"queries,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{1}
}
func (m *Request) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Request.Unmarshal(m, b)
}
func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Request.Marshal(b, m, deterministic)
}
func (dst *Request) XXX_Merge(src proto.Message) {
xxx_messageInfo_Request.Merge(dst, src)
}
func (m *Request) XXX_Size() int {
return xxx_messageInfo_Request.Size(m)
}
func (m *Request) XXX_DiscardUnknown() {
xxx_messageInfo_Request.DiscardUnknown(m)
}
var xxx_messageInfo_Request proto.InternalMessageInfo
func (m *Request) GetAuthentication() *AuthInfo {
if m != nil {
return m.Authentication
}
return nil
}
func (m *Request) GetQueries() []*Query {
if m != nil {
return m.Queries
}
return nil
}
type Response struct {
// The results are returned in the same order of the queries
Results []*QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Response) Reset() { *m = Response{} }
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{2}
}
func (m *Response) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Response.Unmarshal(m, b)
}
func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Response.Marshal(b, m, deterministic)
}
func (dst *Response) XXX_Merge(src proto.Message) {
xxx_messageInfo_Response.Merge(dst, src)
}
func (m *Response) XXX_Size() int {
return xxx_messageInfo_Response.Size(m)
}
func (m *Response) XXX_DiscardUnknown() {
xxx_messageInfo_Response.DiscardUnknown(m)
}
var xxx_messageInfo_Response proto.InternalMessageInfo
func (m *Response) GetResults() []*QueryResult {
if m != nil {
return m.Results
}
return nil
}
// AuthInfo aggregates authentication information that the server uses
// to authenticate the client
type AuthInfo struct {
// This is the identity of the client that is used to verify the signature
// on the SignedRequest's payload.
// It is a msp.SerializedIdentity in bytes form
ClientIdentity []byte `protobuf:"bytes,1,opt,name=client_identity,json=clientIdentity,proto3" json:"client_identity,omitempty"`
// This is the hash of the client's TLS cert.
// When the network is running with TLS, clients that don't include a certificate
// will be denied access to the service.
// Since the Request is encapsulated with a SignedRequest (which is signed),
// this binds the TLS session to the enrollement identity of the client and
// therefore both authenticates the client to the server,
// and also prevents the server from relaying the request message to another server.
ClientTlsCertHash []byte `protobuf:"bytes,2,opt,name=client_tls_cert_hash,json=clientTlsCertHash,proto3" json:"client_tls_cert_hash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AuthInfo) Reset() { *m = AuthInfo{} }
func (m *AuthInfo) String() string { return proto.CompactTextString(m) }
func (*AuthInfo) ProtoMessage() {}
func (*AuthInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{3}
}
func (m *AuthInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AuthInfo.Unmarshal(m, b)
}
func (m *AuthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AuthInfo.Marshal(b, m, deterministic)
}
func (dst *AuthInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_AuthInfo.Merge(dst, src)
}
func (m *AuthInfo) XXX_Size() int {
return xxx_messageInfo_AuthInfo.Size(m)
}
func (m *AuthInfo) XXX_DiscardUnknown() {
xxx_messageInfo_AuthInfo.DiscardUnknown(m)
}
var xxx_messageInfo_AuthInfo proto.InternalMessageInfo
func (m *AuthInfo) GetClientIdentity() []byte {
if m != nil {
return m.ClientIdentity
}
return nil
}
func (m *AuthInfo) GetClientTlsCertHash() []byte {
if m != nil {
return m.ClientTlsCertHash
}
return nil
}
// Query asks for information in the context of a specific channel
type Query struct {
Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
// Types that are valid to be assigned to Query:
// *Query_ConfigQuery
// *Query_PeerQuery
// *Query_CcQuery
// *Query_LocalPeers
Query isQuery_Query `protobuf_oneof:"query"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Query) Reset() { *m = Query{} }
func (m *Query) String() string { return proto.CompactTextString(m) }
func (*Query) ProtoMessage() {}
func (*Query) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{4}
}
func (m *Query) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Query.Unmarshal(m, b)
}
func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Query.Marshal(b, m, deterministic)
}
func (dst *Query) XXX_Merge(src proto.Message) {
xxx_messageInfo_Query.Merge(dst, src)
}
func (m *Query) XXX_Size() int {
return xxx_messageInfo_Query.Size(m)
}
func (m *Query) XXX_DiscardUnknown() {
xxx_messageInfo_Query.DiscardUnknown(m)
}
var xxx_messageInfo_Query proto.InternalMessageInfo
func (m *Query) GetChannel() string {
if m != nil {
return m.Channel
}
return ""
}
type isQuery_Query interface {
isQuery_Query()
}
type Query_ConfigQuery struct {
ConfigQuery *ConfigQuery `protobuf:"bytes,2,opt,name=config_query,json=configQuery,proto3,oneof"`
}
type Query_PeerQuery struct {
PeerQuery *PeerMembershipQuery `protobuf:"bytes,3,opt,name=peer_query,json=peerQuery,proto3,oneof"`
}
type Query_CcQuery struct {
CcQuery *ChaincodeQuery `protobuf:"bytes,4,opt,name=cc_query,json=ccQuery,proto3,oneof"`
}
type Query_LocalPeers struct {
LocalPeers *LocalPeerQuery `protobuf:"bytes,5,opt,name=local_peers,json=localPeers,proto3,oneof"`
}
func (*Query_ConfigQuery) isQuery_Query() {}
func (*Query_PeerQuery) isQuery_Query() {}
func (*Query_CcQuery) isQuery_Query() {}
func (*Query_LocalPeers) isQuery_Query() {}
func (m *Query) GetQuery() isQuery_Query {
if m != nil {
return m.Query
}
return nil
}
func (m *Query) GetConfigQuery() *ConfigQuery {
if x, ok := m.GetQuery().(*Query_ConfigQuery); ok {
return x.ConfigQuery
}
return nil
}
func (m *Query) GetPeerQuery() *PeerMembershipQuery {
if x, ok := m.GetQuery().(*Query_PeerQuery); ok {
return x.PeerQuery
}
return nil
}
func (m *Query) GetCcQuery() *ChaincodeQuery {
if x, ok := m.GetQuery().(*Query_CcQuery); ok {
return x.CcQuery
}
return nil
}
func (m *Query) GetLocalPeers() *LocalPeerQuery {
if x, ok := m.GetQuery().(*Query_LocalPeers); ok {
return x.LocalPeers
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Query) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Query_OneofMarshaler, _Query_OneofUnmarshaler, _Query_OneofSizer, []interface{}{
(*Query_ConfigQuery)(nil),
(*Query_PeerQuery)(nil),
(*Query_CcQuery)(nil),
(*Query_LocalPeers)(nil),
}
}
func _Query_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Query)
// query
switch x := m.Query.(type) {
case *Query_ConfigQuery:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ConfigQuery); err != nil {
return err
}
case *Query_PeerQuery:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.PeerQuery); err != nil {
return err
}
case *Query_CcQuery:
b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.CcQuery); err != nil {
return err
}
case *Query_LocalPeers:
b.EncodeVarint(5<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.LocalPeers); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Query.Query has unexpected type %T", x)
}
return nil
}
func _Query_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Query)
switch tag {
case 2: // query.config_query
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ConfigQuery)
err := b.DecodeMessage(msg)
m.Query = &Query_ConfigQuery{msg}
return true, err
case 3: // query.peer_query
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PeerMembershipQuery)
err := b.DecodeMessage(msg)
m.Query = &Query_PeerQuery{msg}
return true, err
case 4: // query.cc_query
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ChaincodeQuery)
err := b.DecodeMessage(msg)
m.Query = &Query_CcQuery{msg}
return true, err
case 5: // query.local_peers
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(LocalPeerQuery)
err := b.DecodeMessage(msg)
m.Query = &Query_LocalPeers{msg}
return true, err
default:
return false, nil
}
}
func _Query_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Query)
// query
switch x := m.Query.(type) {
case *Query_ConfigQuery:
s := proto.Size(x.ConfigQuery)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Query_PeerQuery:
s := proto.Size(x.PeerQuery)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Query_CcQuery:
s := proto.Size(x.CcQuery)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Query_LocalPeers:
s := proto.Size(x.LocalPeers)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// QueryResult contains a result for a given Query.
// The corresponding Query can be inferred by the index of the QueryResult from
// its enclosing Response message.
// QueryResults are ordered in the same order as the Queries are ordered in their enclosing Request.
type QueryResult struct {
// Types that are valid to be assigned to Result:
// *QueryResult_Error
// *QueryResult_ConfigResult
// *QueryResult_CcQueryRes
// *QueryResult_Members
Result isQueryResult_Result `protobuf_oneof:"result"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *QueryResult) Reset() { *m = QueryResult{} }
func (m *QueryResult) String() string { return proto.CompactTextString(m) }
func (*QueryResult) ProtoMessage() {}
func (*QueryResult) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{5}
}
func (m *QueryResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryResult.Unmarshal(m, b)
}
func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic)
}
func (dst *QueryResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryResult.Merge(dst, src)
}
func (m *QueryResult) XXX_Size() int {
return xxx_messageInfo_QueryResult.Size(m)
}
func (m *QueryResult) XXX_DiscardUnknown() {
xxx_messageInfo_QueryResult.DiscardUnknown(m)
}
var xxx_messageInfo_QueryResult proto.InternalMessageInfo
type isQueryResult_Result interface {
isQueryResult_Result()
}
type QueryResult_Error struct {
Error *Error `protobuf:"bytes,1,opt,name=error,proto3,oneof"`
}
type QueryResult_ConfigResult struct {
ConfigResult *ConfigResult `protobuf:"bytes,2,opt,name=config_result,json=configResult,proto3,oneof"`
}
type QueryResult_CcQueryRes struct {
CcQueryRes *ChaincodeQueryResult `protobuf:"bytes,3,opt,name=cc_query_res,json=ccQueryRes,proto3,oneof"`
}
type QueryResult_Members struct {
Members *PeerMembershipResult `protobuf:"bytes,4,opt,name=members,proto3,oneof"`
}
func (*QueryResult_Error) isQueryResult_Result() {}
func (*QueryResult_ConfigResult) isQueryResult_Result() {}
func (*QueryResult_CcQueryRes) isQueryResult_Result() {}
func (*QueryResult_Members) isQueryResult_Result() {}
func (m *QueryResult) GetResult() isQueryResult_Result {
if m != nil {
return m.Result
}
return nil
}
func (m *QueryResult) GetError() *Error {
if x, ok := m.GetResult().(*QueryResult_Error); ok {
return x.Error
}
return nil
}
func (m *QueryResult) GetConfigResult() *ConfigResult {
if x, ok := m.GetResult().(*QueryResult_ConfigResult); ok {
return x.ConfigResult
}
return nil
}
func (m *QueryResult) GetCcQueryRes() *ChaincodeQueryResult {
if x, ok := m.GetResult().(*QueryResult_CcQueryRes); ok {
return x.CcQueryRes
}
return nil
}
func (m *QueryResult) GetMembers() *PeerMembershipResult {
if x, ok := m.GetResult().(*QueryResult_Members); ok {
return x.Members
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*QueryResult) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _QueryResult_OneofMarshaler, _QueryResult_OneofUnmarshaler, _QueryResult_OneofSizer, []interface{}{
(*QueryResult_Error)(nil),
(*QueryResult_ConfigResult)(nil),
(*QueryResult_CcQueryRes)(nil),
(*QueryResult_Members)(nil),
}
}
func _QueryResult_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*QueryResult)
// result
switch x := m.Result.(type) {
case *QueryResult_Error:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Error); err != nil {
return err
}
case *QueryResult_ConfigResult:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ConfigResult); err != nil {
return err
}
case *QueryResult_CcQueryRes:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.CcQueryRes); err != nil {
return err
}
case *QueryResult_Members:
b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Members); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("QueryResult.Result has unexpected type %T", x)
}
return nil
}
func _QueryResult_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*QueryResult)
switch tag {
case 1: // result.error
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(Error)
err := b.DecodeMessage(msg)
m.Result = &QueryResult_Error{msg}
return true, err
case 2: // result.config_result
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ConfigResult)
err := b.DecodeMessage(msg)
m.Result = &QueryResult_ConfigResult{msg}
return true, err
case 3: // result.cc_query_res
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ChaincodeQueryResult)
err := b.DecodeMessage(msg)
m.Result = &QueryResult_CcQueryRes{msg}
return true, err
case 4: // result.members
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PeerMembershipResult)
err := b.DecodeMessage(msg)
m.Result = &QueryResult_Members{msg}
return true, err
default:
return false, nil
}
}
func _QueryResult_OneofSizer(msg proto.Message) (n int) {
m := msg.(*QueryResult)
// result
switch x := m.Result.(type) {
case *QueryResult_Error:
s := proto.Size(x.Error)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *QueryResult_ConfigResult:
s := proto.Size(x.ConfigResult)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *QueryResult_CcQueryRes:
s := proto.Size(x.CcQueryRes)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *QueryResult_Members:
s := proto.Size(x.Members)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// ConfigQuery requests a ConfigResult
type ConfigQuery struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConfigQuery) Reset() { *m = ConfigQuery{} }
func (m *ConfigQuery) String() string { return proto.CompactTextString(m) }
func (*ConfigQuery) ProtoMessage() {}
func (*ConfigQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{6}
}
func (m *ConfigQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConfigQuery.Unmarshal(m, b)
}
func (m *ConfigQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConfigQuery.Marshal(b, m, deterministic)
}
func (dst *ConfigQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConfigQuery.Merge(dst, src)
}
func (m *ConfigQuery) XXX_Size() int {
return xxx_messageInfo_ConfigQuery.Size(m)
}
func (m *ConfigQuery) XXX_DiscardUnknown() {
xxx_messageInfo_ConfigQuery.DiscardUnknown(m)
}
var xxx_messageInfo_ConfigQuery proto.InternalMessageInfo
type ConfigResult struct {
// msps is a map from MSP_ID to FabricMSPConfig
Msps map[string]*msp.FabricMSPConfig `protobuf:"bytes,1,rep,name=msps,proto3" json:"msps,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// orderers is a map from MSP_ID to endpoint lists of orderers
Orderers map[string]*Endpoints `protobuf:"bytes,2,rep,name=orderers,proto3" json:"orderers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConfigResult) Reset() { *m = ConfigResult{} }
func (m *ConfigResult) String() string { return proto.CompactTextString(m) }
func (*ConfigResult) ProtoMessage() {}
func (*ConfigResult) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{7}
}
func (m *ConfigResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConfigResult.Unmarshal(m, b)
}
func (m *ConfigResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConfigResult.Marshal(b, m, deterministic)
}
func (dst *ConfigResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConfigResult.Merge(dst, src)
}
func (m *ConfigResult) XXX_Size() int {
return xxx_messageInfo_ConfigResult.Size(m)
}
func (m *ConfigResult) XXX_DiscardUnknown() {
xxx_messageInfo_ConfigResult.DiscardUnknown(m)
}
var xxx_messageInfo_ConfigResult proto.InternalMessageInfo
func (m *ConfigResult) GetMsps() map[string]*msp.FabricMSPConfig {
if m != nil {
return m.Msps
}
return nil
}
func (m *ConfigResult) GetOrderers() map[string]*Endpoints {
if m != nil {
return m.Orderers
}
return nil
}
// PeerMembershipQuery requests PeerMembershipResult.
// The filter field may be optionally populated in order
// for the peer membership to be filtered according to
// chaincodes that are installed on peers and collection
// access control policies.
type PeerMembershipQuery struct {
Filter *ChaincodeInterest `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PeerMembershipQuery) Reset() { *m = PeerMembershipQuery{} }
func (m *PeerMembershipQuery) String() string { return proto.CompactTextString(m) }
func (*PeerMembershipQuery) ProtoMessage() {}
func (*PeerMembershipQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{8}
}
func (m *PeerMembershipQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PeerMembershipQuery.Unmarshal(m, b)
}
func (m *PeerMembershipQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PeerMembershipQuery.Marshal(b, m, deterministic)
}
func (dst *PeerMembershipQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_PeerMembershipQuery.Merge(dst, src)
}
func (m *PeerMembershipQuery) XXX_Size() int {
return xxx_messageInfo_PeerMembershipQuery.Size(m)
}
func (m *PeerMembershipQuery) XXX_DiscardUnknown() {
xxx_messageInfo_PeerMembershipQuery.DiscardUnknown(m)
}
var xxx_messageInfo_PeerMembershipQuery proto.InternalMessageInfo
func (m *PeerMembershipQuery) GetFilter() *ChaincodeInterest {
if m != nil {
return m.Filter
}
return nil
}
// PeerMembershipResult contains peers mapped by their organizations (MSP_ID)
type PeerMembershipResult struct {
PeersByOrg map[string]*Peers `protobuf:"bytes,1,rep,name=peers_by_org,json=peersByOrg,proto3" json:"peers_by_org,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PeerMembershipResult) Reset() { *m = PeerMembershipResult{} }
func (m *PeerMembershipResult) String() string { return proto.CompactTextString(m) }
func (*PeerMembershipResult) ProtoMessage() {}
func (*PeerMembershipResult) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{9}
}
func (m *PeerMembershipResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PeerMembershipResult.Unmarshal(m, b)
}
func (m *PeerMembershipResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PeerMembershipResult.Marshal(b, m, deterministic)
}
func (dst *PeerMembershipResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_PeerMembershipResult.Merge(dst, src)
}
func (m *PeerMembershipResult) XXX_Size() int {
return xxx_messageInfo_PeerMembershipResult.Size(m)
}
func (m *PeerMembershipResult) XXX_DiscardUnknown() {
xxx_messageInfo_PeerMembershipResult.DiscardUnknown(m)
}
var xxx_messageInfo_PeerMembershipResult proto.InternalMessageInfo
func (m *PeerMembershipResult) GetPeersByOrg() map[string]*Peers {
if m != nil {
return m.PeersByOrg
}
return nil
}
// ChaincodeQuery requests ChaincodeQueryResults for a given
// list of chaincode invocations.
// Each invocation is a separate one, and the endorsement policy
// is evaluated independantly for each given interest.
type ChaincodeQuery struct {
Interests []*ChaincodeInterest `protobuf:"bytes,1,rep,name=interests,proto3" json:"interests,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ChaincodeQuery) Reset() { *m = ChaincodeQuery{} }
func (m *ChaincodeQuery) String() string { return proto.CompactTextString(m) }
func (*ChaincodeQuery) ProtoMessage() {}
func (*ChaincodeQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{10}
}
func (m *ChaincodeQuery) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChaincodeQuery.Unmarshal(m, b)
}
func (m *ChaincodeQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ChaincodeQuery.Marshal(b, m, deterministic)
}
func (dst *ChaincodeQuery) XXX_Merge(src proto.Message) {
xxx_messageInfo_ChaincodeQuery.Merge(dst, src)
}
func (m *ChaincodeQuery) XXX_Size() int {
return xxx_messageInfo_ChaincodeQuery.Size(m)
}
func (m *ChaincodeQuery) XXX_DiscardUnknown() {
xxx_messageInfo_ChaincodeQuery.DiscardUnknown(m)
}
var xxx_messageInfo_ChaincodeQuery proto.InternalMessageInfo
func (m *ChaincodeQuery) GetInterests() []*ChaincodeInterest {
if m != nil {
return m.Interests
}
return nil
}
// ChaincodeInterest defines an interest about an endorsement
// for a specific single chaincode invocation.
// Multiple chaincodes indicate chaincode to chaincode invocations.
type ChaincodeInterest struct {
Chaincodes []*ChaincodeCall `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ChaincodeInterest) Reset() { *m = ChaincodeInterest{} }
func (m *ChaincodeInterest) String() string { return proto.CompactTextString(m) }
func (*ChaincodeInterest) ProtoMessage() {}
func (*ChaincodeInterest) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{11}
}
func (m *ChaincodeInterest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChaincodeInterest.Unmarshal(m, b)
}
func (m *ChaincodeInterest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ChaincodeInterest.Marshal(b, m, deterministic)
}
func (dst *ChaincodeInterest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ChaincodeInterest.Merge(dst, src)
}
func (m *ChaincodeInterest) XXX_Size() int {
return xxx_messageInfo_ChaincodeInterest.Size(m)
}
func (m *ChaincodeInterest) XXX_DiscardUnknown() {
xxx_messageInfo_ChaincodeInterest.DiscardUnknown(m)
}
var xxx_messageInfo_ChaincodeInterest proto.InternalMessageInfo
func (m *ChaincodeInterest) GetChaincodes() []*ChaincodeCall {
if m != nil {
return m.Chaincodes
}
return nil
}
// ChaincodeCall defines a call to a chaincode.
// It may have collections that are related to the chaincode
type ChaincodeCall struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
CollectionNames []string `protobuf:"bytes,2,rep,name=collection_names,json=collectionNames,proto3" json:"collection_names,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ChaincodeCall) Reset() { *m = ChaincodeCall{} }
func (m *ChaincodeCall) String() string { return proto.CompactTextString(m) }
func (*ChaincodeCall) ProtoMessage() {}
func (*ChaincodeCall) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{12}
}
func (m *ChaincodeCall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChaincodeCall.Unmarshal(m, b)
}
func (m *ChaincodeCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ChaincodeCall.Marshal(b, m, deterministic)
}
func (dst *ChaincodeCall) XXX_Merge(src proto.Message) {
xxx_messageInfo_ChaincodeCall.Merge(dst, src)
}
func (m *ChaincodeCall) XXX_Size() int {
return xxx_messageInfo_ChaincodeCall.Size(m)
}
func (m *ChaincodeCall) XXX_DiscardUnknown() {
xxx_messageInfo_ChaincodeCall.DiscardUnknown(m)
}
var xxx_messageInfo_ChaincodeCall proto.InternalMessageInfo
func (m *ChaincodeCall) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ChaincodeCall) GetCollectionNames() []string {
if m != nil {
return m.CollectionNames
}
return nil
}
// ChaincodeQueryResult contains EndorsementDescriptors for
// chaincodes
type ChaincodeQueryResult struct {
Content []*EndorsementDescriptor `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ChaincodeQueryResult) Reset() { *m = ChaincodeQueryResult{} }
func (m *ChaincodeQueryResult) String() string { return proto.CompactTextString(m) }
func (*ChaincodeQueryResult) ProtoMessage() {}
func (*ChaincodeQueryResult) Descriptor() ([]byte, []int) {
return fileDescriptor_protocol_b2f93a2b7b5bdad4, []int{13}
}
func (m *ChaincodeQueryResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChaincodeQueryResult.Unmarshal(m, b)
}
func (m *ChaincodeQueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ChaincodeQueryResult.Marshal(b, m, deterministic)
}
func (dst *ChaincodeQueryResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_ChaincodeQueryResult.Merge(dst, src)
}
func (m *ChaincodeQueryResult) XXX_Size() int {
return xxx_messageInfo_ChaincodeQueryResult.Size(m)
}
func (m *ChaincodeQueryResult) XXX_DiscardUnknown() {
xxx_messageInfo_ChaincodeQueryResult.DiscardUnknown(m)
}
var xxx_messageInfo_ChaincodeQueryResult proto.InternalMessageInfo
func (m *ChaincodeQueryResult) GetContent() []*EndorsementDescriptor {
if m != nil {
return m.Content
}
return nil
}
// LocalPeerQuery queries for peers in a non channel context
type LocalPeerQuery struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}