web-dc-api 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/dc.min.js +1 -1
  3. package/dist/esm/index.js +1 -1
  4. package/dist/index.d.ts +934 -878
  5. package/package.json +4 -8
  6. package/dist/cjs/helia-core-B1Xqha7a.js +0 -1
  7. package/dist/cjs/helia-core-D8Uv1KjQ.js +0 -1
  8. package/dist/cjs/polkadot-api-7PhQf3ws.js +0 -1
  9. package/dist/cjs/polkadot-api-CtrJVWuZ.js +0 -1
  10. package/dist/esm/chunks/helia-core-BxMqyK2Y.js +0 -1
  11. package/dist/esm/chunks/helia-core-DMXRpcO-.js +0 -1
  12. package/dist/esm/chunks/polkadot-api-5Y9Bw8VT.js +0 -1
  13. package/dist/esm/chunks/polkadot-api-D69Ioun_.js +0 -1
  14. package/lib/common/blowfish/block.ts +0 -259
  15. package/lib/common/blowfish/cipher.ts +0 -144
  16. package/lib/common/blowfish/const.ts +0 -195
  17. package/lib/common/chain.ts +0 -469
  18. package/lib/common/commonclient.ts +0 -202
  19. package/lib/common/constants.ts +0 -55
  20. package/lib/common/dc-key/ed25519.ts +0 -343
  21. package/lib/common/dc-key/keyManager.ts +0 -424
  22. package/lib/common/dcapi.ts +0 -98
  23. package/lib/common/dcutil.ts +0 -627
  24. package/lib/common/define.ts +0 -70
  25. package/lib/common/error.ts +0 -67
  26. package/lib/common/grpc-dc.ts +0 -104
  27. package/lib/common/module-system.ts +0 -184
  28. package/lib/common/service-worker.ts +0 -234
  29. package/lib/common/types/types.ts +0 -344
  30. package/lib/dc.ts +0 -701
  31. package/lib/implements/account/client.ts +0 -185
  32. package/lib/implements/account/manager.ts +0 -683
  33. package/lib/implements/aiproxy/client.ts +0 -357
  34. package/lib/implements/aiproxy/manager.ts +0 -670
  35. package/lib/implements/cache/client.ts +0 -105
  36. package/lib/implements/cache/manager.ts +0 -127
  37. package/lib/implements/comment/client.ts +0 -982
  38. package/lib/implements/comment/manager.ts +0 -1151
  39. package/lib/implements/dc/client.ts +0 -51
  40. package/lib/implements/dc/manager.ts +0 -33
  41. package/lib/implements/file/client.ts +0 -253
  42. package/lib/implements/file/file-cache-manager.ts +0 -142
  43. package/lib/implements/file/manager.ts +0 -1240
  44. package/lib/implements/file/seekableFileStream.ts +0 -344
  45. package/lib/implements/file/streamwriter.ts +0 -322
  46. package/lib/implements/keyvalue/client.ts +0 -376
  47. package/lib/implements/keyvalue/manager.ts +0 -759
  48. package/lib/implements/message/client.ts +0 -250
  49. package/lib/implements/message/manager.ts +0 -215
  50. package/lib/implements/threaddb/cbor/coding.ts +0 -62
  51. package/lib/implements/threaddb/cbor/event.ts +0 -336
  52. package/lib/implements/threaddb/cbor/node.ts +0 -542
  53. package/lib/implements/threaddb/cbor/record.ts +0 -398
  54. package/lib/implements/threaddb/common/AsyncMutex.ts +0 -24
  55. package/lib/implements/threaddb/common/addrinfo.ts +0 -135
  56. package/lib/implements/threaddb/common/dispatcher.ts +0 -81
  57. package/lib/implements/threaddb/common/idbstore-adapter.ts +0 -260
  58. package/lib/implements/threaddb/common/json-patcher.ts +0 -204
  59. package/lib/implements/threaddb/common/key.ts +0 -290
  60. package/lib/implements/threaddb/common/level-adapter.ts +0 -235
  61. package/lib/implements/threaddb/common/lineReader.ts +0 -79
  62. package/lib/implements/threaddb/common/logstore.ts +0 -215
  63. package/lib/implements/threaddb/common/transformed-datastore.ts +0 -308
  64. package/lib/implements/threaddb/core/app.ts +0 -206
  65. package/lib/implements/threaddb/core/core.ts +0 -230
  66. package/lib/implements/threaddb/core/db.ts +0 -249
  67. package/lib/implements/threaddb/core/event.ts +0 -54
  68. package/lib/implements/threaddb/core/head.ts +0 -89
  69. package/lib/implements/threaddb/core/identity.ts +0 -171
  70. package/lib/implements/threaddb/core/logstore.ts +0 -137
  71. package/lib/implements/threaddb/core/options.ts +0 -14
  72. package/lib/implements/threaddb/core/record.ts +0 -54
  73. package/lib/implements/threaddb/db/collection.ts +0 -1910
  74. package/lib/implements/threaddb/db/db.ts +0 -698
  75. package/lib/implements/threaddb/db/json2Query.ts +0 -192
  76. package/lib/implements/threaddb/db/query.ts +0 -524
  77. package/lib/implements/threaddb/dbclient.ts +0 -543
  78. package/lib/implements/threaddb/dbmanager.ts +0 -1906
  79. package/lib/implements/threaddb/lsstoreds/addr_book.ts +0 -549
  80. package/lib/implements/threaddb/lsstoreds/cache.ts +0 -36
  81. package/lib/implements/threaddb/lsstoreds/cyclic_batch.ts +0 -87
  82. package/lib/implements/threaddb/lsstoreds/global.ts +0 -151
  83. package/lib/implements/threaddb/lsstoreds/headbook.ts +0 -373
  84. package/lib/implements/threaddb/lsstoreds/keybook.ts +0 -297
  85. package/lib/implements/threaddb/lsstoreds/logstore.ts +0 -29
  86. package/lib/implements/threaddb/lsstoreds/metadata.ts +0 -223
  87. package/lib/implements/threaddb/net/define.ts +0 -149
  88. package/lib/implements/threaddb/net/grpcClient.ts +0 -589
  89. package/lib/implements/threaddb/net/grpcserver.ts +0 -146
  90. package/lib/implements/threaddb/net/net.ts +0 -2047
  91. package/lib/implements/threaddb/pb/lstore.proto +0 -38
  92. package/lib/implements/threaddb/pb/lstore.ts +0 -393
  93. package/lib/implements/threaddb/pb/lstore_pb.d.ts +0 -433
  94. package/lib/implements/threaddb/pb/lstore_pb.js +0 -1085
  95. package/lib/implements/threaddb/pb/net.proto +0 -194
  96. package/lib/implements/threaddb/pb/net_pb.d.ts +0 -2349
  97. package/lib/implements/threaddb/pb/net_pb.js +0 -5525
  98. package/lib/implements/threaddb/pb/proto-custom-types.ts +0 -212
  99. package/lib/implements/util/client.ts +0 -72
  100. package/lib/implements/util/manager.ts +0 -146
  101. package/lib/implements/wallet/manager.ts +0 -671
  102. package/lib/index.ts +0 -57
  103. package/lib/interfaces/DCContext.ts +0 -51
  104. package/lib/interfaces/aiproxy-interface.ts +0 -145
  105. package/lib/interfaces/auth-interface.ts +0 -118
  106. package/lib/interfaces/cache-interface.ts +0 -22
  107. package/lib/interfaces/client-interface.ts +0 -11
  108. package/lib/interfaces/comment-interface.ts +0 -167
  109. package/lib/interfaces/components/news-component.ts +0 -0
  110. package/lib/interfaces/database-interface.ts +0 -169
  111. package/lib/interfaces/file-interface.ts +0 -120
  112. package/lib/interfaces/index.ts +0 -10
  113. package/lib/interfaces/keyvalue-interface.ts +0 -156
  114. package/lib/interfaces/message-interface.ts +0 -22
  115. package/lib/interfaces/util-interface.ts +0 -31
  116. package/lib/modules/aiproxy-module.ts +0 -246
  117. package/lib/modules/auth-module.ts +0 -753
  118. package/lib/modules/cache-module.ts +0 -99
  119. package/lib/modules/client-module.ts +0 -71
  120. package/lib/modules/comment-module.ts +0 -429
  121. package/lib/modules/components/news-components.ts +0 -390
  122. package/lib/modules/database-module.ts +0 -598
  123. package/lib/modules/file-module.ts +0 -291
  124. package/lib/modules/index.ts +0 -13
  125. package/lib/modules/keyvalue-module.ts +0 -379
  126. package/lib/modules/message-module.ts +0 -107
  127. package/lib/modules/util-module.ts +0 -148
  128. package/lib/polyfills/process-env-browser.ts +0 -1
  129. package/lib/proto/datasource.ts +0 -93
  130. package/lib/proto/dcnet.proto +0 -1601
  131. package/lib/proto/dcnet_proto.d.ts +0 -22857
  132. package/lib/proto/dcnet_proto.js +0 -55204
  133. package/lib/proto/dcnet_proto_sparse.js +0 -55166
  134. package/lib/proto/oidfetch.proto +0 -25
  135. package/lib/proto/oidfetch_proto.d.ts +0 -585
  136. package/lib/proto/oidfetch_proto.js +0 -1247
  137. package/lib/serverless/babel-browser.ts +0 -39
  138. package/lib/serverless/base_entity.ts +0 -78
  139. package/lib/serverless/base_repository.ts +0 -414
  140. package/lib/serverless/browser_schema_extractor.ts +0 -283
  141. package/lib/serverless/decorator_factory.ts +0 -322
  142. package/lib/util/BrowserLineReader.ts +0 -73
  143. package/lib/util/base64.ts +0 -105
  144. package/lib/util/bcrypt.ts +0 -206
  145. package/lib/util/curve25519Encryption.ts +0 -418
  146. package/lib/util/dccrypt.ts +0 -73
  147. package/lib/util/logger.ts +0 -104
  148. package/lib/util/utils.ts +0 -289
@@ -1,1601 +0,0 @@
1
- syntax = "proto3";
2
- package dcnet.pb;
3
-
4
- message StoreThreadRequest {
5
- bytes threadId = 1;
6
- bytes userPubkey = 2 ;
7
- bytes serviceKeyEncrypt = 3 ;
8
- }
9
-
10
- message StoreThreadReply {
11
- int32 status = 1;
12
- }
13
-
14
-
15
- message StroeFileToPeerRequest {
16
- bytes cid = 1 ;
17
- uint64 size =2;
18
- bytes userPubkey = 3;
19
-
20
- }
21
-
22
- message StroeFileToPeerReply {
23
- int32 status = 1;
24
- int64 receivesize = 2;
25
-
26
- }
27
-
28
-
29
-
30
- message OnlineStatusCheckRequest {
31
- bytes challenge = 1; //随机挑战数据
32
- }
33
-
34
-
35
- message OnlineStatusCheckReply {
36
- bytes teereport = 1; //根据挑战生成的tee报告
37
- }
38
-
39
- message CheckPeerStatusRequest{
40
- oneof payload {
41
- Sreq sreq =1;
42
- bytes teereport = 2;//确认有效请求身份
43
- }
44
- message Sreq {
45
- bytes pubkey = 1 ; //发起请求节点本身的pubkey
46
- bytes peerid = 2 ; //需要协助检查的peerid
47
- }
48
- }
49
-
50
-
51
-
52
- message CheckPeerStatusReply{
53
- oneof payload {
54
- bytes challenge = 1;
55
- Body body = 2;//teereport里面包含被检查peerid
56
- }
57
- message Body {
58
- bytes peerid = 1 ;
59
- int32 status = 2; //0:节点在线 1:节点不在线 2:节点链上状态已离线,无需检查
60
- bytes teereport = 3;
61
- }
62
- }
63
-
64
-
65
-
66
-
67
-
68
- message LocalFileCheckRequest {
69
- repeated string keys = 1 ;
70
- }
71
-
72
-
73
- message LocalFileCheckReply {
74
- int32 flag = 1; //文件是否存在 0:存在 1:文件丢失 2:链上不存在对应备份信息
75
- string failkey =2;//检查出错的key
76
- bytes teereport = 3; //对请求的keys+failkey进行签名的teereport
77
- }
78
-
79
-
80
- message LocalAccountInfoCheckRequest {
81
- repeated bytes accounthashs = 1 ;
82
- }
83
-
84
-
85
-
86
- message LocalAccountInfoCheckReply {
87
- int32 flag = 1; //账号对应的信息是否存在 0:存在 1:丢失 2:链上不存在对应备份信息 3:账号登录信息在两个节点间不一致(需要对应的节点发起备份请求)4、检查节点无权检查
88
- bytes failkey =2;//检查出错的accounthash
89
- bytes teereport = 3; //对请求的accounthashs+failkey进行签名作为数据的teereport
90
- }
91
-
92
-
93
-
94
- message AccountInfoSyncRequest {
95
- bytes accounthash = 1 ;
96
- uint32 blockheight =2;
97
- bytes prikeyencrypthash =3;
98
-
99
- }
100
-
101
-
102
-
103
- message AccountInfoSyncReply {
104
- }
105
-
106
- message SetEncryptKeyWithScanRequest {
107
- bytes encryptPrivkey = 1 ;
108
- bytes mapkey = 2 ; //用于标记加密key的key
109
- }
110
-
111
-
112
- message SetEncryptKeyWithScanReply {
113
- }
114
-
115
- message GetEncryptKeyWithScanRequest {
116
- bytes mapkey = 1 ; //用于标记加密key的key
117
- }
118
-
119
-
120
- message GetEncryptKeyWithScanReply {
121
- bytes encryptPrivkey = 1 ;
122
- }
123
-
124
-
125
-
126
-
127
-
128
- message RequestRandEncryptKeyRequest {
129
- bytes enclaveid = 1 ; //关联的enclaveid,本enclaveid必须是技术委员会签发的
130
- }
131
-
132
-
133
- message RequestRandEncryptKeyReply {
134
- bytes encryptKey = 1;//用请求节点的pubkey对key进行加密后的数据
135
- bytes signature =2; //提供服务的dc节点私钥对key的签名sign(key)
136
- }
137
-
138
-
139
- message GetEncryptKeyRequest {
140
- bytes peerId = 1 ; //节点真实的peerid
141
- bytes teereport =2 ; //请求节点的teereport,reportdata为 发起请求时节点临时peerid关联的pubkey
142
- }
143
-
144
-
145
- message GetEncryptKeyReply {
146
- bytes encryptKey = 1;//用请求节点的pubkey对key进行加密后的数据
147
- bytes signature =2; //处理节点私钥对key的签名sign(key)
148
- }
149
-
150
-
151
-
152
- message GetPeersWithSidRequest {
153
- string sid = 1 ;
154
- }
155
-
156
- message GetPeersWithSidReply {
157
- repeated string peerids = 1 ; //存储了对应文件的peerid列表
158
- }
159
-
160
-
161
- message GetPeersWithAccountHashRequest {
162
- bytes accounthash = 1 ;
163
- }
164
-
165
- message GetPeersWithAccountHashReply {
166
- repeated string peerids = 1 ; //存储了对应账号登录信息的peerid列表
167
- }
168
-
169
-
170
-
171
-
172
-
173
-
174
- message AccountDealBackupRequest {
175
- bytes pubkey =1 ; //发起操作请求的pubkey
176
- bytes accountencrypt = 2; //账号值用用户自身pubkey加密,防止链上账号与pubkey的关联信息被泄露
177
- bytes accounthashencrypt = 3; //账号hash值用接收节点pubkey加密,主要防止传输过程中数据泄露
178
- bytes prikeyencrypt2 = 4; //双重加密后的数据,首先用(密码hash后采用Bcrypt加密后的hash值(盐值为密码hash后22个字符)+账号)hash值加密账号绑定的用户私钥生成prikeyencrypt,然后再用接收节点pubkey加密prikeyencrypt生成prikeyencrypt2
179
- uint32 blockheight = 5;
180
- bytes randkeyencrypt = 6;
181
- bytes loginkeyrandencrypt = 7;//(账号hash+密码前两位取hash后的后两位) 组合后的hash值loginkey+randkeyhash,再用节点pubkey加密,
182
- //解密出来后登录时用,主要防止传输过程中数据泄露(解析过程:1、用节点私钥从randencrpt中解密出rand,2、用节点私钥解密loginkeyrandencrypt生成 loginkeyrand 3、从loginkeyrand中去掉rand,生成loginkey)
183
- bytes peerid = 8 ;
184
- bytes signature = 9;//sign(accounthash+prikeyencrypthash+blockheight+peerid)
185
- bytes vaccount = 10 ; //虚拟账号,可选,如果有虚拟账号
186
- }
187
-
188
- message AccountDealBackupReply {
189
- }
190
-
191
- //供sdk调用的接口定义
192
-
193
- message GetHostIDRequest {}
194
-
195
- message GetHostIDReply {
196
- bytes peerID = 1;
197
- bytes reqAddr =2; //发起请求节点的节点地址信息
198
- }
199
-
200
- message ReportLocalMultilAddrRequest{
201
- string addr = 1;
202
- }
203
-
204
- message ReportLocalMultilAddrReply{
205
- }
206
-
207
- message GetTokenRequest {
208
- oneof payload {
209
- string key = 1;
210
- bytes signature = 2;
211
- }
212
- }
213
-
214
- message GetTokenReply {
215
- oneof payload {
216
- bytes challenge = 1;
217
- string token = 2;
218
- }
219
- }
220
-
221
- message CreateThreadRequest {
222
- bytes threadID = 1;
223
- Keys keys=2;
224
- uint32 blockheight = 3;
225
- bytes signature = 4;//sign(threadid+threadKey+logkey+blockheight+otype(2)+peerid)
226
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
227
- }
228
-
229
- message Keys {
230
- bytes threadKeyEncrpt = 1; //用接收节点的pubkey加密
231
- bytes logKeyEncrpt = 2; //用接收节点的pubkey加密
232
- }
233
-
234
- message ThreadInfoReply {
235
- bytes threadID = 1;
236
- repeated LogInfo logs = 3;
237
- repeated bytes addrs = 4;
238
- }
239
-
240
- message LogInfo {
241
- bytes ID = 1;
242
- bytes pubKey = 2;
243
- bytes privKey = 3;
244
- repeated bytes addrs = 4;
245
- bytes head = 5;
246
- bytes counter = 6;
247
- }
248
-
249
-
250
- message ThreadIDRequest {
251
- bytes vaccount = 1 ; //虚拟账号,可选,如果有虚拟账号
252
- }
253
-
254
- message ThreadIDReply {
255
- bytes threadID = 1;
256
-
257
- }
258
-
259
-
260
- message AddThreadToPeerRequest {
261
- bytes threadID = 1;
262
- uint32 blockheight = 2;
263
- Keys keys = 3;
264
- bytes signature = 4;//sign("addthread"+threadid+blockheight+peerid)
265
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
266
- }
267
-
268
-
269
- message AddThreadToPeerReply{
270
- int32 status = 1;
271
- int64 count = 2;
272
- }
273
-
274
-
275
-
276
- message GetThreadRequest {
277
- bytes threadID = 1;
278
- bytes vaccount = 2 ; //虚拟账号,可选,如果有虚拟账号
279
- }
280
-
281
- message DeleteThreadRequest {
282
- bytes threadID = 1;
283
- uint32 blockheight = 2;
284
- bytes signature = 3;//sign(threadid+blockheight+otype(2)+peerid)
285
- bytes vaccount = 4 ; //虚拟账号,可选,如果有虚拟账号
286
- }
287
-
288
- message DeleteThreadReply {}
289
-
290
-
291
-
292
-
293
-
294
- message StroeFileRequest {
295
- bytes cid = 1;
296
- uint64 filesize = 2;
297
- uint32 blockheight = 3;
298
- bytes signature = 4; //sign(cid+filesize+blockheight+file_type(1)+peerid)
299
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
300
- }
301
-
302
- message StroeFileReply {
303
- int32 status = 1;
304
- uint64 receivesize = 2;
305
-
306
- }
307
-
308
-
309
-
310
-
311
-
312
- message DeleteFileRequest {
313
- bytes cid = 1;
314
- uint32 blockheight = 2;
315
- bytes signature = 3;//sign(cid+blockheight+otype(2)+peerid)
316
- bytes vaccount = 4 ; //虚拟账号,可选,如果有虚拟账号
317
- }
318
-
319
- message DeleteFileReply {
320
- bool flag = 1;
321
- }
322
-
323
-
324
- message StoreFolderRequest {
325
- bytes cid = 1;
326
- uint64 foldersize = 2;
327
- uint32 filecount = 3;
328
- uint32 blockheight = 4;
329
- bytes signature = 5; //sign(cid+foldersize+blockheight+file_type(2)+peerid) 为了与文件存储一致,fileconunt不参与签名
330
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
331
- }
332
-
333
- message StoreFolderReply {
334
- int32 status = 1;
335
- uint32 receivecount = 2; //已经接收完成的文件数量
336
- }
337
-
338
-
339
-
340
-
341
-
342
- message AccountDealRequest {
343
- bytes accountencrypt = 1; //账号值用账号绑定的user pubkey加密,这样账号信息在链上也无法被其他人解密
344
- bytes accounthashencrypt = 2; //账号值用账号绑定的user pubkey加密,这样账号信息在链上也无法被其他人解密
345
- bytes prikeyencrypt2 = 3; //双重加密后的数据,首先用(密码hash后采用Bcrypt加密后的hash值(盐值为密码hash后22个字节)+账号)hash值为密钥采用aes加密账号绑定的用户私钥生成prikeyencrypt,然后再用节点pubkey加密prikeyencrypt生成prikeyencrypt2(保证传输安全)
346
- uint32 blockheight = 4;
347
- bytes loginkeyrandencrypt = 5;//账号hash+密码后两位组合后的hash值loginkey+randkeyhash,再用节点pubkey加密,
348
- //解密出来后登录时用,主要防止传输过程中数据泄露(解析过程:1、用节点私钥从randencrpt中解密出rand,2、用节点私钥解密loginkeyrandencrypt生成 loginkeyrand 3、从loginkeyrand中去掉rand,生成loginkey)
349
- bytes peerid = 6; //允许发起上链请求的peerid
350
- bytes signature = 7;//sign(accounthash+prikeyencrypthash+blockheight)
351
- bytes vaccount = 8 ; //虚拟账号,可选,如果有虚拟账号
352
- }
353
-
354
- message AccountDealReply {
355
- }
356
-
357
-
358
- message AccountLoginRequest {
359
- bytes accounthashencrypt =1; //账号hash值用节点pubkey加密,主要防止传输过程中数据泄露
360
- bytes pubkeyencrypt = 2; //临时生成的发起请求用的pubkey,用节点的pubkey进行加密
361
- bytes loginkeyrandencrypt = 3;//账号hash+密码后两位组合后的hash值loginkey+randkeyhash,再用节点pubkey加密,
362
- //解密出来后登录时用,主要防止传输过程中数据泄露(解析过程:1、用节点私钥从randencrpt中解密出rand,2、用节点私钥解密loginkeyrandencrypt生成 loginkeyrand 3、从loginkeyrand中去掉rand,生成loginkey)
363
- }
364
-
365
- message AccountLoginReply {
366
- bytes prikeyencrypt2 = 1;//用(密码hash后采用Bcrypt加密后的hash值(盐值为密码hash后16个字节)+账号)hash值加密账号绑定的用户私钥生成prikeyencrypt,再用发起请求的pubkey加密 客户端取得数据后,还需要进行两次解密(1、临时私钥解密 2、账号密码组合成密码后解密)
367
- }
368
-
369
-
370
- message TransferAccountRequest {
371
- bytes accounthashencrypt = 1; //账号hash值用节点pubkey加密,主要防止传输过程中数据泄露
372
- bytes recvpubkey =2;//接收账号的pubkey
373
- uint32 blockheight = 3;
374
- bytes peerid = 4; //允许发起上链请求的peerid
375
- bytes signature = 5;//sign(accounthash+recvpubkey+blockheight+peerid)
376
- }
377
-
378
- message TransferAccountReply {
379
- }
380
-
381
-
382
-
383
-
384
- message SetUserDefaultDBRequest{
385
- bytes dbinfocrypt = 1;
386
- uint32 blockheight = 2;
387
- bytes peerid = 3; //允许发起上链请求的peerid
388
- bytes signature = 4;//sign(dbinfocrypt+blockheight+peerid)
389
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
390
- }
391
-
392
- message SetUserDefaultDBReply{
393
- }
394
-
395
-
396
- message AddSubPubkeyRequest{
397
- bytes subpubkey = 1;
398
- uint32 blockheight = 2;
399
- bytes peerid = 3; //允许发起上链请求的peerid
400
- bytes signature = 4;//sign(subpubkey+blockheight+peerid)
401
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
402
- }
403
-
404
- message AddSubPubkeyReply{
405
-
406
- }
407
-
408
- message DeleteSubPubkeyRequest{
409
- bytes subpubkey = 1;
410
- uint32 blockheight = 2;
411
- bytes peerid = 3; //允许发起上链请求的peerid
412
- bytes signature = 4;//sign(subpubkey+blockheight+peerid)
413
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
414
- }
415
-
416
- message DeleteSubPubkeyReply{
417
-
418
- }
419
-
420
- message BindAccessPeerToUserRequest{
421
- uint32 blockheight = 1;
422
- bytes signature = 2;//sign("add_request_peer_id_to_user"+blockheight+接入peerid)
423
- }
424
-
425
- message BindAccessPeerToUserReply{
426
-
427
- }
428
-
429
- message ValidTokenRequest{
430
-
431
- }
432
-
433
- message ValidTokenReply{
434
-
435
- }
436
-
437
- message AddLogToThreadRequest{
438
- bytes threadID = 1 ;
439
- bytes logID = 2 ;
440
- uint32 blockheight = 3;
441
- bytes peerid = 4; //允许发起上链请求的peerid
442
- bytes signature = 5;//sign(threadID+logID+blockheight+peerid)
443
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
444
-
445
- }
446
-
447
- message AddLogToThreadReply{
448
-
449
- }
450
-
451
- message AddThreadSpaceRequest{
452
- bytes threadID = 1 ;
453
- uint32 blockheight = 2;
454
- uint32 space = 3; //要增加的空间
455
- bytes signature = 4;//sign(threadID+blockheight+peerid+space)
456
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
457
- }
458
-
459
- message AddThreadSpaceReply{
460
-
461
- }
462
-
463
- message GetThreadUsedSpaceRequest{
464
- bytes threadID = 1 ;
465
- int64 randnum = 2;//请求随机数据
466
- }
467
-
468
- message GetThreadUsedSpaceReply{
469
- uint64 usedsize = 1;
470
- bytes signature = 2;//sign(threadID+randnum+usedsize)
471
- }
472
-
473
-
474
-
475
- message TeeReportVerifyRequest{
476
- bytes teereport =1; //需要协助验证的teereport数据
477
- }
478
-
479
- message TeeReportVerifyReply{
480
- bytes report = 1; //attestation.Report数据序列化
481
- bytes signature =2;//节点私钥对report加发起请求的peerid的签名sign(report+reqPeerid)
482
- }
483
-
484
- message SendMsgToUserBoxRequest {
485
- UserMsg msg = 1; //消息
486
- bytes AuthSignature =2;//来自发送用户账号备份节点的发送消息授权签名
487
- bytes PeerId = 3;//生成签名的发送用户账号备份节点的peerid
488
- }
489
-
490
- message SendMsgToUserBoxReply {
491
- uint32 flag = 1;//离线消息发送反馈 0:成功 1:用户信息在委托节点不存在,拒绝发送 2:对端收件箱离线,发送失败
492
- }
493
-
494
- message GetToUserBoxAuthRequest {
495
- bytes msgSignature = 1; //要发送的消息签名
496
- }
497
-
498
- message GetToUserBoxAuthReply {
499
- bytes signature = 1; //对用户要发送消息签名的签名
500
-
501
- }
502
-
503
- message GetMaxKeyFromUserBoxRequest{
504
- bytes appId = 1; //应用标志
505
- }
506
-
507
- message GetMaxKeyFromUserBoxReply{
508
- bytes maxkey = 1;//返回的最大seekkey
509
- }
510
-
511
-
512
- message GetMsgFromUserBoxRequest{
513
- bytes appId = 1; //应用标志
514
- uint32 blockheight = 2; //获取消息的起始高度
515
- bytes seekKey = 3; //获取消息的起始key
516
- uint32 limit = 4; //获取的最大消息数量
517
- }
518
-
519
- message GetMsgFromUserBoxReply{
520
- repeated UserMsg msgs = 1;//返回的消息列表
521
- }
522
-
523
-
524
-
525
- message UserMsg {
526
- bytes messageId = 1; //消息ID
527
- bytes senderPubkey = 2; //发送者公钥
528
- bytes receiverPubkey = 3; //接收者公钥
529
- bytes appId = 4; //应用标志
530
- uint32 blockheight = 5; //发送消息时的区块高度
531
- bytes encryptMsg =6 ;//接收者公钥加密的数据
532
- bytes signature =7 ; //发送者私钥对(messageId+receiverPubkey+appId+blockheight+encryptMsg)的签名
533
- }
534
-
535
- message ReportSpamMsgRequest{
536
- UserMsg msg = 1; //被举报的消息
537
- uint32 blockheight = 2; //举报时的区块高度
538
- bytes signature = 3; //当次举报的签名 sign(messageId+senderPubkey+blockheight)
539
- bytes vaccount = 4 ; //虚拟账号,可选,如果有虚拟账号
540
- }
541
-
542
- message ReportSpamMsgReply{
543
- }
544
-
545
-
546
-
547
-
548
- message GetUserClientPeersRequest{
549
- bytes userPubkey = 1 ;//要请求的用户pubkey
550
- }
551
-
552
- message GetUserClientPeersReply{
553
- repeated string peers = 1 ;//用户绑定的peer 地址列表
554
- }
555
-
556
-
557
- message AddThemeObjRequest{
558
- bytes theme = 1; //主题CID
559
- bytes appId = 2; //应用标志
560
- uint32 blockheight = 3; //发送请求时的区块高度
561
- uint32 commentSpace = 4; //评论可使用的空间
562
- uint32 allowSpace = 5; //允许评论占有的最大空间大小,不参与签名,因为本字段值会随着新增评论空间而调整,默认等于commentspace
563
- bytes userPubkey = 6; //添加对象用户公钥
564
- uint32 openFlag = 7; //是否公开评论 true:用户评论后立马显示,任何人都可以查看 false:用户评论后,评论的状态直接设置为私密
565
- bytes signature =8; //发送者私钥对(objCid+appId+blockheight+commentspace+openFlag)的签名
566
- uint32 CCount = 9; //被评论数量
567
- uint32 UpCount = 10; //顶或赞梳理
568
- uint32 DownCount = 11; //踩数量
569
- uint32 TCount = 12; //推荐数量
570
- bytes vaccount = 13 ; //虚拟账号,可选,如果有虚拟账号
571
- }
572
-
573
- message AddThemeObjReply{
574
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
575
- }
576
-
577
-
578
- message AddThemeSpaceRequest{
579
- bytes theme = 1; //要调整的主题CID
580
- bytes appId = 2; //应用标志
581
- uint32 blockheight = 3; //发送请求时的区块高度
582
- uint32 addspace = 4; //增加的评论空间
583
- bytes userPubkey = 5; //添加对象用户公钥
584
- bytes signature =6 ; //发送者私钥对(objCid+appId+blockheight+addspace)的签名
585
- bytes vaccount = 7 ; //虚拟账号,可选,如果有虚拟账号
586
- }
587
-
588
- message AddThemeSpaceReply{
589
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
590
-
591
- }
592
-
593
-
594
- message SetCacheKeyRequest{
595
- uint32 expire = 1; // 过期的时间,单位为秒,最大为1年,即 31536000 秒
596
- uint32 blockheight = 2; //发送请求时的区块高度
597
- bytes value = 3; //要存储的内容
598
- bytes signature = 4; //发送者私钥对(expire+blockheight+value)的签名
599
- }
600
-
601
- message SetCacheKeyReply{
602
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
603
- bytes cacheKey = 2 ; // 根据算法生成的随机不重复的key,该key包含了peeid信息
604
- }
605
-
606
- message GetCacheValueRequest{
607
- bytes key = 1; //要存储的内容
608
- }
609
- message GetCacheValueReply{
610
- bytes value = 1 ; // 获取的值
611
- }
612
-
613
- message GetThemeSpaceRequest{
614
- bytes theme = 1; //要调整的主题CID
615
- bytes appId = 2; //应用标志
616
- uint32 blockheight = 3; //发送请求时的区块高度
617
- bytes userPubkey = 4; //对象用户公钥,只有对象用户才能获取评论空间大小
618
- bytes signature =5 ; //发送者私钥对(objCid+appId+blockheight)的签名
619
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
620
- }
621
-
622
- message GetThemeSpaceReply{
623
- uint32 space = 1; //评论空间大小
624
- }
625
-
626
- message DeleteThemeObjRequest{
627
- bytes theme = 1; //要删除的主题CID
628
- bytes appId = 2; //应用标志
629
- uint32 blockheight = 3; //发送请求时的区块高度
630
- bytes userPubkey = 4; //对象用户公钥
631
- bytes signature = 5 ; //发送者私钥对(objCid+appId+blockheight)的签名
632
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
633
- }
634
-
635
- message DeleteThemeObjReply{
636
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
637
- }
638
-
639
-
640
- message PublishCommentToThemeRequest{
641
- bytes theme = 1; //主题CID
642
- bytes appId = 2; //应用标志
643
- bytes themeAuthor = 3;//发布主题的的作者pubkey
644
- uint32 blockheight = 4; //发送请求时的区块高度
645
- bytes userPubkey = 5; //发布评论的用户
646
- bytes commentCid = 6; //发布的评论CID(接收节点需要校验commentCId与comment是否一致)
647
- bytes comment = 7; //发布的评论
648
- uint32 commentSize = 8; //评论的大小
649
- uint32 status = 9; //评论状态(0:公开 1:私密 )
650
- bytes refercommentkey=10; //评论引用的另外一个评论的key
651
- uint32 CCount = 11; //被评论数量
652
- uint32 UpCount = 12; //顶或赞梳理
653
- uint32 DownCount = 13; //踩数量
654
- uint32 TCount = 14; //推荐数量
655
- uint32 type = 15; //评论的类型 0:普通评论 1:点赞 2:推荐 3:踩
656
- bytes signature = 16 ; //发送者私钥对sign(theme+appId+themeAuthor+blockheight+commentCid+Refercommentkey+type)的签名
657
- bytes vaccount = 17 ; //虚拟账号,可选,如果有虚拟账号
658
- uint64 timestamp = 18 ; //接收时的时间戳,由接收节点生成,单位为微秒
659
- }
660
-
661
- message PublishCommentToThemeReply{
662
- uint32 flag =1; //0:成功 1:评论空间没有配置 2:评论空间不足
663
- }
664
-
665
-
666
- message SetKeyValueRequest{
667
- bytes theme = 1; //主题CID
668
- bytes appId = 2; //应用标志
669
- bytes themeAuthor = 3;//发布主题的的作者pubkey
670
- uint32 blockheight = 4; //发送请求时的区块高度
671
- bytes userPubkey = 5; //设置keyvalue的用户
672
- bytes contentCid = 6; //keyvalue内容的CID(接收节点需要校验contentCid与content是否一致)
673
- bytes content = 7; //keyvalue内容
674
- uint32 contentSize = 8; //keyvalue内容大小
675
- uint32 type = 9; //CommentType_KeyValue 4
676
- bytes signature = 10 ; //发送者私钥对sign(theme+appId+themeAuthor+blockheight+contentCid+type)的签名
677
- bytes vaccount = 11 ; //虚拟账号,可选,如果有虚拟账号
678
- }
679
-
680
-
681
- message SetKeyValueReply{
682
- uint32 flag =1; //0:成功 1:空间没有配置 2:keyvalue空间不足
683
- uint64 timestamp = 2 ; //接收时的时间戳,由接收节点生成,单位为微秒
684
- }
685
-
686
-
687
-
688
-
689
-
690
-
691
-
692
- message ConfigThemeObjAuthRequest{
693
- bytes theme = 1; //主题CID
694
- bytes appId = 2; //应用标志
695
- bytes themeAuthor = 3;//发布主题的的作者pubkey
696
- uint32 blockheight = 4; //发送请求时的区块高度
697
- bytes userPubkey = 5; //操作的用户
698
- bytes contentCid = 6; //权限内容的hash值(接收节点需要校验contentCid与content是否一致)
699
- bytes content = 7; //配置的授权内容格式: userpubkey:permission:remark(remark可选,存放应用自定义的任何信息),userpubkey为用户的公钥16进制表示(all为特殊情况),permission为用户的权限,remark为备注信息
700
- uint32 contentSize = 8; //评论的大小
701
- uint32 type = 9; // 必须为0
702
- bytes signature = 10 ; //发送者私钥对sign(theme+appId+themeAuthor+blockheight+contentCid+type)的签名
703
- bytes vaccount = 11 ; //虚拟账号,可选,如果有虚拟账号
704
- }
705
-
706
-
707
- message ConfigThemeObjAuthReply{
708
- uint32 flag =1; //0:成功 1:空间没有配置 2:keyvalue空间不足
709
- }
710
-
711
-
712
-
713
-
714
-
715
- message AddUserOffChainSpaceRequest{
716
- bytes userPubkey = 1; //要新增用户对外评论空间的用户
717
- uint32 blockheight = 2; //发送请求时的区块高度
718
- bytes peerid = 3; //允许发起上链请求的peerid
719
- bytes signature = 4 ; //发送者私钥对(peerid+blockheight)的签名
720
- bytes vaccount = 5 ; //虚拟账号,可选,如果有虚拟账号
721
- }
722
-
723
- message AddUserOffChainSpaceReply{
724
- }
725
-
726
-
727
-
728
-
729
-
730
-
731
- message ReportMaliciousCommentRequest{
732
- bytes theme = 1; //主题CID
733
- bytes appId = 2; //应用标志
734
- bytes themeAuthor = 3;//发布评论对象的作者pubkey
735
- uint32 blockheight = 4; //请求操作时的区块高度
736
- uint32 commentBlockheight = 5; //添加评论时的区块高度
737
- bytes commentCid = 6; //发布的评论CID
738
- bytes signature = 7 ; //发送者私钥对(objCid+appId+themeAuthor+blockheight+commentCid)的签名
739
- bytes vaccount = 8 ; //虚拟账号,可选,如果有虚拟账号,
740
- }
741
-
742
-
743
-
744
- message ReportMaliciousCommentReply{
745
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
746
- }
747
-
748
-
749
- message SetObjCommentPublicRequest{
750
- bytes theme = 1; //主题CID
751
- bytes appId = 2; //应用标志
752
- bytes themeAuthor = 3;//发布评论对象的作者pubkey
753
- uint32 blockheight = 4; //请求操作时的区块高度
754
- uint32 commentBlockheight = 5; //添加评论时的区块高度
755
- bytes commentCid = 6; //发布的评论CID
756
- bytes signature = 7 ; //发送者私钥对(objCid+appId+themeAuthor+blockheight+commentCid)的签名
757
- bytes vaccount = 8 ; //虚拟账号,可选,如果有虚拟账号
758
- }
759
-
760
-
761
-
762
- message SetObjCommentPublicReply{
763
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
764
- }
765
-
766
-
767
-
768
-
769
- message DeleteSelfCommentRequest{
770
- bytes theme = 1; //主题CID
771
- bytes appId = 2; //应用标志
772
- bytes userPubkey = 3; //发布评论的用户
773
- bytes themeAuthor = 4;//发布主题的作者pubkey
774
- uint32 blockheight = 5; //发送请求时的区块高度
775
- uint32 commentBlockheight = 6; //添加评论时的区块高度
776
- bytes commentCid = 7; //发布的评论CID
777
- bytes signature = 8; //发送者私钥对(objCid+appId+themeAuthor+blockheight+commentCid)的签名
778
- bytes vaccount = 9 ; //虚拟账号,可选,如果有虚拟账号
779
- }
780
-
781
-
782
-
783
- message DeleteSelfCommentReply{
784
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
785
- }
786
-
787
- message DeleteCommentToObjRequest{
788
- bytes theme = 1; //主题CID
789
- bytes appId = 2; //应用标志
790
- bytes userPubkey = 3; //发布评论的用户
791
- bytes themeAuthor = 4;//发布主题的作者pubkey
792
- uint32 blockheight = 5; //发送请求时的区块高度
793
- uint32 commentBlockheight = 6; //添加评论时的区块高度
794
- bytes commentCid = 7; //发布的评论CID
795
- bytes signature = 8; //发送者私钥对(objCid+appId+themeAuthor+blockheight+commentCid)的签名
796
- bytes vaccount = 9 ; //虚拟账号,可选,如果有虚拟账号
797
- }
798
-
799
-
800
-
801
- message DeleteCommentToObjReply{
802
- uint32 flag = 1; //0:成功 1:评论空间没有配置 2:评论空间不足 3:评论数据同步中
803
- }
804
-
805
-
806
- message IsThemeExistRequest{
807
- bytes theme = 1; //主题CID
808
- bytes appId = 2; //应用标志
809
- bytes themeAuthor = 3;//发布评论对象的作者pubkey
810
- }
811
-
812
- message IsThemeExistReply{
813
- uint32 flag = 1; //0:存在 1:不存在
814
- }
815
-
816
-
817
-
818
-
819
-
820
- message GetThemeObjRequest{
821
- bytes appId = 1; //应用标志
822
- bytes themeAuthor = 2;//发布评论对象的作者pubkey
823
- uint32 startHeight = 3; //开始的区块高度
824
- uint32 direction = 4;//遍历方向 0:正向 1:逆向
825
- uint32 offset = 5; //偏移量,以开始的区块高度的第一条记录开始计数
826
- uint32 limit = 6; //返回的记录条数,最多为1000
827
- bytes seekKey = 7; //起始key,如果设置了seekKey,忽略startHeight seekKey格式: commentableobjcid
828
- bytes vaccount = 8 ; //虚拟账号,可选,如果有虚拟账号
829
- }
830
-
831
-
832
-
833
-
834
-
835
- message GetThemeObjReply{
836
- uint32 flag = 1;//处理结果
837
- bytes objsCid = 2; //获取的评论列表结果集,存入ipfs网络中后反馈的cid,客户端再通过 getFile获取,结果集是每行一个AddThemeObjRequest通过json序列化后的字符串
838
- }
839
-
840
-
841
-
842
- message SyncThemeObjRequest{
843
- bytes appId = 1; //应用标志
844
- bytes themeAuthor = 2;//发布评论对象的作者pubkey
845
- bytes theme = 3; //主题
846
- }
847
-
848
-
849
-
850
-
851
-
852
- message SyncThemeObjReply{
853
- uint32 flag = 1;//处理结果
854
- bytes addThemReqRawData = 2; //用户添加评论对象的原始请求数据
855
- }
856
-
857
-
858
-
859
-
860
-
861
-
862
- message GetThemeCommentsRequest{
863
- bytes theme = 1; //主题CID
864
- bytes appId = 2; //应用标志
865
- bytes themeAuthor = 3;//发布评论对象的作者pubkey
866
- uint32 startHeight = 4; //开始的区块高度
867
- uint32 direction = 5;//遍历方向 0:正向 1:逆向
868
- uint32 offset = 6; //偏移量,以开始的区块高度的第一条记录开始计数
869
- uint32 limit = 7; //返回的记录条数,最多为100
870
- bytes seekKey = 8; //起始key,如果设置了seekKey,忽略startHeight (seekKey格式 blockheight/commentcid)
871
- bytes vaccount = 9 ; //虚拟账号,可选,如果有虚拟账号
872
- bytes aesKey = 10; //aes加密的key,返回的记录用这个key加密,如果不传,服务侧将用请求节点pubkey加密
873
- }
874
-
875
- message GetThemeCommentsReply{
876
- uint32 flag = 1;//获取结果
877
- bytes commentsCid = 2; //获取的评论列表结果集,存入ipfs网络中后反馈的cid,客户端再通过 getFile获取,结果集是PublishCommentToThemeRequest的数组 json序列化
878
- }
879
-
880
-
881
- message GetValuesWithIndexRequest{
882
- bytes theme = 1; //主题CID
883
- bytes appId = 2; //应用标志
884
- bytes themeAuthor = 3;//发布评论对象的作者pubkey
885
- uint32 startHeight = 4; //开始的区块高度
886
- uint32 direction = 5;//遍历方向 0:正向 1:逆向
887
- uint32 offset = 6; //偏移量,以开始的区块高度的第一条记录开始计数
888
- uint32 limit = 7; //返回的记录条数,最多为100
889
- bytes seekKey = 8; //起始key,如果设置了seekKey,忽略startHeight (seekKey格式 blockheight/commentcid)
890
- bytes indexKey = 9; //索引key
891
- bytes indexValue = 10; //索引值
892
- bytes vaccount = 11 ; //虚拟账号,可选,如果有虚拟账号
893
-
894
- }
895
-
896
-
897
- message GetValuesWithIndexReply{
898
- uint32 flag = 1;//获取结果
899
- bytes keyValues = 2; //获取的值,是个数组,[{key1:value1},{key2:value2}]
900
- }
901
-
902
- message GetThemeAuthListRequest{
903
- bytes theme = 1; //主题CID
904
- bytes appId = 2; //应用标志
905
- bytes themeAuthor = 3;//发布主题的作者pubkey
906
- uint32 startHeight = 4; //开始的区块高度
907
- uint32 direction = 5;//遍历方向 0:正向 1:逆向
908
- uint32 offset = 6; //偏移量,以开始的区块高度的第一条记录开始计数
909
- uint32 limit = 7; //返回的记录条数,最多为100
910
- bytes seekKey = 8; //起始key,如果设置了seekKey,忽略startHeight (seekKey格式 blockheight/commentcid)
911
- bytes vaccount = 9 ; //虚拟账号,可选,如果有虚拟账号
912
- }
913
-
914
- message GetThemeAuthListReply{
915
- uint32 flag = 1;//获取结果
916
- bytes authListCid = 2; //获取的授权列表结果集存入ipfs网络中后反馈的cid,客户端再通过 getFile获取,结果集是PublishCommentToThemeRequest的数组 json序列化
917
- }
918
-
919
-
920
- message GetUserThemeConfigInfoRequest {
921
- bytes theme = 1; //主题
922
- bytes appId = 2; //应用标志
923
- bytes themeAuthor = 3;//发布主题的的作者pubkey
924
- bytes UserPubkey = 4;//申请访问配置的用户pubkey
925
- bytes Vaccount = 5; //虚拟账号,可选,如果有虚拟账号
926
- }
927
-
928
- message GetUserThemeConfigInfoReply {
929
- uint32 flag = 1;//获取结果 0:成功 1:权限不足 2:获取失败
930
- bytes authInfo = 2; //获取的配置结果,返回请求用户的授权信息,userpubkey:permission:remark(remark可选,存放应用自定义的任何信息),userpubkey为用户的公钥16进制表示(all为特殊情况),permission为用户的权限,remark为备注信息,应用自定义
931
- }
932
-
933
- message GetUserCommentsRequest{
934
- bytes appId = 1; //应用标志
935
- bytes UserPubkey = 2;//发布评论的用户pubkey
936
- uint32 startHeight = 3; //开始的区块高度
937
- uint32 direction = 4;//遍历方向 0:正向 1:逆向
938
- uint32 offset = 5; //偏移量,以开始的区块高度的第一条记录开始计数
939
- uint32 limit = 6; //返回的记录条数,最多为1000
940
- bytes seekKey = 7; //起始key,如果设置了seekKey,忽略startHeight (seekKey格式 objcid/blockheight/commentcid)
941
- bytes vaccount = 8 ; //虚拟账号,可选,如果有虚拟账号
942
- bytes aesKey = 9; //aes加密的key,返回的记录用这个key加密,如果不传,服务侧将用请求节点pubkey加密
943
- }
944
-
945
- message GetUserCommentsReply{
946
- uint32 flag = 1;//获取结果
947
- bytes commentsCid = 2; //获取的评论列表结果集,存入ipfs网络中后反馈的cid,客户端再通过 getFile获取,结果集是PublishCommentToThemeRequest的数组 json序列化
948
- }
949
-
950
-
951
- message GetValueWithKeyRequest{
952
- bytes theme = 1; //主题CID
953
- bytes appId = 2; //应用标志
954
- bytes themeAuthor = 3;//发布评论对象的作者pubkey
955
- bytes UserPubkey = 4;//对应用户pubkey命名空间
956
- bytes Key = 5; //要获取的key
957
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
958
- }
959
-
960
- message GetValueWithKeyReply{
961
- uint32 flag = 1;//获取结果
962
- bytes value = 2; //获取的值
963
- }
964
-
965
- message GetValuesWithKeysRequest{
966
- bytes theme = 1; //主题CID
967
- bytes appId = 2; //应用标志
968
- bytes themeAuthor = 3;//发布评论对象的作者pubkey
969
- bytes UserPubkey = 4;//对应用户pubkey命名空间
970
- bytes Keys = 5; //要获取的key列表,最多100个,逗号分隔
971
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
972
- }
973
-
974
- message GetValuesWithKeysReply{
975
- uint32 flag = 1;//获取结果
976
- bytes keyValues = 2; //获取的值,是个数组,[{key1:value1},{key2:value2}]
977
- }
978
-
979
-
980
- message PushThemeFunOptRequest{
981
- CommentFunOpt opt = 1;
982
- }
983
-
984
- message PushThemeFunOptReply{
985
- }
986
-
987
-
988
- message PullCommentFunOptsRequest{
989
- bytes userPubkey = 1; //用户pubkey
990
- uint32 limit = 2; //获取的记录数量限制
991
- repeated peerSeqno seqs = 3; //对应在各节点的起始序号
992
-
993
- }
994
-
995
- message peerSeqno {
996
- bytes peerid =1; //对应的peerid
997
- uint64 seqno = 2; //拉取操作对应peerid的起始操作序列号
998
-
999
- }
1000
-
1001
- message PullCommentFunOptsReply{
1002
- uint32 flag = 1;//获取结果 0:成功 1:失败 2:需要重新初始化(出现节点 seqno 不连贯)
1003
- bytes funcOptsCid = 2; //获取的评论相关操作的结果集,存入ipfs网络中后反馈的cid,再通过 getFile获取,结果集是CommentFunOpt的数组 json序列化
1004
- }
1005
-
1006
- message CommentFunOpt {
1007
- bytes userPubkey = 1; //用户pubkey
1008
- uint64 seqno = 2; //对应节点上的操作序号
1009
- bytes peerid = 3; //对应的节点ID
1010
- uint32 opType = 4; //操作类型:0:配置评论空间 1:开通对象评论功能 2:关闭对象评论功能 3:给开通评论功能的对象增加空间 4:为评论对象添加评论 5:为评论对象删除评论 6、用户添加本地评论 7、用户删除本地评论
1011
- bytes opReq = 5;//具体操作请求
1012
- }
1013
-
1014
-
1015
- message ExchangeThemeEdgesRequest{
1016
- repeated UserCommentSeqEdge userSeqEdges = 1;
1017
- }
1018
-
1019
- message ExchangeThemeEdgesReply{
1020
- repeated UserCommentSeqEdge userSeqEdges = 1;
1021
- }
1022
-
1023
-
1024
- message UserCommentSeqEdge {
1025
- bytes userPubkey = 1 ;
1026
- uint64 seqedge = 2;
1027
- }
1028
-
1029
-
1030
- message DownloadUserCommentsRequest{
1031
- bytes userPubkey = 1;//对应的用户
1032
- uint32 blockheight = 2; //发起请求时的blockheight
1033
- bytes teereport = 4;//tee请求包,reportdata:发起评论下载请求的节点私钥签名 sign(userPubkey+blockheight)
1034
- }
1035
-
1036
-
1037
- message DownloadUserCommentsReply{
1038
- uint32 flag = 1; //0:成功 1:评论空间没有配置
1039
- }
1040
-
1041
-
1042
-
1043
-
1044
- message UserCommentsDownloadReadyRequest{
1045
- bytes userPubkey = 1;//针对的用户相关
1046
- bytes commentsCid = 2; //所有用户评论相关数据内容记录的集合的cid
1047
- uint32 blockheight = 3; //发起请求时的blockheight
1048
- bytes teereport = 4;//tee请求包,reportdata:请求的节点私钥签名 sign(userPubkey+commentsCid+blockheight)
1049
- }
1050
-
1051
-
1052
- message UserCommentsDownloadReadyReply{
1053
- }
1054
-
1055
-
1056
- message DeviceStatusReportRequest{
1057
- uint32 seqno = 1;//状态序号,不重复
1058
- bytes deviceID = 2; //设备ID
1059
- bytes theme = 3; //状态收集主题对象
1060
- bytes appId = 4; //应用标志
1061
- bytes themeAuthor = 5;//发布主题的的作者pubkey
1062
- bytes userPubkey = 6; //发布评论的用户
1063
- uint32 type = 7; //状态类型 0:设备状态 1:设备事件 2:设备告警 3:设备故障 4:指令执行
1064
- bytes contentHash = 8; //状态数据的hash(接收节点需要校验contentHash与content是否一致)
1065
- bytes content = 9; //状态数据,应用自定义,长度最多不超过10k
1066
- uint32 contentSize = 10; //数据大小
1067
- uint32 blockheight = 11; //发起请求时的blockheight
1068
- bytes groups = 12; //设备的分组,逗分隔
1069
- bytes signature = 13;// 发送设备的签名 sign(deviceID+theme+appId+seqno+themeAuthor+type+contentCid+groups+blockheight)
1070
- bytes rawReq = 14; //原始请求数据
1071
- uint32 resendcount = 15; //重发次数 客户端不用处理
1072
- }
1073
-
1074
- message DeviceStatusReportReply{
1075
- uint32 flag = 1; //0:成功 1:链下空间没有配置
1076
- }
1077
-
1078
- message GetThemeDevicesStatusRequest{
1079
- bytes theme = 1; //状态汇聚主题
1080
- bytes appId = 2; //应用标志
1081
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1082
- uint32 direction = 4;//遍历方向 0:正向 1:逆向
1083
- uint32 offset = 5; //偏移量,以开始的区块高度的第一条记录开始计数
1084
- uint32 limit = 6; //返回的记录条数,最多为1000
1085
- bytes seekKey = 7; //起始key,如果设置了seekKey,忽略seqno (seekKey格式 deviceid/appid)
1086
- bytes groups = 8; //设备的分组,逗分隔
1087
- }
1088
-
1089
- message GetThemeDevicesStatusReply{
1090
- uint32 flag = 1;//获取结果
1091
- bytes statuslistCid = 2; //获取的状态列表结果集,存入ipfs网络中后反馈的cid,客户端再通过 getFile获取,结果集是DeviceStatusReportRequest的数组 json序列化
1092
- }
1093
-
1094
-
1095
- message GetDeviceAuthRequest{
1096
- bytes theme = 1; //状态汇聚主题
1097
- bytes appId = 2; //应用标志
1098
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1099
- }
1100
-
1101
- message GetDeviceAuthReply{
1102
- uint32 flag = 1;//获取结果 0:成功 1:主题不存在 2:其他失败
1103
- uint32 blockheight =2;
1104
- bytes authGroups = 3; //授权给请求用户的设备的分组权限,逗号分隔
1105
- bytes signature = 4; //取得的授权签名,由接收请求方的节点签发(签名内容:theme+appId+themeAuthor+reqUser+groupspermission+blockheight)
1106
- }
1107
-
1108
-
1109
- message GetDeviceStatusListRequest{
1110
- bytes theme = 1; //状态汇聚对象CID
1111
- bytes appId = 2; //应用标志
1112
- bytes deviceId = 3; //设备ID
1113
- bytes themeAuthor = 4;//发布状态汇聚对象的的pubkey
1114
- bytes UserPubkey = 5;//发布评论的用户pubkey
1115
- uint32 seqno = 6; //开始的序号
1116
- uint32 startHeight = 7; //开始的区块高度
1117
- uint32 direction = 8;//遍历方向 0:正向 1:逆向
1118
- uint32 offset = 9; //偏移量,以开始的区块高度的第一条记录开始计数
1119
- uint32 limit = 10; //返回的记录条数,最多为1000
1120
- bytes seekKey = 11; //起始key,如果设置了seekKey,忽略seqno (seekKey格式 blockheight/commentcid)
1121
- bytes authgroupspermission = 12; //授权给请求用户的设备的分组权限,逗号分隔
1122
- uint32 authBlockheight = 13; //授权时的区块高度
1123
- bytes authPeerid = 14; //授权的节点peerid
1124
- bytes authSignature = 15; //授权的节点签名
1125
- bytes aesKey = 16; //aes加密的key,返回的记录用这个key加密,如果不传,服务侧将用请求节点pubkey加密
1126
- }
1127
-
1128
-
1129
- message GetDeviceStatusListReply{
1130
- uint32 flag = 1;//获取结果 0:成功 1:权限不足 2:获取失败
1131
- bytes statuslistCid = 2; //获取的状态列表结果集,存入ipfs网络中后反馈的cid,客户端再通过 getFile获取,结果集是DeviceStatusReportRequest的数组 json序列化
1132
- }
1133
-
1134
-
1135
- message ReEncryptFileRequest{
1136
- bytes cid = 1; //要重新加密的文件的cid
1137
- bytes encDecryptKey = 2; //用接收节点加密后原始文件的解密key
1138
- bytes encSecretkey = 3; //用接收节点加密后的加密key(用于重新加密文件)
1139
- uint32 blockheight = 4; //发起请求时的blockheight
1140
- bytes signature = 5;// 发送设备的签名 sign(cid+encDecryptKey+encSecketkey+blockheight)
1141
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
1142
- }
1143
-
1144
- message ReEncryptFileReply{
1145
- bytes cid = 1; //重新加密后的文件的cid
1146
- uint64 fileSize = 2; //重新加密后的文件的大小
1147
- }
1148
-
1149
- message RequestRandDataRequest{
1150
- bytes userPubkey = 1; //申请随机数的用户pubkey
1151
- uint32 blockheight = 2; //发起请求时的blockheight
1152
- bytes extradata = 3 ; //附加数据
1153
- bytes signature = 5;// 发送设备的签名 sign(userPubkey+blockheight+extradata)
1154
- }
1155
-
1156
- message RequestRandDataReply{
1157
- bytes userPubkey = 1; //申请随机数的用户pubkey
1158
- bytes randdata = 2; //获取的随机数,32字节
1159
- uint32 blockheight = 3; //发起请求时的blockheight
1160
- bytes extradata = 4 ; //附加数据(与请求时的一致)
1161
- bytes signature = 5;// 发送设备的签名 sign(userpubkey+randdata+extradata+blockheight)
1162
- }
1163
-
1164
-
1165
- message DeductUserOffChainOpTimesRequest {
1166
- bytes userPubkey = 1;
1167
- uint32 blockheight = 2; //发送请求时的区块高度
1168
- uint32 deductType = 3; //扣除的类型 1:文件转存 其他的后续定义
1169
- bytes rawReq = 4 ; // 用户发起的原始请求数据
1170
- }
1171
-
1172
- message DeductUserOffChainOpTimesReply {
1173
- uint32 flag = 1; //0:成功 1:链下操作次数不足 2:其他失败
1174
- }
1175
-
1176
- message DeductUserAIProxyOpTimesRequest {
1177
- bytes userPubkey = 1;
1178
- bytes appId = 2; //应用标志
1179
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1180
- bytes theme = 4; //状态汇聚对象
1181
- }
1182
-
1183
- message DeductUserAIProxyOpTimesReply {
1184
- uint32 flag = 1; //0:成功 1:操作次数不足 2:其他失败
1185
- }
1186
-
1187
-
1188
-
1189
- message GetAIProxyConfigFromPeerRequest {
1190
- bytes theme = 1; //状态汇聚对象CID
1191
- bytes appId = 2; //应用标志
1192
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1193
- bytes UserPubkey = 4;//申请访问配置的用户pubkey
1194
- bytes edges = 5; //theme的边缘信息,如果一致,则不需要重新获取配置
1195
- }
1196
-
1197
- message GetAIProxyConfigFromPeerReply {
1198
- uint32 flag = 1;//获取结果 0:成功 1:权限不足 2:获取失败
1199
- bytes configInfo = 2; //获取的配置结果集,第一行用户权限,后面每行一个mcp服务工具配置信息或者AI模型配置信息
1200
- bytes edges = 3; //当前主题的边缘信息,如果一致,则不需要重新获取配置
1201
-
1202
- }
1203
-
1204
-
1205
- message GetAIProxyConfigRequest {
1206
- bytes theme = 1; //状态汇聚对象CID
1207
- bytes appId = 2; //应用标志
1208
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1209
- }
1210
-
1211
- message GetAIProxyConfigReply {
1212
- uint32 flag = 1;//获取结果 0:成功 1:权限不足 2:获取失败
1213
- bytes proxyConfigCid = 2; //获取的配置结果集,存入ipfs网络中后反馈的cid,客户端再通过 getFile获取,包括了配置列表和所有用户的授权信息
1214
- bytes aeskey = 3; //配置信息的aes加密key
1215
- }
1216
-
1217
- message GetUserOwnAIProxyAuthRequest {
1218
- bytes theme = 1; //状态汇聚对象CID
1219
- bytes appId = 2; //应用标志
1220
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1221
- }
1222
-
1223
- message GetUserOwnAIProxyAuthReply {
1224
- uint32 flag = 1;//获取结果 0:成功 1:权限不足 2:获取失败
1225
- bytes authInfo = 2; //获取的配置结果,返回请求用户的授权信息
1226
- bytes configs = 3; //获取的配置结果,返回请求用户的配置列表
1227
- }
1228
-
1229
-
1230
-
1231
- message DoAIProxyCallRequest {
1232
- bytes theme = 1; //状态汇聚对象CID
1233
- bytes appId = 2; //应用标志
1234
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1235
- uint32 blockheight = 4; //发起请求时的blockheight
1236
- bytes configKey = 5;// 配置名称
1237
- bytes path = 6;//请求路径
1238
- bytes reqBody = 7;//请求数据,当为模型调用时json格式如下:[{Role: "user",Content: [{ Type: "text", Text: "你好" }]},{Role: "assistant",Content: [{ "Type": "image","Source": {"Type": "base64","MediaType": "image/jpeg","Data": "iV..."}]}]
1239
- bytes modelConfig = 8; //模型调用时起作用{"provider": "anthropic", "model": "claude-3-opus-20240229","temperature": 0.7,"maxTokens": 1000, "topP": 0.9,"topK": 40,"stopSequences": ["Human:", "Assistant:"],"systemPrompt": "你是一个专业的图片分析助手...","applySystemPrompt": true,"stream": false,tools: [{"name": "image_analysis","description": "分析图片内容并给出建议","parameters": {"type": "object","properties": {"image_url": {"type": "string","description": "图片的url地址"}}}}]}
1240
- uint32 forceRefresh = 9; //强制刷新AI配置, 0:不刷新 1:刷新,如果为1,则扣除10倍的链下操作次数
1241
- bytes headers = 10; //请求头,当调用为mcp tool调用时,需要传入请求头
1242
- bytes signature = 11;
1243
- }
1244
-
1245
-
1246
-
1247
-
1248
- message DoAIProxyCallReply{
1249
- uint32 flag = 1; //0:成功 1:权限不足 2:获取失败 3:关闭连接
1250
- bytes content = 2; //返回的消息
1251
- bytes err =3; //返回的错误信息
1252
-
1253
- }
1254
-
1255
-
1256
- message CreateAIProxyCallTaskRequest {
1257
- bytes theme = 1; //状态汇聚对象CID
1258
- bytes appId = 2; //应用标志
1259
- bytes themeAuthor = 3;//发布状态汇聚对象的的pubkey
1260
- uint32 blockheight = 4; //发起请求时的blockheight
1261
- bytes configKey = 5;// 配置名称
1262
- bytes path = 6;//请求路径
1263
- bytes reqBody = 7;//请求数据,当为模型调用时json格式如下:[{Role: "user",Content: [{ Type: "text", Text: "你好" }]},{Role: "assistant",Content: [{ "Type": "image","Source": {"Type": "base64","MediaType": "image/jpeg","Data": "iV..."}]}]
1264
- bytes continueReqs = 8; //在一次请求技术后,继续发起的请求列表,格式如下:[[{Role: "user",Content: [{ Type: "text", Text: "你好" }]},{Role: "system",Content: [{ "Type": "text","Text": "继续输出"}]}]],如果是模型调用,则是模型的继续请求,如果是mcp tool调用,则是mcp tool的继续请求
1265
- bytes modelConfig = 9; //模型调用时起作用{"provider": "anthropic", "model": "claude-3-opus-20240229","temperature": 0.7,"maxTokens": 1000, "topP": 0.9,"topK": 40,"stopSequences": ["Human:", "Assistant:"],"systemPrompt": "你是一个专业的图片分析助手...","applySystemPrompt": true,"stream": false,tools: [{"name": "image_analysis","description": "分析图片内容并给出建议","parameters": {"type": "object","properties": {"image_url": {"type": "string","description": "图片的url地址"}}}}]}
1266
- uint32 forceRefresh = 10; //强制刷新AI配置, 0:不刷新 1:刷新,如果为1,则扣除10倍的链下操作次数
1267
- bytes headers = 11; //请求头,当调用为mcp tool调用时,需要传入请求头
1268
- bytes signature = 12;
1269
- }
1270
-
1271
- message CreateAIProxyCallTaskReply{
1272
- uint32 flag = 1; //0:成功 1:权限不足 2:获取失败 3:关闭连接 4:还有未完成的任务
1273
- bytes taskId = 2; //返回的任务ID,当flag为4时,返回未完成的任务ID
1274
- }
1275
-
1276
-
1277
- message GetAIProxyCallTaskResultRequest {
1278
- bytes taskId = 1; //任务ID
1279
- }
1280
-
1281
- message GetAIProxyCallTaskResultReply{
1282
- uint32 flag = 1; //0:成功 1:权限不足 2:获取失败 3:关闭连接 5:任务不存在 6:任务未完成
1283
- bytes content = 2; //返回的消息
1284
- bytes err =3; //返回的错误信息
1285
- }
1286
-
1287
-
1288
- message ArchiveDeviceStatusRequest{
1289
- bytes deviceID = 1; //设备ID
1290
- bytes themeAuthor = 2;//发布状态汇聚对象的的pubkey
1291
- bytes theme = 3; //状态收集主题
1292
- bytes appId = 4; //应用标志
1293
- uint32 startSeqno = 5; //归档的状态数据起始序号
1294
- uint32 endSeqno = 6; //归档的状态数据结束序号
1295
- uint32 blockheight = 7; //发起请求时的blockheight
1296
- bytes encSecretkey = 8; //用接收节点加密后的加密key(用于加密状态数据)
1297
- bytes signature = 9;// 发送设备的签名 sign(deviceID+themeAuthor+theme+appId+startSeqno+endSeqno+blockheight+encSecketkey)
1298
-
1299
- }
1300
-
1301
- message ArchiveDeviceStatusReply{
1302
- uint32 flag = 1;//获取结果 0:成功 1:非状态备份节点 2:链下操作次数不足
1303
- bytes statusCid = 2; //状态数据归档后的cid
1304
- uint32 statusCount = 3; //归档的状态数据数量
1305
- uint64 statusSize = 4; //归档的状态数据大小
1306
- uint32 blockheight = 5;
1307
- bytes signature = 6;// 发送设备的签名 sign(flag+statusCid+statusCount+statusSize+blockheight)
1308
- }
1309
-
1310
-
1311
-
1312
- message AddUserOffChainOpTimesRequest{
1313
- bytes userPubkey = 1;
1314
- uint32 blockheight = 2; //发送请求时的区块高度
1315
- bytes peerid = 3; //允许发起上链请求的peerid
1316
- uint32 times = 4; //增加的操作次数
1317
- bytes signature = 5 ; //发送者私钥对(blockheight+peerid+times)的签名
1318
- bytes vaccount = 6 ; //虚拟账号,可选,如果有虚拟账号
1319
- }
1320
-
1321
- message AddUserOffChainOpTimesReply{
1322
- uint32 flag = 1; //0:成功 1:空间不足 2:其他失败
1323
- }
1324
-
1325
- message GetUserOffChainOpTimesRequest{
1326
- bytes userPubkey = 1;
1327
- }
1328
-
1329
- message GetUserOffChainOpTimesReply{
1330
- uint32 usedtimes = 1; //用户已经使用的链下操作次数
1331
- }
1332
-
1333
- message GetUserOffChainUsedInfoRequest{
1334
- bytes vaccount = 1; //关联的虚拟账号,可选
1335
- }
1336
-
1337
-
1338
- message GetUserOffChainUsedInfoReply{
1339
- uint32 usedtimes = 1; //用户已经使用的链下操作次数
1340
- uint64 usedspace =2; //用户已经使用的链下操作空间
1341
- }
1342
-
1343
-
1344
-
1345
-
1346
- message SetAppInfoRequest {
1347
- bytes appId = 1; //要设置的应用id
1348
- bytes ownerAccount = 2; //要设置的应用的所有者账号,如果不是应用所有者,表示转让
1349
- bytes rewardAccount =3;//奖励发放账号
1350
- bytes domain = 4; //应用的域名,多个域名以逗号分隔
1351
- uint32 blockheight = 5;//设置时的区块高度
1352
- bytes peerid = 6; //允许发起上链请求的peerid
1353
- bytes fid = 7; //appId 对应的文件cid
1354
- bytes signature = 8;//sign(appId+ownerAccount+rewardAccount+domain+blockheight+fid+peerid)
1355
- }
1356
-
1357
- message SetAppInfoReply {
1358
- }
1359
-
1360
-
1361
-
1362
- // Service is the peer-to-peer network API for thread orchestration.
1363
- service Service {
1364
- //AddThread to a peer
1365
- rpc StoreThreadToPeer(StoreThreadRequest) returns (StoreThreadReply) {}//ok
1366
- // StoreFile to a peer
1367
- rpc StoreFileToPeer(StroeFileToPeerRequest) returns (StroeFileToPeerReply) {} //ok
1368
- rpc AccountBindBackup(AccountDealBackupRequest) returns (AccountDealBackupReply){} //ok申请账号绑定(账号和用户pubkey进行绑定,允许用户用账号密码登录)
1369
- rpc AccountInfoModifyBackup(AccountDealBackupRequest) returns (AccountDealBackupReply){} //ok修改账号信息
1370
- //节点间在线状态检查
1371
- rpc OnlineStatusCheck(OnlineStatusCheckRequest) returns (OnlineStatusCheckReply) {} //
1372
- //申请协助teereport验证
1373
- rpc TeeReportVerify(TeeReportVerifyRequest) returns (TeeReportVerifyReply) {}
1374
- //请求协助确认指定节点是否在线
1375
- rpc CheckPeerStatus(stream CheckPeerStatusRequest) returns (stream CheckPeerStatusReply){}//
1376
- //请求节点检查本地文件是否存在(要求对方已teereport方式返回)
1377
- rpc LocalFileCheck(LocalFileCheckRequest) returns (LocalFileCheckReply) {} //ok
1378
- //获取指定文件的存储节点列表(防止本地数据未及时同步,借助其他节点链数据进行综合判断)
1379
- rpc GetPeersWithSid(GetPeersWithSidRequest) returns (GetPeersWithSidReply) {} //ok
1380
- //获取指定nft账号信息的存储节点列表(防止本地数据未及时同步,借助其他节点链数据进行综合判断)
1381
- rpc GetPeersWithAccountHash(GetPeersWithAccountHashRequest) returns (GetPeersWithAccountHashReply) {} //ok
1382
- //请求节点检查本地对应账号信息是否存在(要求对方以teereport方式返回)
1383
- rpc LocalAccountInfoCheck(LocalAccountInfoCheckRequest) returns (LocalAccountInfoCheckReply) {} //ok
1384
- ////发送申请从远端节点同步备份账号登录信息的请求
1385
- rpc AccountInfoSync(AccountInfoSyncRequest) returns (AccountInfoSyncReply) {} //ok
1386
-
1387
- //扫码登录相关接口
1388
- // 设置扫码后需要设置的加密后的私钥信息,每个用户一台设备上只保留最新的一条记录
1389
- rpc SetEncryptKeyWithScan(SetEncryptKeyWithScanRequest) returns (SetEncryptKeyWithScanReply) {} //ok
1390
- // 获取加密后的私钥信息,由被扫码的应用定期调用
1391
- rpc GetEncryptKeyWithScan(GetEncryptKeyWithScanRequest) returns (GetEncryptKeyWithScanReply) {} //ok
1392
-
1393
-
1394
- //升级过程调用接口
1395
- //申请随机加密密码
1396
- rpc RequestRandEncryptKey(RequestRandEncryptKeyRequest) returns (RequestRandEncryptKeyReply){}
1397
- //获取指定key的随机加密密码
1398
- rpc GetEncryptKey(GetEncryptKeyRequest) returns (GetEncryptKeyReply){}
1399
-
1400
- //供sdk调用的接口定义
1401
- rpc ReportLocalMultilAddr(ReportLocalMultilAddrRequest) returns (ReportLocalMultilAddrReply) {} //上报终端的局域网内节点地址
1402
- rpc GetHostID(GetHostIDRequest) returns (GetHostIDReply) {}//ok//获取当前访问的节点ID
1403
- rpc GetToken(stream GetTokenRequest) returns (stream GetTokenReply) {}//ok //申请当前访问节点的token
1404
- rpc CreateThread(CreateThreadRequest) returns (ThreadInfoReply) {}//ok 创建threaddb
1405
- rpc RequestThreadID(ThreadIDRequest) returns (ThreadIDReply) {}//ok 申请threaddb id
1406
- //建立logid与thread ID的绑定关系 //ok
1407
- rpc AddLogToThread(AddLogToThreadRequest) returns (AddLogToThreadReply) {}
1408
- // 获取指定threaddb的已使用空间大小
1409
- rpc GetThreadUsedSpace(GetThreadUsedSpaceRequest) returns (GetThreadUsedSpaceReply){}
1410
- rpc AddThreadToPeer(AddThreadToPeerRequest) returns (stream AddThreadToPeerReply) {}//ok 添加threaddb 到对应节
1411
- rpc GetThread(GetThreadRequest) returns (ThreadInfoReply) {}//ok 获取指定threaddb的相关信息
1412
- rpc DeleteThread(DeleteThreadRequest) returns (DeleteThreadReply) {}//ok 删除threaddb
1413
- // 为指定的threaddb添加可用空间
1414
- rpc AddThreadSpace(AddThreadSpaceRequest) returns(AddThreadSpaceReply) {}
1415
- rpc StoreFile(StroeFileRequest) returns (stream StroeFileReply) {} //ok //存储文件
1416
- rpc StoreFolder(StoreFolderRequest) returns (stream StoreFolderReply){} //存储文件夹
1417
-
1418
- rpc DeleteFile(DeleteFileRequest) returns (DeleteFileReply) {}//ok //删除文件或文件夹
1419
- rpc AccountBind(AccountDealRequest) returns (AccountDealReply){} //ok 申请账号绑定(账号和用户pubkey进行绑定,允许用户用账号密码登录)操作者消耗存储有效期
1420
- rpc AccountInfoModify(AccountDealRequest) returns (AccountDealReply){} //ok 修改账号信息,要同时修改loginkey,pubkey,prikeyencrypt以及时间戳),操作者消耗存储有效期
1421
- rpc AccountLogin(AccountLoginRequest) returns (AccountLoginReply){}//ok 用户登录
1422
- rpc TransferAccount(TransferAccountRequest) returns(TransferAccountReply){} //ok账号转让,将自身绑定的账号转给另外一个用户(需要修改区块链中accounthash对应的pubkey值,以及将pubkey对应的accounthash设置为空),每次操作会根据区块链忙碌情况,扣除用户一定时长的有效存储期限,越忙碌,扣除的就越多,建议闲时操作
1423
- //添加子账号,如果子账号在链上已经存在,则会创建失败 //ok
1424
- rpc AddSubPubkey(AddSubPubkeyRequest) returns (AddSubPubkeyReply) {}
1425
- //删除子账号 //ok
1426
- rpc DeleteSubPubkey(DeleteSubPubkeyRequest) returns (DeleteSubPubkeyReply) {}
1427
- // 将当前接入节点ID绑定给用户(如果用户已经绑定的节点超过了5个,本操作会消耗用户20m永久空间)
1428
- rpc BindAccessPeerToUser(BindAccessPeerToUserRequest) returns (BindAccessPeerToUserReply) {}
1429
- //设置用户默认个体库信息 //ok
1430
- rpc SetUserDefaultDB(SetUserDefaultDBRequest) returns (SetUserDefaultDBReply) {}//更新用户个体库信息(threadid|sk|rk)
1431
- //发送消息到用户的收件箱 //ok
1432
- rpc SendMsgToUserBox(SendMsgToUserBoxRequest) returns (SendMsgToUserBoxReply){}
1433
- //向备份了发送消息的用户账号信息的节点,获取发送消息到用户收件箱授权,每次授权会扣除1K的评论空间
1434
- rpc GetToUserBoxAuth(GetToUserBoxAuthRequest) returns (GetToUserBoxAuthReply){}
1435
- //获取用户收件箱的最大key //ok
1436
- rpc GetMaxKeyFromUserBox(GetMaxKeyFromUserBoxRequest) returns (GetMaxKeyFromUserBoxReply){}
1437
- //获取用户收件箱消息(只有用户本身才能获取消息) //ok
1438
- rpc GetMsgFromUserBox(GetMsgFromUserBoxRequest) returns (GetMsgFromUserBoxReply){}
1439
- //举报垃圾消息(举报过程中先判断链上针对该用户状态,如果已经被冻结则不再举报)
1440
- rpc ReportSpamMsg(ReportSpamMsgRequest) returns (ReportSpamMsgReply){}
1441
-
1442
- //token 是否有效验证,主要为了给流式访问接口确认token是否正常 //ok
1443
- rpc ValidToken(ValidTokenRequest) returns (ValidTokenReply) {}
1444
- //获取指定用户的客户端接入peerId //ok
1445
- rpc GetUserClientPeers(GetUserClientPeersRequest) returns (GetUserClientPeersReply){}
1446
-
1447
- // 设置缓存及中转key接口,主要为用户缓存一些公共的可供其他人查询的数据,每次操作扣减1M空间,value+key的大小最多为100k
1448
- rpc SetCacheKey(SetCacheKeyRequest) returns (SetCacheKeyReply){}
1449
- // 获取缓存key接口
1450
- rpc GetCacheValue(GetCacheValueRequest) returns(GetCacheValueReply){}
1451
-
1452
-
1453
- //主题相关接口
1454
- //为指定对象开通评论功能 //ok
1455
- rpc AddThemeObj(AddThemeObjRequest) returns (AddThemeObjReply){}
1456
-
1457
- //为已开通评论对象增加评论空间//ok
1458
- rpc AddThemeSpace(AddThemeSpaceRequest) returns (AddThemeSpaceReply){}
1459
-
1460
- //获取指定对象的剩余可用评论空间//ok
1461
- rpc GetThemeSpace(GetThemeSpaceRequest) returns (GetThemeSpaceReply){}
1462
-
1463
-
1464
- //删除一个已开通评论对象//ok
1465
- rpc DeleteThemeObj(DeleteThemeObjRequest) returns (DeleteThemeObjReply){}
1466
-
1467
- //开通评论对象用户举报评论对象下的某条恶意评论//ok
1468
- rpc ReportMaliciousComment(ReportMaliciousCommentRequest) returns (ReportMaliciousCommentReply){}
1469
-
1470
- //开通评论对象用户将某一条评论精选可见//ok
1471
- rpc SetObjCommentPublic(SetObjCommentPublicRequest) returns (SetObjCommentPublicReply){}
1472
- //用户添加对外评论的空间(当用户需要使用评论功能时,需要先调用本接口预分配评论区空间,否则无法进行评论,当评论空间满时,需要继续调用本接口,每次操作会根据区块链忙碌情况,扣除用户一定时长的有效存储期限,越忙碌,扣除的就越多,建议闲时操作)//ok
1473
- rpc AddUserOffChainSpace(AddUserOffChainSpaceRequest) returns (AddUserOffChainSpaceReply){}
1474
-
1475
- //用户对评论对象发表评论//ok
1476
- rpc PublishCommentToTheme(PublishCommentToThemeRequest) returns (PublishCommentToThemeReply){}
1477
-
1478
- //评论主题对象权限配置//ok
1479
- rpc ConfigThemeObjAuth(ConfigThemeObjAuthRequest) returns (ConfigThemeObjAuthReply){}
1480
-
1481
- //keyvalue设置
1482
- rpc SetKeyValue(SetKeyValueRequest) returns (SetKeyValueReply){}
1483
-
1484
- //用户删除自身的某条评论(请求发往发表评论用户自身备份账号信息的节点)//ok
1485
- rpc DeleteSelfComment(DeleteSelfCommentRequest) returns (DeleteSelfCommentReply){}
1486
-
1487
- //用户删除已开通评论对象下的用户发表的某条评论(请求发往发表主题所在节点)//ok
1488
- rpc DeleteCommentToObj(DeleteCommentToObjRequest) returns (DeleteCommentToObjReply){}
1489
-
1490
- //检查指定主题对象是否存在
1491
- rpc IsThemeExist(IsThemeExistRequest) returns (IsThemeExistReply) {}
1492
-
1493
-
1494
- //获取已开通评论的对象列表//ok
1495
- rpc GetThemeObj(GetThemeObjRequest) returns (GetThemeObjReply){}
1496
-
1497
- //获取指定已开通对象的评论列表//ok
1498
- rpc GetThemeComments(GetThemeCommentsRequest) returns (GetThemeCommentsReply){}
1499
-
1500
-
1501
- //获取用户主题配置的相关信息,包括用户的权限等
1502
- rpc GetUserThemeConfigInfo(GetUserThemeConfigInfoRequest) returns (GetUserThemeConfigInfoReply) {}
1503
-
1504
-
1505
- //获取指定已开通对象的权限列表(对GetThemeComments进行包装,增加权限判断)//ok
1506
- rpc GetThemeAuthList(GetThemeAuthListRequest) returns (GetThemeAuthListReply){}
1507
-
1508
- //获取用户所有已经发布的评论//ok
1509
- rpc GetUserComments(GetUserCommentsRequest) returns (GetUserCommentsReply){}
1510
-
1511
- //获取指定key的值//ok
1512
- rpc GetValueWithKey(GetValueWithKeyRequest) returns (GetValueWithKeyReply){}
1513
-
1514
- //批量获取key的值,返回对象列表//ok
1515
- rpc GetValuesWithKeys(GetValuesWithKeysRequest) returns (GetValuesWithKeysReply){}
1516
-
1517
- //根据索引获取对应key的值//ok
1518
- rpc GetValuesWithIndex(GetValuesWithIndexRequest) returns (GetValuesWithIndexReply){}
1519
-
1520
-
1521
- //评论相关节点间同步接口
1522
- //将用户的评论发送到对应的节点(放置了开放评论对象的DC节点)//ok
1523
- rpc SendCommentToPeer(PublishCommentToThemeRequest) returns (PublishCommentToThemeReply){}
1524
-
1525
- //推送评论功能相关的最新操作给其他节点//ok
1526
- rpc PushThemeFunOpt(PushThemeFunOptRequest) returns (PushThemeFunOptReply){}
1527
-
1528
-
1529
- //从其他节点拉取最新指令操作到本地//ok
1530
- rpc PullCommentFunOpts(PullCommentFunOptsRequest) returns (PullCommentFunOptsReply){}
1531
-
1532
- //评论相关数据节点间交换//ok
1533
- rpc ExchangeThemeEdges(ExchangeThemeEdgesRequest) returns (ExchangeThemeEdgesReply){}
1534
-
1535
- //请求下载用户所有评论相关数据,如果被请求准备完成数据,通过UserCommentsDownloadReady通知发起请求的用户下载,本节点在请求节点初次处理用户评论相关数据。//ok
1536
- rpc DownloadUserComments(DownloadUserCommentsRequest) returns (DownloadUserCommentsReply){}
1537
-
1538
- //节点中用户评论相关数据打包完成通知//ok
1539
- rpc UserCommentsDownloadReady(UserCommentsDownloadReadyRequest) returns (UserCommentsDownloadReadyReply){}
1540
-
1541
-
1542
- // 从其他节点同步主题对象到本地
1543
- rpc SyncThemeObj(SyncThemeObjRequest) returns (SyncThemeObjReply) {}
1544
-
1545
- //物联网 管理平台需要最少建立三个主题,一个是上报主题管理(主要用来确定每个设备状态向哪个主题上报),一个是归档状态汇聚主题(由上报主题管理指定,多节点备份,后续分析使用),一个是设备状态主题(由上报主题管理指定,单接到备份,供查看实时状态使用)
1546
- //物联网设备状态上报接口,每个设备每次上报状态,只能保留最新的100000个状态,设备测应该每50000个状态打包成一个文件,然后上传到DC网络中,并将文件的CID等信息上报到汇聚主题所在的节点
1547
- rpc DeviceStatusReport(DeviceStatusReportRequest) returns (DeviceStatusReportReply) {}
1548
- // 归档设备状态,设备侧可以发送请求,将数据状态进行归档,数据归档后应该将归档数据的信息发送给汇聚主题所在的节点,这样汇聚主题所在的节点就可以获取到设备的历史状态
1549
- rpc ArchiveDeviceStatus(ArchiveDeviceStatusRequest) returns (ArchiveDeviceStatusReply) {}
1550
- // 将设备状态发送到汇聚主题所在的节点,汇聚主题所在的节点将保留每个设备的最新状态
1551
- rpc SendDeviceStatusToPeer(DeviceStatusReportRequest) returns (DeviceStatusReportReply) {}
1552
- // 获取指定汇聚主题的中设备列表的状态,只有汇聚主题所在的节点才能获取
1553
- rpc GetThemeDevicesStatus(GetThemeDevicesStatusRequest) returns (GetThemeDevicesStatusReply) {}
1554
- // 向指定汇聚主题的所所在的节点申请设备操作权限的授权(dcnode取出用户的权限信息,并进行签名,具体权限内容由应用自身确定),获取授权后,用户才可以进行对应操作,包括调用GetDeviceStatusList方法以及操控设备,授权时长1小时
1555
- rpc GetDeviceAuth(GetDeviceAuthRequest) returns (GetDeviceAuthReply) {}
1556
- // 获取指定设备的状态列表,只有从备份了在设备上登录的用户的节点才能获取,调用时需要先获取授权
1557
- rpc GetDeviceStatusList(GetDeviceStatusListRequest) returns (GetDeviceStatusListReply) {}
1558
- // 购买链下操作次数
1559
- rpc AddUserOffChainOpTimes(AddUserOffChainOpTimesRequest) returns (AddUserOffChainOpTimesReply) {}
1560
- // 获取指定用户的链下操作次数
1561
- rpc GetUserOffChainOpTimes(GetUserOffChainOpTimesRequest) returns (GetUserOffChainOpTimesReply) {}
1562
-
1563
- // 获取指定用户的链下数据使用信息,包括链下操作次数以及链下存储空间的信息
1564
- rpc GetUserOffChainUsedInfo(GetUserOffChainUsedInfoRequest) returns (GetUserOffChainUsedInfoReply) {}
1565
-
1566
- //文件功能补充(相当于用户不用取回文件,就能为文件用新密码加密,并返回新的CID,加密完成后,用户应该再次调用StoreFileTo接口,存储新加密完成的文件)
1567
- // 用新密码来加密文件,返回新加密后的文件CID
1568
- rpc ReEncryptFile(ReEncryptFileRequest) returns (ReEncryptFileReply) {}
1569
-
1570
- // 申请真随机数
1571
- rpc RequestRandData(RequestRandDataRequest) returns (RequestRandDataReply) {}
1572
-
1573
- // 申请AI模型或者MCPServer的访问权限
1574
- rpc GetAIProxyConfigFromPeer(GetAIProxyConfigFromPeerRequest) returns (GetAIProxyConfigFromPeerReply) {}
1575
-
1576
- //获取AI模型或者MCPServer代理的配置信息
1577
- rpc GetAIProxyConfig(GetAIProxyConfigRequest) returns (GetAIProxyConfigReply) {}
1578
-
1579
- //AI相关代理的调用,包括代理与AI的通信或者与MCPServer的通信
1580
- rpc DoAIProxyCall(DoAIProxyCallRequest) returns (stream DoAIProxyCallReply) {}
1581
-
1582
- //创建AI模型的调用任务,返回任务ID,任务ID可以用于后续获取任务结果
1583
- rpc CreateAIProxyCallTask(CreateAIProxyCallTaskRequest) returns (CreateAIProxyCallTaskReply) {}
1584
-
1585
- //获取AI模型的调用任务结果
1586
- rpc GetAIProxyCallTaskResult(GetAIProxyCallTaskResultRequest) returns (GetAIProxyCallTaskResultReply) {}
1587
-
1588
-
1589
- //GetUserOwnAIProxyConfig
1590
- rpc GetUserOwnAIProxyAuth(GetUserOwnAIProxyAuthRequest) returns (GetUserOwnAIProxyAuthReply) {}
1591
-
1592
- // 申请扣除用户的链下操作次数
1593
- rpc DeductUserOffChainOpTimes(DeductUserOffChainOpTimesRequest) returns (DeductUserOffChainOpTimesReply) {}
1594
-
1595
- //申请扣除用户的AI代理的操作次数
1596
- rpc DeductUserAIProxyOpTimes(DeductUserAIProxyOpTimesRequest) returns (DeductUserAIProxyOpTimesReply) {}
1597
-
1598
- /*************************应用设置相关接口*************************/
1599
- rpc SetAppInfo(SetAppInfoRequest) returns (SetAppInfoReply) {} //设置应用基本信息,发布应用或者更新发布信息时调用
1600
- }
1601
-