Protocol Documentation
ImmuService
Here a list of services exposed by immudb GRPc interface
Database services
immudb gRPC & REST service
IMPORTANT: All get and safeget functions return base64-encoded keys and values, while all set and safeset functions expect base64-encoded inputs.
Database operational services
Following methods grant the basic immudb capabilities.
Set
and Get
are the primitive.
SafeSet
and SafeGet
counterparts do the primitive job but in addition they produce also inclusion and consistency proofs.
Insertion order index services
Following methods rely on internal immudb insertion order index.
Insertion order index is a special index appended on every leaf in the merkle tree. With this we benefit of the internal merkle tree natural insertion order index.
When we retrieve elements by index a first lookup is made on the leaf at the same index to discover the element key, then a second lookup is realized to retrieve the value.
BySafeIndex
counterpart produces also the inclusion and consistency proofs.
Secondary indexes services
Thanks to the lexicographical order in which internal data is structured we exposed following methods.
Reference
is like a "tag" operation, it append a reference on a key. As a consequence when we retrieve that reference/key with a Get
or SafeGet
the value retrieved will be the original value associated to the original key.
SafeReference
counterpart is the same but in addition it produces also the inclusion and consistency proofs.
ZAdd
operates internally in a similar manner to Reference
but it introduces the concept of set. Inside a set we can organize collection of similar elements.
When we add an elements to a collection we can specify his score using a float value.
In ZAdd
It's possible to specify also the index of the reference. In this way if there are multiple equals keys it will be inserted in the set the specified version.
To retrieve elements we can use Zscan
methods with return elements sorted by their score. If elements are inserted with same score they are returned in a lexicographical order.
SafeZAdd
counterpart produces also the inclusion and consistency proofs.
Tamperproofing services
Inclusion
returns a path of nodes that can be used to prove that a node was correctly inserted inside the merkle tree.
Consistency
returns a path of nodes that can be used to prove that a subtree contained in the main merkle tree is still the same.
CurrentRoot
the last root of the tree.
The suggest approach to detect malicious action is to use an SDK and safe* family methods.
Administrative services
Table of Contents
Top
schema.proto
AuthConfig
Field | Type | Label | Description |
kind | uint32 | | |
ChangePasswordRequest
Field | Type | Label | Description |
user | bytes | | |
oldPassword | bytes | | |
newPassword | bytes | | |
ChangePermissionRequest
ConsistencyProof
Content
Field | Type | Label | Description |
timestamp | uint64 | | |
payload | bytes | | |
CreateDatabaseReply
Field | Type | Label | Description |
error | Error | | |
CreateUserRequest
Database
Field | Type | Label | Description |
databasename | string | | |
DatabaseListResponse
Field | Type | Label | Description |
databases | Database | repeated | |
Error
HealthResponse
Field | Type | Label | Description |
status | bool | | |
version | string | | |
IScanOptions
Field | Type | Label | Description |
pageSize | uint64 | | |
pageNumber | uint64 | | |
InclusionProof
Index
Field | Type | Label | Description |
index | uint64 | | |
Item
ItemList
Field | Type | Label | Description |
items | Item | repeated | |
ItemsCount
Field | Type | Label | Description |
count | uint64 | | |
KVList
Field | Type | Label | Description |
KVs | KeyValue | repeated | |
Key
Field | Type | Label | Description |
key | bytes | | |
KeyList
Field | Type | Label | Description |
keys | Key | repeated | |
KeyPrefix
Field | Type | Label | Description |
prefix | bytes | | |
KeyValue
Field | Type | Label | Description |
key | bytes | | |
value | bytes | | |
Layer
Field | Type | Label | Description |
l | Node | repeated | |
LoginRequest
Field | Type | Label | Description |
user | bytes | | |
password | bytes | | |
LoginResponse
Field | Type | Label | Description |
token | bytes | | |
warning | bytes | | |
MTLSConfig
Field | Type | Label | Description |
enabled | bool | | |
Node
Page
Field | Type | Label | Description |
items | Item | repeated | |
more | bool | | |
Permission
Field | Type | Label | Description |
database | string | | |
permission | uint32 | | |
Proof
ReferenceOptions
Field | Type | Label | Description |
reference | bytes | | |
key | bytes | | |
Root
SKVList
SPage
SafeGetOptions
Field | Type | Label | Description |
key | bytes | | |
rootIndex | Index | | |
SafeIndexOptions
Field | Type | Label | Description |
index | uint64 | | |
rootIndex | Index | | |
SafeItem
Field | Type | Label | Description |
item | Item | | |
proof | Proof | | |
SafeReferenceOptions
SafeSetOptions
SafeSetSVOptions
SafeStructuredItem
SafeZAddOptions
ScanOptions
SetActiveUserRequest
Field | Type | Label | Description |
active | bool | | |
username | string | | |
StructuredItem
StructuredItemList
StructuredKeyValue
Tree
Field | Type | Label | Description |
t | Layer | repeated | |
UseDatabaseReply
User
UserList
Field | Type | Label | Description |
users | User | repeated | |
UserRequest
Field | Type | Label | Description |
user | bytes | | |
UserResponse
Field | Type | Label | Description |
user | bytes | | |
permission | uint32 | | |
ZAddOptions
ZScanOptions
ErrorCodes
Name | Number | Description |
Ok | 0 | |
ERROR_SELECTING_DATABASE | 1 | |
ERROR_NO_PERMISSION_FOR_THIS_DATABASE | 2 | |
ERROR_USER_HAS_NOT_LOGGED_IN | 3 | |
ERROR_DB_DOES_NOT_EXIST | 4 | |
PermissionAction
Name | Number | Description |
GRANT | 0 | |
REVOKE | 1 | |
Scalar Value Types
.proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
double | | double | double | float | float64 | double | float | Float |
float | | float | float | float | float32 | float | float | Float |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |