-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathschema.proto
1182 lines (977 loc) · 23.1 KB
/
schema.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright 2022 CodeNotary, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
syntax = "proto3";
// import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
// import "protoc-gen-swagger/options/annotations.proto";
import "google/protobuf/struct.proto";
package immudb.schema;
option go_package = "github.com/codenotary/immudb/pkg/api/schema";
message Key {
bytes key = 1;
}
message Permission {
string database = 1;
uint32 permission = 2;
}
message User {
bytes user = 1;
repeated Permission permissions = 3;
string createdby = 4;
string createdat = 5;
bool active = 6;
}
message UserList {
repeated User users = 1;
}
message CreateUserRequest {
bytes user = 1;
bytes password = 2;
uint32 permission = 3;
string database = 4;
}
message UserRequest {
bytes user = 1;
}
message ChangePasswordRequest {
bytes user = 1;
bytes oldPassword = 2;
bytes newPassword = 3;
}
message LoginRequest {
bytes user = 1;
bytes password = 2;
}
message LoginResponse {
string token = 1;
bytes warning = 2;
}
message AuthConfig {
uint32 kind = 1;
}
message MTLSConfig {
bool enabled = 1;
}
message OpenSessionRequest {
bytes username = 1;
bytes password = 2;
string databaseName = 3;
}
message OpenSessionResponse {
string sessionID = 1;
string serverUUID = 2;
}
////////////////////////////////////////////////////////
message Precondition {
message KeyMustExistPrecondition {
bytes key = 1;
}
message KeyMustNotExistPrecondition {
bytes key = 1;
}
message KeyNotModifiedAfterTXPrecondition {
bytes key = 1;
uint64 txID = 2;
}
oneof precondition {
KeyMustExistPrecondition keyMustExist = 1;
KeyMustNotExistPrecondition keyMustNotExist = 2;
KeyNotModifiedAfterTXPrecondition keyNotModifiedAfterTX = 3;
}
}
message KeyValue {
bytes key = 1;
bytes value = 2;
KVMetadata metadata = 3;
}
message Entry {
uint64 tx = 1;
bytes key = 2;
bytes value = 3;
Reference referencedBy = 4;
KVMetadata metadata = 5;
bool expired = 6;
uint64 revision = 7;
}
message Reference {
uint64 tx = 1;
bytes key = 2;
uint64 atTx = 3;
KVMetadata metadata = 4;
uint64 revision = 5;
}
message Op {
oneof operation {
KeyValue kv = 1;
ZAddRequest zAdd = 2;
ReferenceRequest ref = 3;
}
}
message ExecAllRequest {
repeated Op Operations = 1;
bool noWait = 2;
repeated Precondition preconditions = 3;
}
message Entries {
repeated Entry entries = 1;
}
message ZEntry {
bytes set = 1;
bytes key = 2;
Entry entry = 3;
double score = 4;
uint64 atTx = 5;
}
message ZEntries {
repeated ZEntry entries = 1;
}
message ScanRequest {
bytes seekKey = 1;
bytes endKey = 7;
bytes prefix = 2;
bool desc = 3;
uint64 limit = 4;
uint64 sinceTx = 5;
bool noWait = 6;
bool inclusiveSeek = 8; // If set to true, results will include seekKey
bool inclusiveEnd = 9; // If set to true, results will include endKey if needed
}
message KeyPrefix {
bytes prefix = 1;
}
message EntryCount {
uint64 count = 1;
}
///////////////
message Signature {
bytes publicKey = 1;
bytes signature = 2;
}
message TxHeader {
uint64 id = 1;
bytes prevAlh = 2;
int64 ts = 3;
int32 nentries = 4;
bytes eH = 5;
uint64 blTxId = 6;
bytes blRoot = 7;
int32 version = 8;
TxMetadata metadata = 9;
}
message TxMetadata {
}
message LinearProof {
uint64 sourceTxId = 1;
uint64 TargetTxId = 2;
repeated bytes terms = 3;
}
message DualProof {
TxHeader sourceTxHeader = 1;
TxHeader targetTxHeader = 2;
repeated bytes inclusionProof = 3;
repeated bytes consistencyProof = 4;
bytes targetBlTxAlh = 5;
repeated bytes lastInclusionProof = 6;
LinearProof linearProof = 7;
}
message Tx {
TxHeader header = 1;
repeated TxEntry entries = 2;
repeated Entry kvEntries = 3;
repeated ZEntry zEntries = 4;
}
message TxEntry {
bytes key = 1;
bytes hValue = 2;
int32 vLen = 3;
KVMetadata metadata = 4;
bytes value = 5; // value must be ignored when len(value) == 0 and vLen > 0. Otherwise, sha256(value) must be equal to hValue
}
message KVMetadata {
bool deleted = 1;
Expiration expiration = 2;
bool nonIndexable = 3;
}
message Expiration {
int64 expiresAt = 1;
}
message VerifiableTx {
Tx tx = 1;
DualProof dualProof = 2;
Signature signature = 3;
}
//////////////////
message VerifiableEntry {
Entry entry = 1;
VerifiableTx verifiableTx = 2;
InclusionProof inclusionProof = 3;
}
message InclusionProof {
int32 leaf = 1;
int32 width = 2;
repeated bytes terms = 3;
}
message SetRequest {
repeated KeyValue KVs = 1;
bool noWait = 2;
repeated Precondition preconditions = 3;
}
message KeyRequest {
bytes key = 1;
uint64 atTx = 2; // if > 0, query for the value exactly at given transaction
// if 0 (and nowait=false), wait for the index to be up=to-date
uint64 sinceTx = 3;
// if set to true - do not wait for any indexing update considering only the currently indexed state
bool noWait = 4;
// if > 0, get the nth version of the value, 1 being the first version, 2 being the second and so on
// if < 0, get the historical nth value of the key, -1 being the previous version, -2 being the one before and so on
int64 atRevision = 5;
}
message KeyListRequest {
repeated bytes keys = 1;
uint64 sinceTx = 2;
}
message DeleteKeysRequest {
repeated bytes keys = 1;
uint64 sinceTx = 2;
bool noWait = 3;
}
message VerifiableSetRequest {
SetRequest setRequest = 1;
uint64 proveSinceTx = 2;
}
message VerifiableGetRequest {
KeyRequest keyRequest = 1;
uint64 proveSinceTx = 2;
}
message HealthResponse {
bool status = 1;
string version = 2;
}
message DatabaseHealthResponse {
uint32 pendingRequests = 1;
int64 lastRequestCompletedAt = 2;
}
message ImmutableState {
string db = 1;
uint64 txId = 2;
bytes txHash = 3;
Signature signature = 4;
}
message ReferenceRequest {
bytes key = 1;
bytes referencedKey = 2;
uint64 atTx = 3;
bool boundRef = 4;
bool noWait = 5;
repeated Precondition preconditions = 6;
}
message VerifiableReferenceRequest {
ReferenceRequest referenceRequest = 1;
uint64 proveSinceTx = 2;
}
message ZAddRequest {
bytes set = 1;
double score = 2;
bytes key = 3;
uint64 atTx = 4;
bool boundRef = 5;
bool noWait = 6;
}
message Score {
double score = 1;
}
message ZScanRequest {
bytes set = 1;
bytes seekKey = 2;
double seekScore = 3;
uint64 seekAtTx = 4;
bool inclusiveSeek = 5;
uint64 limit = 6;
bool desc = 7;
Score minScore = 8;
Score maxScore = 9;
uint64 sinceTx = 10;
bool noWait = 11;
}
message HistoryRequest {
bytes key = 1;
uint64 offset = 2;
int32 limit = 3;
bool desc = 4;
uint64 sinceTx = 5;
}
message VerifiableZAddRequest {
ZAddRequest zAddRequest = 1;
uint64 proveSinceTx = 2;
}
message TxRequest {
uint64 tx = 1;
EntriesSpec entriesSpec = 2;
uint64 sinceTx = 3;
bool noWait = 4;
bool keepReferencesUnresolved = 5;
}
message EntriesSpec {
EntryTypeSpec kvEntriesSpec = 1;
EntryTypeSpec zEntriesSpec = 2;
EntryTypeSpec sqlEntriesSpec = 3;
}
message EntryTypeSpec {
EntryTypeAction action = 1;
}
enum EntryTypeAction {
EXCLUDE = 0;
ONLY_DIGEST = 1;
RAW_VALUE = 2;
RESOLVE = 3;
}
message VerifiableTxRequest {
uint64 tx = 1;
uint64 proveSinceTx = 2;
EntriesSpec entriesSpec = 3;
uint64 sinceTx = 4;
bool noWait = 5;
bool keepReferencesUnresolved = 6;
}
message TxScanRequest {
uint64 initialTx = 1;
uint32 limit = 2;
bool desc = 3;
EntriesSpec entriesSpec = 4;
uint64 sinceTx = 5;
bool noWait = 6;
}
message TxList {
repeated Tx txs = 1;
}
message ExportTxRequest {
uint64 tx = 1;
}
message Database {
string databaseName = 1;
}
message DatabaseSettings {
string databaseName = 1;
bool replica = 2;
string masterDatabase = 3;
string masterAddress = 4;
uint32 masterPort = 5;
string followerUsername = 6;
string followerPassword = 7;
uint32 fileSize = 8;
uint32 maxKeyLen = 9;
uint32 maxValueLen = 10;
uint32 maxTxEntries = 11;
bool excludeCommitTime = 12;
}
message CreateDatabaseRequest {
string name = 1;
DatabaseNullableSettings settings = 2;
bool ifNotExists = 3;
}
message CreateDatabaseResponse {
string name = 1;
DatabaseNullableSettings settings = 2;
bool alreadyExisted = 3;
}
message UpdateDatabaseRequest {
string database = 1;
DatabaseNullableSettings settings = 2;
}
message UpdateDatabaseResponse { // Reserved to reply with more advanced response later
string database = 1;
DatabaseNullableSettings settings = 2;
}
message DatabaseSettingsRequest {
}
message DatabaseSettingsResponse {
string database = 1;
DatabaseNullableSettings settings = 2;
}
message NullableUint32 {
uint32 value = 1;
}
message NullableUint64 {
uint64 value = 1;
}
message NullableFloat {
float value = 1;
}
message NullableBool {
bool value = 1;
}
message NullableString {
string value = 1;
}
message DatabaseNullableSettings {
ReplicationNullableSettings replicationSettings = 2;
NullableUint32 fileSize = 8;
NullableUint32 maxKeyLen = 9;
NullableUint32 maxValueLen = 10;
NullableUint32 maxTxEntries = 11;
NullableBool excludeCommitTime = 12;
NullableUint32 maxConcurrency = 13;
NullableUint32 maxIOConcurrency = 14;
NullableUint32 txLogCacheSize = 15;
NullableUint32 vLogMaxOpenedFiles = 16;
NullableUint32 txLogMaxOpenedFiles = 17;
NullableUint32 commitLogMaxOpenedFiles = 18;
IndexNullableSettings indexSettings = 19;
NullableUint32 writeTxHeaderVersion = 20;
NullableBool autoload = 21;
}
message ReplicationNullableSettings {
NullableBool replica = 1;
NullableString masterDatabase = 2;
NullableString masterAddress = 3;
NullableUint32 masterPort = 4;
NullableString followerUsername = 5;
NullableString followerPassword = 6;
}
message IndexNullableSettings {
NullableUint32 flushThreshold = 1;
NullableUint32 syncThreshold = 2;
NullableUint32 cacheSize = 3;
NullableUint32 maxNodeSize = 4;
NullableUint32 maxActiveSnapshots = 5;
NullableUint64 renewSnapRootAfter = 6;
NullableUint32 compactionThld = 7;
NullableUint32 delayDuringCompaction = 8;
NullableUint32 nodesLogMaxOpenedFiles = 9;
NullableUint32 historyLogMaxOpenedFiles = 10;
NullableUint32 commitLogMaxOpenedFiles = 11;
NullableUint32 flushBufferSize = 12;
NullableFloat cleanupPercentage = 13;
}
message LoadDatabaseRequest {
string database = 1;
// may add createIfNotExist
}
message LoadDatabaseResponse {
string database = 1;
// may add setttings
}
message UnloadDatabaseRequest {
string database = 1;
}
message UnloadDatabaseResponse {
string database = 1;
}
message DeleteDatabaseRequest {
string database = 1;
}
message DeleteDatabaseResponse {
string database = 1;
}
message FlushIndexRequest {
float cleanupPercentage = 1;
bool synced = 2;
}
message FlushIndexResponse {
string database = 1;
}
message Table {
string tableName = 1;
}
message SQLGetRequest {
string table = 1;
repeated SQLValue pkValues = 2;
uint64 atTx = 3;
uint64 sinceTx = 4;
}
message VerifiableSQLGetRequest {
SQLGetRequest sqlGetRequest = 1;
uint64 proveSinceTx = 2;
}
message SQLEntry {
uint64 tx = 1;
bytes key = 2;
bytes value = 3;
KVMetadata metadata = 4;
}
message VerifiableSQLEntry {
reserved 6;
SQLEntry sqlEntry = 1;
VerifiableTx verifiableTx = 2;
InclusionProof inclusionProof = 3;
uint32 DatabaseId = 4;
uint32 TableId = 5;
repeated uint32 PKIDs = 16;
map<uint32, string> ColNamesById = 8;
map<string, uint32> ColIdsByName = 9;
map<uint32, string> ColTypesById = 10;
map<uint32, int32> ColLenById = 11;
}
message UseDatabaseReply{
string token = 1;
}
enum PermissionAction {
GRANT = 0;
REVOKE = 1;
}
message ChangePermissionRequest {
PermissionAction action = 1;
string username = 2;
string database = 3;
uint32 permission = 4;
}
message SetActiveUserRequest {
bool active = 1;
string username = 2;
}
message DatabaseListResponse {
repeated Database databases = 1;
}
message DatabaseListRequestV2 {
}
message DatabaseListResponseV2 {
repeated DatabaseWithSettings databases = 1;
}
message DatabaseWithSettings {
string name = 1;
DatabaseNullableSettings settings = 2;
bool loaded = 3;
}
message Chunk {
bytes content = 1;
}
message UseSnapshotRequest {
uint64 sinceTx = 1;
uint64 asBeforeTx = 2;
}
message SQLExecRequest {
string sql = 1;
repeated NamedParam params = 2;
bool noWait = 3;
}
message SQLQueryRequest {
string sql = 1;
repeated NamedParam params = 2;
bool reuseSnapshot = 3;
}
message NamedParam {
string name = 1;
SQLValue value = 2;
}
message SQLExecResult {
repeated CommittedSQLTx txs = 5;
bool ongoingTx = 6;
}
message CommittedSQLTx {
TxHeader header = 1;
uint32 updatedRows = 2;
map<string, SQLValue> lastInsertedPKs = 3;
map<string, SQLValue> firstInsertedPKs = 4;
}
message SQLQueryResult {
repeated Column columns = 2;
repeated Row rows = 1;
}
message Column {
string name = 1;
string type = 2;
}
message Row {
repeated string columns = 1;
repeated SQLValue values = 2;
}
message SQLValue {
oneof value {
google.protobuf.NullValue null = 1;
int64 n = 2;
string s = 3;
bool b = 4;
bytes bs = 5;
int64 ts = 6;
}
}
enum TxMode {
ReadOnly = 0;
WriteOnly = 1;
ReadWrite = 2;
}
message NewTxRequest {
TxMode mode = 1;
}
message NewTxResponse {
string transactionID = 1;
}
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
info: {
title: "immudb REST API"
description: "<b>IMPORTANT</b>: All <code>get</code> and <code>safeget</code> functions return <u>base64-encoded</u> keys and values, while all <code>set</code> and <code>safeset</code> functions expect <u>base64-encoded</u> inputs."
}
security_definitions: {
security: {
key: "bearer"
value: {
type: TYPE_API_KEY
in: IN_HEADER
name: "Authorization"
description: "Authentication token, prefixed by Bearer: Bearer <token>"
}
}
}
security: {
security_requirement: {
key: "bearer"
}
}
};
message ErrorInfo {
string code = 1;
string cause = 2;
}
message DebugInfo {
string stack = 1;
}
message RetryInfo {
int32 retry_delay = 1;
}
// immudb gRPC & REST service
service ImmuService {
rpc ListUsers (google.protobuf.Empty) returns (UserList){
option (google.api.http) = {
get: "/user/list"
};
};
rpc CreateUser (CreateUserRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/user"
body: "*"
};
};
rpc ChangePassword (ChangePasswordRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/user/password/change"
body: "*"
};
};
rpc ChangePermission(ChangePermissionRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/user/changepermission"
body: "*"
};
}
rpc SetActiveUser (SetActiveUserRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/user/setactiveUser"
body: "*"
};
};
rpc UpdateAuthConfig (AuthConfig) returns (google.protobuf.Empty){
option deprecated = true;
} // DEPRECATED
rpc UpdateMTLSConfig (MTLSConfig) returns (google.protobuf.Empty){
option deprecated = true;
} // DEPRECATED
rpc OpenSession (OpenSessionRequest) returns (OpenSessionResponse){};
rpc CloseSession (google.protobuf.Empty) returns (google.protobuf.Empty){};
rpc KeepAlive (google.protobuf.Empty) returns (google.protobuf.Empty){};
rpc NewTx (NewTxRequest) returns (NewTxResponse){};
rpc Commit (google.protobuf.Empty) returns (CommittedSQLTx){};
rpc Rollback (google.protobuf.Empty) returns (google.protobuf.Empty){};
rpc TxSQLExec(SQLExecRequest) returns (google.protobuf.Empty) {};
rpc TxSQLQuery(SQLQueryRequest) returns (SQLQueryResult) {};
rpc Login (LoginRequest) returns (LoginResponse){
option deprecated = true;
option (google.api.http) = {
post: "/login"
body: "*"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
security: {} // no security
};
};
rpc Logout (google.protobuf.Empty) returns (google.protobuf.Empty){
option deprecated = true;
option (google.api.http) = {
post: "/logout"
body: "*"
};
};
rpc Set (SetRequest) returns (TxHeader){
option (google.api.http) = {
post: "/db/set"
body: "*"
};
};
rpc VerifiableSet (VerifiableSetRequest) returns (VerifiableTx){
option (google.api.http) = {
post: "/db/verifiable/set"
body: "*"
};
};
rpc Get (KeyRequest) returns (Entry){
option (google.api.http) = {
get: "/db/get/{key}"
};
};
rpc VerifiableGet (VerifiableGetRequest) returns (VerifiableEntry){
option (google.api.http) = {
post: "/db/verifiable/get"
body: "*"
};
};
rpc Delete(DeleteKeysRequest) returns (TxHeader) {
option (google.api.http) = {
post: "/db/delete"
body: "*"
};
}
rpc GetAll (KeyListRequest) returns (Entries){
option (google.api.http) = {
post: "/db/getall"
body: "*"
};
};
rpc ExecAll (ExecAllRequest) returns (TxHeader) {
option (google.api.http) = {
post: "/db/execall"
body: "*"
};
};
rpc Scan(ScanRequest) returns (Entries){
option (google.api.http) = {
post: "/db/scan"
body: "*"
};
};
// NOT YET SUPPORTED
rpc Count(KeyPrefix) returns (EntryCount){
option (google.api.http) = {
get: "/db/count/{prefix}"
};
};
// NOT YET SUPPORTED
rpc CountAll(google.protobuf.Empty) returns (EntryCount){
option (google.api.http) = {
get: "/db/countall"
};
};
rpc TxById(TxRequest) returns (Tx){
option (google.api.http) = {
get: "/db/tx/{tx}"
};
};
rpc VerifiableTxById(VerifiableTxRequest) returns (VerifiableTx){
option (google.api.http) = {
get: "/db/verifiable/tx/{tx}"
};
};
rpc TxScan(TxScanRequest) returns (TxList) {
option (google.api.http) = {
post: "/db/tx"
body: "*"
};
}
rpc History(HistoryRequest) returns (Entries){
option (google.api.http) = {
post: "/db/history"
body: "*"
};
};
rpc Health (google.protobuf.Empty) returns (HealthResponse){
option (google.api.http) = {
get: "/health"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
security: {} // no security
};
};
rpc DatabaseHealth (google.protobuf.Empty) returns (DatabaseHealthResponse){
option (google.api.http) = {
get: "/db/health"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
security: {} // no security
};
};
rpc CurrentState (google.protobuf.Empty) returns (ImmutableState){
option (google.api.http) = {
get: "/db/state"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
security: {} // no security
};
};
rpc SetReference (ReferenceRequest) returns (TxHeader){
option (google.api.http) = {
post: "/db/setreference"
body: "*"
};
};
rpc VerifiableSetReference (VerifiableReferenceRequest) returns (VerifiableTx){
option (google.api.http) = {
post: "/db/verifiable/setreference"
body: "*"
};
};