/
message.pb.go
374 lines (333 loc) · 15.3 KB
/
message.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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: message.proto
package amperp2p
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// 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.ProtoPackageIsVersion3 // please upgrade the proto package
type AmperMessage_MessageType int32
const (
AmperMessage_SENDBLOCK AmperMessage_MessageType = 0
AmperMessage_POSTTX AmperMessage_MessageType = 1
AmperMessage_BATCHPOSTTX AmperMessage_MessageType = 2
AmperMessage_GET_BLOCK AmperMessage_MessageType = 3
AmperMessage_PING AmperMessage_MessageType = 4
AmperMessage_GET_BLOCKCHAINSTATUS AmperMessage_MessageType = 5
AmperMessage_GET_BLOCK_RES AmperMessage_MessageType = 6
AmperMessage_GET_BLOCKCHAINSTATUS_RES AmperMessage_MessageType = 7
// 向邻近确认区块是否为最新状态区块
AmperMessage_CONFIRM_BLOCKCHAINSTATUS AmperMessage_MessageType = 8
AmperMessage_CONFIRM_BLOCKCHAINSTATUS_RES AmperMessage_MessageType = 9
AmperMessage_MSG_TYPE_NONE AmperMessage_MessageType = 10
// 询问RPC端口信息
AmperMessage_GET_RPC_PORT AmperMessage_MessageType = 11
AmperMessage_GET_RPC_PORT_RES AmperMessage_MessageType = 12
AmperMessage_GET_AUTHENTICATION AmperMessage_MessageType = 13
AmperMessage_GET_AUTHENTICATION_RES AmperMessage_MessageType = 14
)
var AmperMessage_MessageType_name = map[int32]string{
0: "SENDBLOCK",
1: "POSTTX",
2: "BATCHPOSTTX",
3: "GET_BLOCK",
4: "PING",
5: "GET_BLOCKCHAINSTATUS",
6: "GET_BLOCK_RES",
7: "GET_BLOCKCHAINSTATUS_RES",
8: "CONFIRM_BLOCKCHAINSTATUS",
9: "CONFIRM_BLOCKCHAINSTATUS_RES",
10: "MSG_TYPE_NONE",
11: "GET_RPC_PORT",
12: "GET_RPC_PORT_RES",
13: "GET_AUTHENTICATION",
14: "GET_AUTHENTICATION_RES",
}
var AmperMessage_MessageType_value = map[string]int32{
"SENDBLOCK": 0,
"POSTTX": 1,
"BATCHPOSTTX": 2,
"GET_BLOCK": 3,
"PING": 4,
"GET_BLOCKCHAINSTATUS": 5,
"GET_BLOCK_RES": 6,
"GET_BLOCKCHAINSTATUS_RES": 7,
"CONFIRM_BLOCKCHAINSTATUS": 8,
"CONFIRM_BLOCKCHAINSTATUS_RES": 9,
"MSG_TYPE_NONE": 10,
"GET_RPC_PORT": 11,
"GET_RPC_PORT_RES": 12,
"GET_AUTHENTICATION": 13,
"GET_AUTHENTICATION_RES": 14,
}
func (x AmperMessage_MessageType) String() string {
return proto.EnumName(AmperMessage_MessageType_name, int32(x))
}
func (AmperMessage_MessageType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_33c57e4bae7b9afd, []int{0, 0}
}
type AmperMessage_ErrorType int32
const (
// success
AmperMessage_SUCCESS AmperMessage_ErrorType = 0
AmperMessage_NONE AmperMessage_ErrorType = 1
// common error
AmperMessage_UNKNOW_ERROR AmperMessage_ErrorType = 2
AmperMessage_CHECK_SUM_ERROR AmperMessage_ErrorType = 3
AmperMessage_UNMARSHAL_MSG_BODY_ERROR AmperMessage_ErrorType = 4
AmperMessage_CONNECT_REFUSE AmperMessage_ErrorType = 5
// block error
AmperMessage_GET_BLOCKCHAIN_ERROR AmperMessage_ErrorType = 6
AmperMessage_BLOCKCHAIN_NOTEXIST AmperMessage_ErrorType = 7
AmperMessage_GET_BLOCK_ERROR AmperMessage_ErrorType = 8
AmperMessage_CONFIRM_BLOCKCHAINSTATUS_ERROR AmperMessage_ErrorType = 9
AmperMessage_GET_AUTHENTICATION_ERROR AmperMessage_ErrorType = 10
AmperMessage_GET_AUTHENTICATION_NOT_PASS AmperMessage_ErrorType = 11
)
var AmperMessage_ErrorType_name = map[int32]string{
0: "SUCCESS",
1: "NONE",
2: "UNKNOW_ERROR",
3: "CHECK_SUM_ERROR",
4: "UNMARSHAL_MSG_BODY_ERROR",
5: "CONNECT_REFUSE",
6: "GET_BLOCKCHAIN_ERROR",
7: "BLOCKCHAIN_NOTEXIST",
8: "GET_BLOCK_ERROR",
9: "CONFIRM_BLOCKCHAINSTATUS_ERROR",
10: "GET_AUTHENTICATION_ERROR",
11: "GET_AUTHENTICATION_NOT_PASS",
}
var AmperMessage_ErrorType_value = map[string]int32{
"SUCCESS": 0,
"NONE": 1,
"UNKNOW_ERROR": 2,
"CHECK_SUM_ERROR": 3,
"UNMARSHAL_MSG_BODY_ERROR": 4,
"CONNECT_REFUSE": 5,
"GET_BLOCKCHAIN_ERROR": 6,
"BLOCKCHAIN_NOTEXIST": 7,
"GET_BLOCK_ERROR": 8,
"CONFIRM_BLOCKCHAINSTATUS_ERROR": 9,
"GET_AUTHENTICATION_ERROR": 10,
"GET_AUTHENTICATION_NOT_PASS": 11,
}
func (x AmperMessage_ErrorType) String() string {
return proto.EnumName(AmperMessage_ErrorType_name, int32(x))
}
func (AmperMessage_ErrorType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_33c57e4bae7b9afd, []int{0, 1}
}
// AmperMessage is the message of Amper p2p server
type AmperMessage struct {
Header *AmperMessage_MessageHeader `protobuf:"bytes,1,opt,name=Header,proto3" json:"Header,omitempty"`
Data *AmperMessage_MessageData `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AmperMessage) Reset() { *m = AmperMessage{} }
func (m *AmperMessage) String() string { return proto.CompactTextString(m) }
func (*AmperMessage) ProtoMessage() {}
func (*AmperMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_33c57e4bae7b9afd, []int{0}
}
func (m *AmperMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AmperMessage.Unmarshal(m, b)
}
func (m *AmperMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AmperMessage.Marshal(b, m, deterministic)
}
func (m *AmperMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_AmperMessage.Merge(m, src)
}
func (m *AmperMessage) XXX_Size() int {
return xxx_messageInfo_AmperMessage.Size(m)
}
func (m *AmperMessage) XXX_DiscardUnknown() {
xxx_messageInfo_AmperMessage.DiscardUnknown(m)
}
var xxx_messageInfo_AmperMessage proto.InternalMessageInfo
func (m *AmperMessage) GetHeader() *AmperMessage_MessageHeader {
if m != nil {
return m.Header
}
return nil
}
func (m *AmperMessage) GetData() *AmperMessage_MessageData {
if m != nil {
return m.Data
}
return nil
}
// MessageHeader is the message header of Amper p2p server
type AmperMessage_MessageHeader struct {
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
// dataCheckSum is the message data checksum, it can be used check where the message have been received
Logid string `protobuf:"bytes,2,opt,name=logid,proto3" json:"logid,omitempty"`
From string `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`
Bcname string `protobuf:"bytes,4,opt,name=bcname,proto3" json:"bcname,omitempty"`
Type AmperMessage_MessageType `protobuf:"varint,5,opt,name=type,proto3,enum=amperp2p.AmperMessage_MessageType" json:"type,omitempty"`
DataCheckSum uint32 `protobuf:"varint,6,opt,name=dataCheckSum,proto3" json:"dataCheckSum,omitempty"`
ErrorType AmperMessage_ErrorType `protobuf:"varint,7,opt,name=errorType,proto3,enum=amperp2p.AmperMessage_ErrorType" json:"errorType,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AmperMessage_MessageHeader) Reset() { *m = AmperMessage_MessageHeader{} }
func (m *AmperMessage_MessageHeader) String() string { return proto.CompactTextString(m) }
func (*AmperMessage_MessageHeader) ProtoMessage() {}
func (*AmperMessage_MessageHeader) Descriptor() ([]byte, []int) {
return fileDescriptor_33c57e4bae7b9afd, []int{0, 0}
}
func (m *AmperMessage_MessageHeader) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AmperMessage_MessageHeader.Unmarshal(m, b)
}
func (m *AmperMessage_MessageHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AmperMessage_MessageHeader.Marshal(b, m, deterministic)
}
func (m *AmperMessage_MessageHeader) XXX_Merge(src proto.Message) {
xxx_messageInfo_AmperMessage_MessageHeader.Merge(m, src)
}
func (m *AmperMessage_MessageHeader) XXX_Size() int {
return xxx_messageInfo_AmperMessage_MessageHeader.Size(m)
}
func (m *AmperMessage_MessageHeader) XXX_DiscardUnknown() {
xxx_messageInfo_AmperMessage_MessageHeader.DiscardUnknown(m)
}
var xxx_messageInfo_AmperMessage_MessageHeader proto.InternalMessageInfo
func (m *AmperMessage_MessageHeader) GetVersion() string {
if m != nil {
return m.Version
}
return ""
}
func (m *AmperMessage_MessageHeader) GetLogid() string {
if m != nil {
return m.Logid
}
return ""
}
func (m *AmperMessage_MessageHeader) GetFrom() string {
if m != nil {
return m.From
}
return ""
}
func (m *AmperMessage_MessageHeader) GetBcname() string {
if m != nil {
return m.Bcname
}
return ""
}
func (m *AmperMessage_MessageHeader) GetType() AmperMessage_MessageType {
if m != nil {
return m.Type
}
return AmperMessage_SENDBLOCK
}
func (m *AmperMessage_MessageHeader) GetDataCheckSum() uint32 {
if m != nil {
return m.DataCheckSum
}
return 0
}
func (m *AmperMessage_MessageHeader) GetErrorType() AmperMessage_ErrorType {
if m != nil {
return m.ErrorType
}
return AmperMessage_SUCCESS
}
// MessageData is the message data of Amper p2p server
type AmperMessage_MessageData struct {
// msgInfo is the message infomation, use protobuf coding style
MsgInfo []byte `protobuf:"bytes,3,opt,name=msgInfo,proto3" json:"msgInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AmperMessage_MessageData) Reset() { *m = AmperMessage_MessageData{} }
func (m *AmperMessage_MessageData) String() string { return proto.CompactTextString(m) }
func (*AmperMessage_MessageData) ProtoMessage() {}
func (*AmperMessage_MessageData) Descriptor() ([]byte, []int) {
return fileDescriptor_33c57e4bae7b9afd, []int{0, 1}
}
func (m *AmperMessage_MessageData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AmperMessage_MessageData.Unmarshal(m, b)
}
func (m *AmperMessage_MessageData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AmperMessage_MessageData.Marshal(b, m, deterministic)
}
func (m *AmperMessage_MessageData) XXX_Merge(src proto.Message) {
xxx_messageInfo_AmperMessage_MessageData.Merge(m, src)
}
func (m *AmperMessage_MessageData) XXX_Size() int {
return xxx_messageInfo_AmperMessage_MessageData.Size(m)
}
func (m *AmperMessage_MessageData) XXX_DiscardUnknown() {
xxx_messageInfo_AmperMessage_MessageData.DiscardUnknown(m)
}
var xxx_messageInfo_AmperMessage_MessageData proto.InternalMessageInfo
func (m *AmperMessage_MessageData) GetMsgInfo() []byte {
if m != nil {
return m.MsgInfo
}
return nil
}
func init() {
proto.RegisterEnum("amperp2p.AmperMessage_MessageType", AmperMessage_MessageType_name, AmperMessage_MessageType_value)
proto.RegisterEnum("amperp2p.AmperMessage_ErrorType", AmperMessage_ErrorType_name, AmperMessage_ErrorType_value)
proto.RegisterType((*AmperMessage)(nil), "amperp2p.AmperMessage")
proto.RegisterType((*AmperMessage_MessageHeader)(nil), "amperp2p.AmperMessage.MessageHeader")
proto.RegisterType((*AmperMessage_MessageData)(nil), "amperp2p.AmperMessage.MessageData")
}
func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) }
var fileDescriptor_33c57e4bae7b9afd = []byte{
// 581 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0xd1, 0x4e, 0xdb, 0x3e,
0x14, 0xc6, 0x69, 0x69, 0xd3, 0xe6, 0xb4, 0x05, 0xff, 0x0f, 0x88, 0x7f, 0xc4, 0xd0, 0x56, 0x55,
0x93, 0xc6, 0x55, 0x2f, 0x98, 0xb4, 0xab, 0x69, 0x52, 0x30, 0x86, 0x46, 0x50, 0xbb, 0xb2, 0x1d,
0x0d, 0xae, 0xa2, 0x00, 0x81, 0xa1, 0xad, 0x24, 0x4a, 0xcb, 0x34, 0x9e, 0x60, 0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