/
protocol.pb.go
1548 lines (1398 loc) · 54.5 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
//此源码被清华学神尹成大魔王专业翻译分析并修改
//尹成QQ77025077
//尹成微信18510341407
//尹成所在QQ群721929980
//尹成邮箱 yinc13@mails.tsinghua.edu.cn
//尹成毕业于清华大学,微软区块链领域全球最有价值专家
//https://mvp.microsoft.com/zh-cn/PublicProfile/4033620
//由Protoc Gen Go生成的代码。不要编辑。
//来源:discovery/protocol.proto
package discovery //导入“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"
)
//引用导入以禁止错误(如果未使用)。
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
//这是一个编译时断言,以确保生成的文件
//与正在编译的proto包兼容。
//此行的编译错误可能意味着您的
//需要更新proto包。
const _ = proto.ProtoPackageIsVersion2 //请升级proto包
//SignedRequest在有效负载字段中包含一个序列化请求
//还有签名。
//用于验证签名的标识
//可以从authinfo类型的身份验证字段中提取
//在对请求进行反序列化之后。
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
}
//请求包含有关发送请求的客户端的身份验证信息
//以及它希望查询服务的查询
type Request struct {
//身份验证包含服务用于检查的信息
//客户的查询资格。
Authentication *AuthInfo `protobuf:"bytes,1,opt,name=authentication,proto3" json:"authentication,omitempty"`
//查询
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 {
//结果按查询的相同顺序返回
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聚合服务器使用的身份验证信息
//验证客户端
type AuthInfo struct {
//这是用于验证签名的客户端的标识
//在SignedRequest的有效载荷上。
//它是字节形式的msp.serialididEntity
ClientIdentity []byte `protobuf:"bytes,1,opt,name=client_identity,json=clientIdentity,proto3" json:"client_identity,omitempty"`
//这是客户端的TLS证书的哈希。
//当网络使用TLS运行时,不包含证书的客户端
//将被拒绝访问该服务。
//因为请求是用一个已签名的signedRequest封装的,
//这会将TLS会话绑定到客户端的注册标识,并且
//因此,这两种方法都将客户机认证为服务器,
//并且还阻止服务器将请求消息中继到另一个服务器。
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
}
//查询请求特定通道上下文中的信息
type Query struct {
Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
//有效分配给查询的类型:
//*查询配置查询
//*查询对等查询
//*QualyCccQuQuy
//*查询本地对等
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
}
//xxxoneoffuncs用于Proto包的内部使用。
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)
//查询
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_查询
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查询
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: //查询查询
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_对等机
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)
//查询
switch x := m.Query.(type) {
case *Query_ConfigQuery:
s := proto.Size(x.ConfigQuery)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case *Query_PeerQuery:
s := proto.Size(x.PeerQuery)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case *Query_CcQuery:
s := proto.Size(x.CcQuery)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case *Query_LocalPeers:
s := proto.Size(x.LocalPeers)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
//query result包含给定查询的结果。
//通过查询结果的索引可以推断出相应的查询
//它的封闭响应消息。
//查询结果的顺序与查询在其封闭请求中的顺序相同。
type QueryResult struct {
//有效分配给结果的类型:
//*查询结果\错误
//*查询结果配置结果
//*查询结果
//*查询结果\成员
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
}
//xxxoneoffuncs用于Proto包的内部使用。
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)
//结果
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: //结果误差
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结果
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_查询资源
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: //结果成员
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)
//结果
switch x := m.Result.(type) {
case *QueryResult_Error:
s := proto.Size(x.Error)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case *QueryResult_ConfigResult:
s := proto.Size(x.ConfigResult)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case *QueryResult_CcQueryRes:
s := proto.Size(x.CcQueryRes)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case *QueryResult_Members:
s := proto.Size(x.Members)
n += 1 //标签和电线
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
//configquery请求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是从msp_id到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"`
//医嘱者是从msp_id到医嘱者端点列表的映射
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请求peermembershipresult。
//筛选字段可以按顺序可选地填充。
//对于要根据筛选的对等成员身份
//安装在对等端和集合上的链码
//访问控制策略。
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包含由其组织映射的对等方(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为给定的请求chaincodequeryresults
//链码调用列表。
//每个调用都是一个单独的调用,并且认可策略
//对每个给定的兴趣进行独立评估。
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定义了关于背书的兴趣
//对于特定的单链代码调用。
//多个链码表示链码到链码调用。
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
}
//chaincode call定义对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包含的背书描述符
//链码
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
}