quorum_sdk 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,146 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
4
+ # source: lib/proto/activity_stream.proto
5
+
6
+ require 'google/protobuf'
7
+
8
+ require 'google/protobuf/timestamp_pb'
9
+ require 'google/protobuf/any_pb'
10
+
11
+ Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_file('lib/proto/activity_stream.proto', syntax: :proto3) do
13
+ add_message 'quorum.pb.AnyObj' do
14
+ optional :any, :message, 1, 'google.protobuf.Any'
15
+ end
16
+ add_message 'quorum.pb.Object' do
17
+ optional :id, :string, 1
18
+ optional :type, :string, 2
19
+ repeated :attachments, :message, 3, 'quorum.pb.Object'
20
+ repeated :attributedTo, :message, 4, 'quorum.pb.Object'
21
+ optional :audience, :message, 5, 'quorum.pb.Object'
22
+ optional :content, :string, 6
23
+ optional :context, :message, 7, 'quorum.pb.Object'
24
+ optional :name, :string, 8
25
+ optional :endtime, :message, 9, 'google.protobuf.Timestamp'
26
+ optional :generator, :message, 10, 'quorum.pb.Object'
27
+ repeated :icon, :message, 11, 'quorum.pb.Object'
28
+ repeated :image, :message, 12, 'quorum.pb.Image'
29
+ optional :inreplyto, :message, 13, 'quorum.pb.Reply'
30
+ optional :location, :message, 14, 'quorum.pb.Object'
31
+ optional :preview, :message, 15, 'quorum.pb.Object'
32
+ optional :published, :message, 16, 'google.protobuf.Timestamp'
33
+ optional :replies, :message, 17, 'quorum.pb.Object'
34
+ optional :startTime, :message, 18, 'google.protobuf.Timestamp'
35
+ optional :summary, :string, 19
36
+ repeated :tag, :message, 20, 'quorum.pb.Object'
37
+ optional :updated, :message, 21, 'google.protobuf.Timestamp'
38
+ repeated :url, :message, 22, 'quorum.pb.Link'
39
+ repeated :to, :message, 23, 'quorum.pb.Object'
40
+ repeated :bto, :message, 24, 'quorum.pb.Object'
41
+ repeated :cc, :message, 25, 'quorum.pb.Object'
42
+ repeated :bcc, :message, 26, 'quorum.pb.Object'
43
+ optional :mediaType, :string, 27
44
+ optional :duration, :string, 28
45
+ optional :file, :message, 29, 'quorum.pb.File'
46
+ end
47
+ add_message 'quorum.pb.Link' do
48
+ optional :href, :string, 1
49
+ repeated :rel, :string, 2
50
+ optional :mediaType, :string, 3
51
+ optional :name, :string, 4
52
+ optional :hreflang, :string, 5
53
+ optional :height, :uint32, 6
54
+ optional :width, :uint32, 7
55
+ optional :preview, :message, 8, 'quorum.pb.Object'
56
+ end
57
+ add_message 'quorum.pb.Reply' do
58
+ optional :trxid, :string, 1
59
+ optional :groupid, :string, 2
60
+ end
61
+ add_message 'quorum.pb.Image' do
62
+ optional :id, :string, 1
63
+ optional :name, :string, 2
64
+ optional :mediaType, :string, 3
65
+ optional :content, :bytes, 4
66
+ optional :url, :string, 5
67
+ end
68
+ add_message 'quorum.pb.File' do
69
+ optional :id, :string, 1
70
+ optional :name, :string, 2
71
+ optional :mediaType, :string, 3
72
+ optional :compression, :enum, 4, 'quorum.pb.File.Compression'
73
+ optional :content, :bytes, 5
74
+ optional :url, :string, 6
75
+ end
76
+ add_enum 'quorum.pb.File.Compression' do
77
+ value :none, 0
78
+ value :gz, 1
79
+ value :zip, 2
80
+ value :zstd, 3
81
+ end
82
+ add_message 'quorum.pb.Person' do
83
+ optional :id, :string, 1
84
+ optional :name, :string, 2
85
+ optional :image, :message, 3, 'quorum.pb.Image'
86
+ repeated :wallet, :message, 11, 'quorum.pb.Payment'
87
+ end
88
+ add_message 'quorum.pb.Payment' do
89
+ optional :id, :string, 1
90
+ optional :type, :string, 2
91
+ optional :name, :string, 3
92
+ end
93
+ add_message 'quorum.pb.Activity' do
94
+ optional :id, :string, 1
95
+ optional :type, :string, 2
96
+ repeated :attachments, :message, 3, 'quorum.pb.Object'
97
+ repeated :attributedTo, :message, 4, 'quorum.pb.Object'
98
+ optional :audience, :message, 5, 'quorum.pb.Object'
99
+ optional :content, :string, 6
100
+ optional :context, :message, 7, 'quorum.pb.Object'
101
+ optional :name, :string, 8
102
+ optional :endtime, :message, 9, 'google.protobuf.Timestamp'
103
+ optional :generator, :message, 10, 'quorum.pb.Object'
104
+ repeated :icon, :message, 11, 'quorum.pb.Object'
105
+ repeated :image, :message, 12, 'quorum.pb.Object'
106
+ optional :inReplyTo, :message, 13, 'quorum.pb.Object'
107
+ optional :location, :message, 14, 'quorum.pb.Object'
108
+ optional :preview, :message, 15, 'quorum.pb.Object'
109
+ optional :published, :message, 16, 'google.protobuf.Timestamp'
110
+ optional :replies, :message, 17, 'quorum.pb.Object'
111
+ optional :startTime, :message, 18, 'google.protobuf.Timestamp'
112
+ optional :summary, :string, 19
113
+ repeated :tag, :message, 20, 'quorum.pb.Object'
114
+ optional :updated, :message, 21, 'google.protobuf.Timestamp'
115
+ repeated :url, :message, 22, 'quorum.pb.Link'
116
+ repeated :to, :message, 23, 'quorum.pb.Object'
117
+ repeated :bto, :message, 24, 'quorum.pb.Object'
118
+ repeated :cc, :message, 25, 'quorum.pb.Object'
119
+ repeated :bcc, :message, 26, 'quorum.pb.Object'
120
+ optional :mediaType, :string, 27
121
+ optional :duration, :string, 28
122
+ optional :actor, :message, 29, 'quorum.pb.Object'
123
+ optional :object, :message, 30, 'quorum.pb.Object'
124
+ optional :target, :message, 31, 'quorum.pb.Object'
125
+ optional :result, :message, 32, 'quorum.pb.Object'
126
+ optional :origin, :message, 33, 'quorum.pb.Object'
127
+ optional :instrument, :message, 34, 'quorum.pb.Object'
128
+ optional :person, :message, 35, 'quorum.pb.Person'
129
+ end
130
+ end
131
+ end
132
+
133
+ module Quorum
134
+ module Pb
135
+ AnyObj = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.AnyObj').msgclass
136
+ Object = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.Object').msgclass
137
+ Link = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.Link').msgclass
138
+ Reply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.Reply').msgclass
139
+ Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.Image').msgclass
140
+ File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.File').msgclass
141
+ File::Compression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.File.Compression').enummodule
142
+ Person = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.Person').msgclass
143
+ Payment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.Payment').msgclass
144
+ Activity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('quorum.pb.Activity').msgclass
145
+ end
146
+ end
@@ -0,0 +1,421 @@
1
+ /* https://github.com/rumsystem/quorum/blob/main/pkg/pb/chain.proto */
2
+
3
+ syntax = "proto3";
4
+ package quorum.pb;
5
+ option go_package = "github.com/rumsystem/quorum/pkg/pb";
6
+
7
+ enum PackageType {
8
+ TRX = 0;
9
+ BLOCK = 1;
10
+ SNAPSHOT = 2;
11
+ HBB = 3;
12
+ }
13
+
14
+ message Package {
15
+ PackageType type = 1;
16
+ bytes Data = 2;
17
+ }
18
+
19
+ enum TrxType {
20
+ POST = 0; // post to group
21
+ SCHEMA = 2; // group schema
22
+ PRODUCER = 3; // update group producer
23
+ ANNOUNCE = 4; // self announce, producer or user)
24
+ REQ_BLOCK_FORWARD = 5; // request next block
25
+ REQ_BLOCK_BACKWARD = 6; // request previous block
26
+ REQ_BLOCK_RESP = 7; // response request next block
27
+ BLOCK_SYNCED = 8; // block for producer to sync (old block)
28
+ BLOCK_PRODUCED = 9; // block for producer to merge (newly produced block)
29
+ USER = 10; // update group user
30
+ ASK_PEERID = 11; // ask owner/producer peerid
31
+ ASK_PEERID_RESP = 12; // response ask peerid
32
+ CHAIN_CONFIG = 13; // predefined chain configuration
33
+ APP_CONFIG = 14; // group app customized configuration
34
+ }
35
+
36
+ enum AnnounceType {
37
+ AS_USER = 0;
38
+ AS_PRODUCER = 1;
39
+ AS_USER_ENCRYPT = 2;
40
+ }
41
+
42
+ enum ApproveType {
43
+ ANNOUNCED = 0;
44
+ APPROVED = 1;
45
+ REJECTED = 2;
46
+ }
47
+
48
+ enum ActionType {
49
+ ADD = 0;
50
+ REMOVE = 1;
51
+ }
52
+
53
+ enum TrxStroageType {
54
+ CHAIN = 0;
55
+ CACHE = 1;
56
+ }
57
+
58
+ message Trx {
59
+ string TrxId = 1;
60
+ TrxType Type = 2;
61
+ string GroupId = 3;
62
+ bytes Data = 4;
63
+ int64 TimeStamp = 5;
64
+ string Version = 6;
65
+ int64 Expired = 7;
66
+ int64 ResendCount = 8;
67
+ int64 Nonce = 9;
68
+ string SenderPubkey = 10;
69
+ bytes SenderSign = 11;
70
+ TrxStroageType StorageType = 12;
71
+ }
72
+
73
+ message Block {
74
+ string BlockId = 1;
75
+ string GroupId = 2;
76
+ string PrevBlockId = 3;
77
+ bytes PreviousHash = 4;
78
+ repeated Trx Trxs = 5;
79
+ string ProducerPubKey = 6;
80
+ bytes Hash = 7;
81
+ bytes Signature = 8;
82
+ int64 TimeStamp = 9;
83
+ }
84
+
85
+ message Snapshot {
86
+ string SnapshotId = 1;
87
+ string SnapshotPackageId = 2;
88
+ int64 TotalCount = 3;
89
+ string GroupId = 4;
90
+ int64 Nonce = 5;
91
+ repeated SnapshotItem SnapshotItems = 6;
92
+ string SenderPubkey = 7;
93
+ bytes Singature = 8;
94
+ int64 TimeStamp = 9;
95
+ int64 HighestHeight = 10;
96
+ string HighestBlockId = 11;
97
+ bytes ItemsHash = 12;
98
+ }
99
+
100
+ message SnapshotItem {
101
+ string SnapshotItemId = 1;
102
+ SnapShotItemType Type = 2;
103
+ bytes Data = 3;
104
+ }
105
+
106
+ enum SnapShotItemType {
107
+ SNAPSHOT_APP_CONFIG = 0; //app_config item
108
+ SNAPSHOT_CHAIN_CONFIG = 1; //chain_config item
109
+ SNAPSHOT_PRODUCER = 2; //producer item
110
+ SNAPSHOT_USER = 3; //user item
111
+ SNAPSHOT_ANNOUNCE = 4; //announce item
112
+ }
113
+
114
+ message SnapShotTag {
115
+ int64 TimeStamp = 1;
116
+ int64 HighestHeight = 2;
117
+ string HighestBlockId = 3;
118
+ bytes ItemsHash = 4;
119
+ int64 Nonce = 5;
120
+ string SnapshotPackageId = 6;
121
+ string SenderPubkey = 7;
122
+ }
123
+
124
+ message BlockDbChunk {
125
+ string BlockId = 1;
126
+ Block BlockItem = 2;
127
+ string ParentBlockId = 3;
128
+ repeated string SubBlockId = 4;
129
+ int64 Height = 6;
130
+ }
131
+
132
+ message ReqBlock {
133
+ string BlockId = 1; //block id
134
+ string GroupId = 2; //group id
135
+ string UserId = 3; //requester
136
+ }
137
+
138
+ message BlockSynced {
139
+ Block BlockItem = 1;
140
+ }
141
+
142
+ message AskPeerId {
143
+ string GroupId = 1;
144
+ string UserPeerId = 2;
145
+ string UserPubkey = 3;
146
+ string UserSign = 4;
147
+ string Memo = 5;
148
+ }
149
+
150
+ message AskPeerIdResp {
151
+ string GroupId = 1;
152
+ string RespPeerId = 2;
153
+ string RespPeerPubkey = 3;
154
+ string RespSign = 4;
155
+ bool IsDirectConnected = 5;
156
+ }
157
+
158
+ message BlockProduced {
159
+ Block BlockItem = 1;
160
+ }
161
+
162
+ enum ReqBlkResult {
163
+ BLOCK_IN_TRX = 0; //block data in trx
164
+ BLOCK_NOT_FOUND = 1; //block not found
165
+ }
166
+
167
+ message ReqBlockResp {
168
+ ReqBlkResult Result = 1;
169
+ string ProviderPubkey = 2;
170
+ string RequesterPubkey = 3;
171
+ string GroupId = 4;
172
+ string BlockId = 5;
173
+ bytes Block = 6;
174
+ }
175
+
176
+ message PostItem {
177
+ string TrxId = 1;
178
+ string PublisherPubkey = 2;
179
+ bytes Content = 3;
180
+ int64 TimeStamp = 4;
181
+ }
182
+
183
+ message ProducerItem {
184
+ string GroupId = 1;
185
+ string ProducerPubkey = 2;
186
+ string GroupOwnerPubkey = 3;
187
+ string GroupOwnerSign = 4;
188
+ int64 TimeStamp = 5;
189
+ ActionType Action = 6;
190
+ int64 BlockProduced = 7;
191
+ string Memo = 8;
192
+ }
193
+
194
+ message UserItem {
195
+ string GroupId = 1;
196
+ string UserPubkey = 2;
197
+ string EncryptPubkey = 3;
198
+ string GroupOwnerPubkey = 4;
199
+ string GroupOwnerSign = 5;
200
+ int64 TimeStamp = 6;
201
+ ActionType Action = 7;
202
+ string Memo = 8;
203
+ }
204
+
205
+ message AnnounceItem {
206
+ string GroupId = 1;
207
+ string SignPubkey = 2;
208
+ string EncryptPubkey = 3;
209
+ string AnnouncerSignature = 4;
210
+ AnnounceType Type = 5;
211
+ string OwnerPubkey = 6;
212
+ string OwnerSignature = 7;
213
+ ApproveType Result = 8;
214
+ int64 TimeStamp = 9;
215
+ ActionType Action = 10;
216
+ string Memo = 11;
217
+ }
218
+
219
+ message SchemaItem {
220
+ string GroupId = 1;
221
+ string GroupOwnerPubkey = 2;
222
+ string GroupOwnerSign = 3;
223
+ string Type = 4;
224
+ string Rule = 5;
225
+ int64 TimeStamp = 6;
226
+ ActionType Action = 7;
227
+ }
228
+
229
+ enum GroupEncryptType {
230
+ PUBLIC = 0; //public group
231
+ PRIVATE = 1; //private group
232
+ }
233
+
234
+ enum GroupConsenseType {
235
+ POA = 0; //proof of authen
236
+ POS = 1;
237
+ }
238
+
239
+ message GroupItem {
240
+ string GroupId = 1;
241
+ string GroupName = 2;
242
+ string OwnerPubKey = 3;
243
+ string UserSignPubkey = 4;
244
+ string UserEncryptPubkey = 5;
245
+ int64 LastUpdate = 6;
246
+ int64 HighestHeight = 7;
247
+ string HighestBlockId = 8;
248
+ Block GenesisBlock = 9;
249
+ GroupEncryptType EncryptType = 10;
250
+ GroupConsenseType ConsenseType = 11;
251
+ string CipherKey = 12;
252
+ string AppKey = 13;
253
+ }
254
+
255
+ enum RoleV0 {
256
+ GROUP_PRODUCER = 0;
257
+ GROUP_USER = 1;
258
+ }
259
+
260
+ enum ChainConfigType {
261
+ SET_TRX_AUTH_MODE = 0;
262
+ UPD_DNY_LIST = 1;
263
+ UPD_ALW_LIST = 2;
264
+ }
265
+
266
+ enum TrxAuthMode {
267
+ FOLLOW_ALW_LIST = 0;
268
+ FOLLOW_DNY_LIST = 1;
269
+ }
270
+
271
+ enum AuthListType {
272
+ ALLOW_LIST = 0;
273
+ DENY_LIST = 1;
274
+ }
275
+
276
+ message ChainConfigItem {
277
+ string GroupId = 1;
278
+ ChainConfigType Type = 2;
279
+ bytes Data = 3;
280
+ string OwnerPubkey = 4;
281
+ string OwnerSignature = 5;
282
+ int64 TimeStamp = 6;
283
+ string Memo = 7;
284
+ }
285
+
286
+ message ChainSendTrxRuleListItem {
287
+ ActionType Action = 1;
288
+ string Pubkey = 3;
289
+ repeated TrxType Type = 4;
290
+ }
291
+
292
+ message SetTrxAuthModeItem {
293
+ TrxType Type = 1;
294
+ TrxAuthMode Mode = 2;
295
+ }
296
+
297
+ message GroupItemV0 {
298
+ string GroupId = 1;
299
+ string GroupName = 2;
300
+ string OwnerPubKey = 3;
301
+ string UserSignPubkey = 4;
302
+ string UserEncryptPubkey = 5;
303
+ RoleV0 UserRole = 6;
304
+ int64 LastUpdate = 7;
305
+ int64 HighestHeight = 8;
306
+ string HighestBlockId = 9;
307
+ Block GenesisBlock = 10;
308
+ GroupEncryptType EncryptType = 11;
309
+ GroupConsenseType ConsenseType = 12;
310
+ string CipherKey = 13;
311
+ string AppKey = 14;
312
+ }
313
+
314
+ enum AppConfigType {
315
+ INT = 0;
316
+ BOOL = 1;
317
+ STRING = 2;
318
+ }
319
+
320
+ message AppConfigItem{
321
+ string GroupId = 1;
322
+ ActionType Action = 2;
323
+ string Name = 3;
324
+ AppConfigType Type = 4;
325
+ string Value = 5;
326
+ string OwnerPubkey = 6;
327
+ string OwnerSign = 7;
328
+ string Memo = 8;
329
+ int64 TimeStamp = 9;
330
+ }
331
+
332
+ message PSPing {
333
+ int32 Seqnum = 1;
334
+ bool IsResp = 2;
335
+ int64 TimeStamp = 3;
336
+ bytes Payload = 4;
337
+ }
338
+
339
+ message GroupSeed {
340
+ Block GenesisBlock = 1;
341
+ string GroupId = 2;
342
+ string GroupName = 3;
343
+ string OwnerPubkey = 4;
344
+ string ConsensusType = 5;
345
+ string EncryptionType = 6;
346
+ string CipherKey = 7;
347
+ string AppKey = 8;
348
+ string Signature = 9;
349
+ }
350
+
351
+ message NodeSDKGroupItem {
352
+ GroupItem Group = 1;
353
+ string EncryptAlias = 2;
354
+ string SignAlias = 3;
355
+ repeated string ApiUrl = 4;
356
+ string GroupSeed = 5;
357
+ }
358
+
359
+ enum HBBMsgType {
360
+ AGREEMENT = 0;
361
+ BROADCAST = 1;
362
+ }
363
+
364
+ message HBMsg {
365
+ string MsgId = 1;
366
+ HBBMsgType MsgType = 2;
367
+ bytes Payload = 3;
368
+ }
369
+
370
+ enum BroadcastMsgType {
371
+ PROOF = 0;
372
+ READY = 1;
373
+ }
374
+
375
+ message HBTrxBundle {
376
+ repeated Trx Trxs = 1;
377
+ }
378
+
379
+ message BroadcastMsg {
380
+ string SenderPubkey = 1;
381
+ BroadcastMsgType Type = 2;
382
+ int64 Epoch = 3;
383
+ bytes Payload = 4;
384
+ }
385
+
386
+ message Proof{
387
+ bytes RootHash = 1;
388
+ repeated bytes Proof = 2;
389
+ int64 Index = 3;
390
+ int64 Leaves = 4;
391
+ bytes ProposerPubkey = 5;
392
+ bytes ProposerSign = 6;
393
+ }
394
+
395
+ message Ready {
396
+ bytes RootHash = 1;
397
+ bytes ProoferPubkey = 2;
398
+ bytes ProposerPubkey = 3;
399
+ bytes ProposerSign = 4;
400
+ }
401
+
402
+ enum AgreementMsgType {
403
+ BVAL = 0;
404
+ AUX = 1;
405
+ }
406
+
407
+ message AgreementMsg {
408
+ AgreementMsgType Type = 1;
409
+ string ProposerId = 2;
410
+ string SenderId = 3;
411
+ int64 Epoch = 4;
412
+ bytes Payload = 5;
413
+ }
414
+
415
+ message Bval {
416
+ bool Value = 1;
417
+ }
418
+
419
+ message Aux {
420
+ bool Value = 1;
421
+ }