Storage KV API
Table of Contents
Methods
Method Name | Request Type | Response Type | Description |
---|---|---|---|
getStatus | - | - | This checks the node status |
getValue | [H256, Segment, u64, u64, Option<u64>] | ValueSegment | This retrieves a value by the key and the stream id |
getNext | [H256, Segment, u64, u64, bool, Option<u64>] | KeyValueSegment | This gets the next key-value from the key position |
getPrev | [H256, Segment, u64, u64, bool, Option<u64>] | KeyValueSegment | This gets the previous key-value from the key position |
getFirst | [H256, Segment, u64, u64, Option<u64>] | KeyValueSegment | This gets the first key-value in a particular stream |
getLast | [H256, Segment, u64, u64, Option<u64>] | KeyValueSegment | This gets the last key-value in a particular stream |
getTransactionResult | [u64] | String | This gets the result of a transaction by tx seq |
getHoldingStreamIds | - | [H256] | This gets the stream ids that the kv instance maintains |
hasWritePermission | [H160, H256, Segment, Option<u64>] | bool | This checks whether an account has write permission to a key in the stream |
isAdmin | [H160, H256, Option<u64>] | bool | This checks whether an account is admin |
isSpecialKey | [H256, Segment, Option<u64>] | bool | This checks whether a key is a special key |
isWriterOfKey | [H160, H256, Segment, Option<u64>] | bool | This checks whether an account has write permission to a special key in the stream |
isWriterOfStream | [H160, Segment, Option<u64>] | bool | This checks whether an account has write permission to a stream |
Data Structure
ValueSegment
Field | Type | Description |
---|---|---|
version | u64 | An update prefix of a key in the kv store |
data | [u8] | value mapped to the key |
size | usize | data total size |
KeyValueSegment
Field | Type | Description |
---|---|---|
version | u64 | An update prefix of a key in the kv store |
key | [u8] | key of the kv pair |
data | [u8] | value mapped to the key |
size | usize | data total size |
Last updated