hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
rocksdb_common.hpp File Reference
#include <charconv>
#include <mutex>
#include <string>
#include <string_view>
#include <fmt/compile.h>
#include <fmt/format.h>
#include <rocksdb/db.h>
#include <rocksdb/utilities/optimistic_transaction_db.h>
#include <rocksdb/utilities/transaction.h>
#include "ametsuchi/impl/executor_common.hpp"
#include "common/irohad_version.hpp"
#include "common/result.hpp"
#include "interfaces/common_objects/amount.hpp"
#include "interfaces/common_objects/types.hpp"
#include "interfaces/permissions.hpp"
Include dependency graph for rocksdb_common.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  iroha::ametsuchi::RocksDBContext
 
struct  iroha::ametsuchi::DbError
 Db errors structure. More...
 
struct  iroha::ametsuchi::RocksDBPort
 
class  iroha::ametsuchi::RocksDbCommon
 
struct  iroha::ametsuchi::PaginationContext
 
struct  iroha::ametsuchi::PaginationContext::FirstEntry
 

Namespaces

 iroha::ametsuchi::fmtstrings
 
 iroha::ametsuchi
 

Macros

#define RDB_DELIMITER   "/"
 
#define RDB_XXX   RDB_DELIMITER "{}" RDB_DELIMITER
 
#define RDB_ROOT   ""
 
#define RDB_STORE   "s"
 
#define RDB_WSV   "w"
 
#define RDB_NETWORK   "n"
 
#define RDB_SETTINGS   "i"
 
#define RDB_ASSETS   "x"
 
#define RDB_ROLES   "r"
 
#define RDB_TRANSACTIONS   "t"
 
#define RDB_ACCOUNTS   "a"
 
#define RDB_PEERS   "p"
 
#define RDB_STATUSES   "u"
 
#define RDB_DETAILS   "d"
 
#define RDB_GRANTABLE_PER   "g"
 
#define RDB_POSITION   "P"
 
#define RDB_TIMESTAMP   "T"
 
#define RDB_DOMAIN   "D"
 
#define RDB_SIGNATORIES   "S"
 
#define RDB_OPTIONS   "O"
 
#define RDB_ADDRESS   "M"
 
#define RDB_TLS   "N"
 
#define RDB_F_QUORUM   "q"
 
#define RDB_F_ASSET_SIZE   "I"
 
#define RDB_F_TOP_BLOCK   "Q"
 
#define RDB_F_PEERS_COUNT   "Z"
 
#define RDB_F_TOTAL_COUNT   "V"
 
#define RDB_F_VERSION   "v"
 
#define RDB_PATH_DOMAIN   RDB_ROOT RDB_WSV RDB_DOMAIN RDB_XXX
 
#define RDB_PATH_ACCOUNT   RDB_PATH_DOMAIN RDB_ACCOUNTS RDB_XXX
 
#define RDB_ERROR_CHECK(...)
 
#define RDB_ERROR_CHECK_TO_STR(...)
 
#define RDB_TRY_GET_VALUE(name, ...)
 
#define RDB_TRY_GET_VALUE_OR_STR_ERR(name, ...)
 

Enumerations

enum  iroha::ametsuchi::DbErrorCode {
  iroha::ametsuchi::kOk = 0, iroha::ametsuchi::kErrorNoPermissions = 2, iroha::ametsuchi::kNotFound = 3, iroha::ametsuchi::kNoAccount = 3,
  iroha::ametsuchi::kMustNotExist = 4, iroha::ametsuchi::kNoRoles = 4, iroha::ametsuchi::kInvalidPagination = 4, iroha::ametsuchi::kInvalidStatus = 12,
  iroha::ametsuchi::kInitializeFailed = 15, iroha::ametsuchi::kOperationFailed = 16
}
 
enum  iroha::ametsuchi::kDbOperation { iroha::ametsuchi::kDbOperation::kGet, iroha::ametsuchi::kDbOperation::kCheck, iroha::ametsuchi::kDbOperation::kPut, iroha::ametsuchi::kDbOperation::kDel }
 
enum  iroha::ametsuchi::kDbEntry { iroha::ametsuchi::kDbEntry::kMustExist, iroha::ametsuchi::kDbEntry::kMustNotExist, iroha::ametsuchi::kDbEntry::kCanExist }
 

Functions

template<typename T , typename... Args>
expected::Result< T, DbError > iroha::ametsuchi::makeError (uint32_t code, char const *format, Args &&... args)
 
template<typename T >
expected::Result< T, DbError > iroha::ametsuchi::makeError (uint32_t code, DbError &&e)
 
template<typename F , typename S , typename... Args>
auto iroha::ametsuchi::enumerateKeys (RocksDbCommon &rdb, F &&func, S const &strformat, Args &&... args)
 Enumerating through all the keys matched to prefix without reading value. More...
 
template<typename F >
auto iroha::ametsuchi::makeKVLambda (F &&func)
 
template<typename F , typename S , typename... Args>
auto iroha::ametsuchi::enumerateKeysAndValues (RocksDbCommon &rdb, F &&func, S const &strformat, Args &&... args)
 Enumerating through all the keys matched to prefix and read the value. More...
 
template<typename F , typename S , typename... Args>
auto iroha::ametsuchi::enumerateKeysAndValues (RocksDbCommon &rdb, F &&func, std::unique_ptr< rocksdb::Iterator > &it, S const &strformat, Args &&... args)
 
template<typename F >
expected::Result< void, DbError > iroha::ametsuchi::mustNotExist (rocksdb::Status const &status, F &&op_formatter)
 
template<typename F >
expected::Result< void, DbError > iroha::ametsuchi::mustExist (rocksdb::Status const &status, F &&op_formatter)
 
template<typename F >
expected::Result< void, DbError > iroha::ametsuchi::canExist (rocksdb::Status const &status, F &&op_formatter)
 
template<kDbEntry kSc, typename F >
expected::Result< void, DbError > iroha::ametsuchi::checkStatus (rocksdb::Status status, F &&op_formatter)
 
template<kDbOperation kOp, kDbEntry kSc, typename OperationDescribtionF , typename... Args>
expected::Result< rocksdb::Status, DbError > iroha::ametsuchi::executeOperation (RocksDbCommon &common, OperationDescribtionF &&op_formatter, Args &&... args)
 
template<kDbOperation kOp, typename T , typename = std::enable_if_t<std::is_same<T, uint64_t>::value>>
std::optional< uint64_t > iroha::ametsuchi::loadValue (RocksDbCommon &common, expected::Result< rocksdb::Status, DbError > const &status)
 
template<kDbOperation kOp, typename T , typename = std::enable_if_t<std::is_same<T, std::string_view>::value>>
std::optional< std::string_view > iroha::ametsuchi::loadValue (RocksDbCommon &common, expected::Result< rocksdb::Status, DbError > const &status)
 
template<kDbOperation kOp, typename T , typename = std::enable_if_t< std::is_same<T, shared_model::interface::RolePermissionSet>::value>>
std::optional< shared_model::interface::RolePermissionSetiroha::ametsuchi::loadValue (RocksDbCommon &common, expected::Result< rocksdb::Status, DbError > const &status)
 
template<kDbOperation kOp, typename T , typename = std::enable_if_t<std::is_same<T, IrohadVersion>::value>>
std::optional< IrohadVersion > iroha::ametsuchi::loadValue (RocksDbCommon &common, expected::Result< rocksdb::Status, DbError > const &status)
 
template<kDbOperation kOp, typename T , typename = std::enable_if_t< std::is_same<T, shared_model::interface::Amount>::value>>
std::optional< shared_model::interface::Amountiroha::ametsuchi::loadValue (RocksDbCommon &common, expected::Result< rocksdb::Status, DbError > const &status)
 
template<kDbOperation kOp, typename T , typename = std::enable_if_t<std::is_same< T, shared_model::interface::GrantablePermissionSet>::value>>
std::optional< shared_model::interface::GrantablePermissionSetiroha::ametsuchi::loadValue (RocksDbCommon &common, expected::Result< rocksdb::Status, DbError > const &status)
 
template<kDbOperation kOp, typename T , typename = std::enable_if_t<std::is_same<T, bool>::value>>
std::optional< bool > iroha::ametsuchi::loadValue (RocksDbCommon &common, expected::Result< rocksdb::Status, DbError > const &status)
 
template<typename RetT , kDbOperation kOp, kDbEntry kSc, typename... Args>
expected::Result< std::optional< RetT >, DbError > iroha::ametsuchi::dbCall (RocksDbCommon &common, Args &&... args)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forAccountDetailsCount (RocksDbCommon &common, std::string_view account, std::string_view domain)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< IrohadVersion >, DbError > iroha::ametsuchi::forStoreVersion (RocksDbCommon &common)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< IrohadVersion >, DbError > iroha::ametsuchi::forWSVVersion (RocksDbCommon &common)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forBlock (RocksDbCommon &common, uint64_t height)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forBlocksTotalCount (RocksDbCommon &common)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forQuorum (RocksDbCommon &common, std::string_view account, std::string_view domain)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forTxsTotalCount (RocksDbCommon &common, std::string_view account_id)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forTxsTotalCount (RocksDbCommon &common)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forDomainsTotalCount (RocksDbCommon &common)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
auto iroha::ametsuchi::forAccount (RocksDbCommon &common, std::string_view account, std::string_view domain)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< shared_model::interface::RolePermissionSet >, DbError > iroha::ametsuchi::forRole (RocksDbCommon &common, std::string_view role)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forPeersCount (RocksDbCommon &common)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forTransactionStatus (RocksDbCommon &common, std::string_view tx_hash)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forTransactionByPosition (RocksDbCommon &common, std::string_view account, uint64_t ts, uint64_t height, uint64_t index)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forTransactionByTimestamp (RocksDbCommon &common, std::string_view account, uint64_t ts, uint64_t height, uint64_t index)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forSettings (RocksDbCommon &common, std::string_view key)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forPeerAddress (RocksDbCommon &common, std::string_view pubkey)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forPeerTLS (RocksDbCommon &common, std::string_view pubkey)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forAsset (RocksDbCommon &common, std::string_view asset, std::string_view domain)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forTopBlockInfo (RocksDbCommon &common)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< bool >, DbError > iroha::ametsuchi::forAccountRole (RocksDbCommon &common, std::string_view account, std::string_view domain, std::string_view role)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forAccountDetail (RocksDbCommon &common, std::string_view account, std::string_view domain, std::string_view creator_id, std::string_view key)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< bool >, DbError > iroha::ametsuchi::forSignatory (RocksDbCommon &common, std::string_view account, std::string_view domain, std::string_view pubkey)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kMustExist>
expected::Result< std::optional< std::string_view >, DbError > iroha::ametsuchi::forDomain (RocksDbCommon &common, std::string_view domain)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kCanExist>
expected::Result< std::optional< uint64_t >, DbError > iroha::ametsuchi::forAccountAssetSize (RocksDbCommon &common, std::string_view account, std::string_view domain)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kCanExist>
expected::Result< std::optional< shared_model::interface::Amount >, DbError > iroha::ametsuchi::forAccountAsset (RocksDbCommon &common, std::string_view account, std::string_view domain, std::string_view asset)
 
template<kDbOperation kOp = kDbOperation::kGet, kDbEntry kSc = kDbEntry::kCanExist>
expected::Result< std::optional< shared_model::interface::GrantablePermissionSet >, DbError > iroha::ametsuchi::forGrantablePermissions (RocksDbCommon &common, std::string_view account, std::string_view domain, std::string_view grantee_account_id)
 
expected::Result< shared_model::interface::RolePermissionSet, DbError > iroha::ametsuchi::accountPermissions (RocksDbCommon &common, std::string_view account, std::string_view domain)
 
expected::Result< void, DbError > iroha::ametsuchi::checkPermissions (shared_model::interface::RolePermissionSet const &permissions, shared_model::interface::permissions::Role const to_check)
 
expected::Result< void, DbError > iroha::ametsuchi::checkPermissions (std::string_view domain_id, std::string_view creator_domain_id, shared_model::interface::RolePermissionSet const &permissions, shared_model::interface::permissions::Role const all, shared_model::interface::permissions::Role const domain)
 
expected::Result< void, DbError > iroha::ametsuchi::checkGrantablePermissions (shared_model::interface::RolePermissionSet const &permissions, shared_model::interface::GrantablePermissionSet const &grantable_permissions, shared_model::interface::permissions::Grantable const granted)
 
expected::Result< void, DbError > iroha::ametsuchi::checkPermissions (shared_model::interface::RolePermissionSet const &permissions, shared_model::interface::GrantablePermissionSet const &grantable_permissions, shared_model::interface::permissions::Role const role, shared_model::interface::permissions::Grantable const granted)
 
expected::Result< void, DbError > iroha::ametsuchi::checkPermissions (std::string_view domain_id, std::string_view creator_domain_id, std::string_view qry_account_id, std::string_view creator_id, shared_model::interface::RolePermissionSet const &permissions, shared_model::interface::permissions::Role const all, shared_model::interface::permissions::Role const domain, shared_model::interface::permissions::Role const my)
 
expected::Result< std::string, DbError > iroha::ametsuchi::aggregateAccountDetails (RocksDbCommon &common, std::string_view account, std::string_view domain, uint64_t &total, std::string_view writer_filter=std::string_view{}, std::string_view key_filter=std::string_view{}, std::optional< PaginationContext > pagination=std::nullopt, std::string *next_writer=nullptr, std::string *next_key=nullptr)
 
expected::Result< void, DbError > iroha::ametsuchi::dropWSV (RocksDbCommon &common)
 

Variables

static constexpr size_t iroha::ametsuchi::fmtstrings::kDelimiterSize
 
static constexpr size_t iroha::ametsuchi::fmtstrings::kDelimiterCountForAField = 2ull
 
static const std::string iroha::ametsuchi::fmtstrings::kDelimiter {RDB_DELIMITER}
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathAccountRoles
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathWsv {FMT_STRING(RDB_ROOT RDB_WSV)}
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathStore {FMT_STRING(RDB_ROOT RDB_STORE)}
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathAccount {FMT_STRING(RDB_PATH_ACCOUNT)}
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathPeers
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathSignatories
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathRoles
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathTransactionByTs
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathTransactionByPosition
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathAccountDetail
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPathAccountAssets
 
static auto constexpr iroha::ametsuchi::fmtstrings::kBlockDataInStore
 
static auto constexpr iroha::ametsuchi::fmtstrings::kTransactionByPosition
 
static auto constexpr iroha::ametsuchi::fmtstrings::kTransactionByTs
 
static auto constexpr iroha::ametsuchi::fmtstrings::kTransactionByHeight
 
static auto constexpr iroha::ametsuchi::fmtstrings::kTransactionByTsLowerBound
 
static auto constexpr iroha::ametsuchi::fmtstrings::kTransactionStatus
 
static auto constexpr iroha::ametsuchi::fmtstrings::kAccountRole
 
static auto constexpr iroha::ametsuchi::fmtstrings::kRole
 
static auto constexpr iroha::ametsuchi::fmtstrings::kSignatory
 
static auto constexpr iroha::ametsuchi::fmtstrings::kAsset
 
static auto constexpr iroha::ametsuchi::fmtstrings::kAccountAsset
 
static auto constexpr iroha::ametsuchi::fmtstrings::kAccountDetail
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPeerAddress
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPeerTLS
 
static auto constexpr iroha::ametsuchi::fmtstrings::kGranted
 
static auto constexpr iroha::ametsuchi::fmtstrings::kSetting
 
static auto constexpr iroha::ametsuchi::fmtstrings::kDomain {FMT_STRING(RDB_PATH_DOMAIN)}
 
static auto constexpr iroha::ametsuchi::fmtstrings::kTopBlock
 
static auto constexpr iroha::ametsuchi::fmtstrings::kQuorum
 
static auto constexpr iroha::ametsuchi::fmtstrings::kAccountAssetSize
 
static auto constexpr iroha::ametsuchi::fmtstrings::kPeersCount
 
static auto constexpr iroha::ametsuchi::fmtstrings::kTxsTotalCount
 
static auto constexpr iroha::ametsuchi::fmtstrings::kBlocksTotalCount
 
static auto constexpr iroha::ametsuchi::fmtstrings::kAllTxsTotalCount
 
static auto constexpr iroha::ametsuchi::fmtstrings::kDomainsTotalCount
 
static auto constexpr iroha::ametsuchi::fmtstrings::kAccountDetailsCount
 
static auto constexpr iroha::ametsuchi::fmtstrings::kStoreVersion
 
static auto constexpr iroha::ametsuchi::fmtstrings::kWsvVersion
 

Macro Definition Documentation

◆ RDB_ACCOUNTS

#define RDB_ACCOUNTS   "a"

◆ RDB_ADDRESS

#define RDB_ADDRESS   "M"

◆ RDB_ASSETS

#define RDB_ASSETS   "x"

◆ RDB_DELIMITER

#define RDB_DELIMITER   "/"

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 RocksDB data structure.

|ROOT|-+-|STORE|-+-<height_1, value:block> | +-<height_2, value:block> | +-<height_3, value:block> | +-<version> | +-<blocks_total_count, value> | +-|WSV|-+-|NETWORK|-+-|PEERS|-+-|ADDRESS|-+-<peer_1_pubkey, value:address> | | | +-<peer_2_pubkey, value:address> | | | | | +-|TLS|-+-<peer_1, value:tls> | | | +-<peer_2, value:tls> | | | | | +-<count, value> | | | +-|STORE|-+-<top_block, value: store height::top block hash> | +-|SETTINGS|-+-<key_1, value_1> | +-<key_2, value_2> | +-<key_3, value_3> | +-|ROLES|-+-<role_1, value:permissions bitfield> | +-<role_2, value:permissions bitfield> | +-<role_3, value:permissions bitfield> | +-|TRANSACTIONS|-+-|ACCOUNTS|-+-<account_1>-+-|POSITION|-+-<height_index, value:tx_hash_1> | | | | +-<height_index, value:tx_hash_2> | | | | +-<height_index, value:tx_hash_3> | | | | | | | +-|TIMESTAMP|-+-<ts_1, value:tx_hash_1> | | | | +-<ts_2, value:tx_hash_2> | | | | +-<ts_3, value:tx_hash_3> | | | | | | | +-<tx_total_count> | | | | | +-<account_2>-+-|POSITION|-+-<height_index, value:tx_hash_4> | | | +-<height_index, value:tx_hash_5> | | | +-<height_index, value:tx_hash_6> | | | | | +-|TIMESTAMP|-+-<ts_1, value:tx_hash_4> | | | +-<ts_2, value:tx_hash_5> | | | +-<ts_3, value:tx_hash_6> | | | | | +-<tx_total_count> | | | +-|STATUSES|-+-<tx_hash_1, value:status_height_index> | | +-<tx_hash_2, value:status_height_index> | | | +-<tx_total_count> | +-|DOMAIN|-+-|DOMAIN_1|-+-|ASSETS|-+-<asset_1, value:precision> | | | +-<asset_2, value:precision> | | | | | +-|ACCOUNTS|-|NAME_1|-+-|ASSETS|-+-<asset_1, value:quantity> | | | +-<asset_2, value:quantity> | | | | | +-|OPTIONS|-+-<quorum> | | | +-<asset_size> | | | +-<total, value: count> | | | | | +-|DETAILS|-+-<writer>-<key, value> | | | | | +-|ROLES|-+-<role_1, value:flag> | | | +-<role_2, value:flag> | | | | | +-|GRANTABLE_PER|-+-<account_id_1, value:permissions> | | | +-<account_id_2, value:permissions> | | | | | +-|SIGNATORIES|-+-<signatory_1> | | +-<signatory_2> | | | +-<domain_1, value: default_role> | +-<total_count, value> | +-<version>

####### LEGEND MAP

Directory ## Mnemonics

DELIMITER ## /

ROOT ##

STORE ## s

WSV ## w

NETWORK ## n

SETTINGS ## i

ASSETS ## x

ROLES ## r

TRANSACTIONS ## t

ACCOUNTS ## a

PEERS ## p

STATUSES ## u

DETAILS ## d

GRANTABLE_PER ## g

POSITION ## P

TIMESTAMP ## T

DOMAIN ## D

SIGNATORIES ## S

OPTIONS ## O

ADDRESS ## M

TLS ## N

File ## Mnemonics

F_QUORUM ## q

F_ASSET SIZE ## I

F_TOP BLOCK ## Q

F_PEERS COUNT ## Z

F_TOTAL COUNT ## V

F_VERSION ## v

####### EXAMPLE

GetAccountTransactions(ACCOUNT, TS) -> KEY: wta/ACCOUNT/T/TS/ GetAccountAssets(DOMAIN,ACCOUNT) -> KEY: wD/DOMAIN/a/ACCOUNT/x

◆ RDB_DETAILS

#define RDB_DETAILS   "d"

◆ RDB_DOMAIN

#define RDB_DOMAIN   "D"

◆ RDB_ERROR_CHECK

#define RDB_ERROR_CHECK (   ...)
Value:
if (auto _tmp_gen_var = (__VA_ARGS__); \
iroha::expected::hasError(_tmp_gen_var)) \
return _tmp_gen_var.assumeError()

◆ RDB_ERROR_CHECK_TO_STR

#define RDB_ERROR_CHECK_TO_STR (   ...)
Value:
if (auto _tmp_gen_var = (__VA_ARGS__); \
iroha::expected::hasError(_tmp_gen_var)) \
return _tmp_gen_var.assumeError().description

◆ RDB_F_ASSET_SIZE

#define RDB_F_ASSET_SIZE   "I"

◆ RDB_F_PEERS_COUNT

#define RDB_F_PEERS_COUNT   "Z"

◆ RDB_F_QUORUM

#define RDB_F_QUORUM   "q"

◆ RDB_F_TOP_BLOCK

#define RDB_F_TOP_BLOCK   "Q"

◆ RDB_F_TOTAL_COUNT

#define RDB_F_TOTAL_COUNT   "V"

◆ RDB_F_VERSION

#define RDB_F_VERSION   "v"

◆ RDB_GRANTABLE_PER

#define RDB_GRANTABLE_PER   "g"

◆ RDB_NETWORK

#define RDB_NETWORK   "n"

◆ RDB_OPTIONS

#define RDB_OPTIONS   "O"

◆ RDB_PATH_ACCOUNT

#define RDB_PATH_ACCOUNT   RDB_PATH_DOMAIN RDB_ACCOUNTS RDB_XXX

◆ RDB_PATH_DOMAIN

#define RDB_PATH_DOMAIN   RDB_ROOT RDB_WSV RDB_DOMAIN RDB_XXX

◆ RDB_PEERS

#define RDB_PEERS   "p"

◆ RDB_POSITION

#define RDB_POSITION   "P"

◆ RDB_ROLES

#define RDB_ROLES   "r"

◆ RDB_ROOT

#define RDB_ROOT   ""

◆ RDB_SETTINGS

#define RDB_SETTINGS   "i"

◆ RDB_SIGNATORIES

#define RDB_SIGNATORIES   "S"

◆ RDB_STATUSES

#define RDB_STATUSES   "u"

◆ RDB_STORE

#define RDB_STORE   "s"

◆ RDB_TIMESTAMP

#define RDB_TIMESTAMP   "T"

◆ RDB_TLS

#define RDB_TLS   "N"

◆ RDB_TRANSACTIONS

#define RDB_TRANSACTIONS   "t"

◆ RDB_TRY_GET_VALUE

#define RDB_TRY_GET_VALUE (   name,
  ... 
)
Value:
typename decltype(__VA_ARGS__)::ValueInnerType name; \
if (auto _tmp_gen_var = (__VA_ARGS__); \
iroha::expected::hasError(_tmp_gen_var)) \
return _tmp_gen_var.assumeError(); \
else \
name = std::move(_tmp_gen_var.assumeValue())

◆ RDB_TRY_GET_VALUE_OR_STR_ERR

#define RDB_TRY_GET_VALUE_OR_STR_ERR (   name,
  ... 
)
Value:
typename decltype(__VA_ARGS__)::ValueInnerType name; \
if (auto _tmp_gen_var = (__VA_ARGS__); \
iroha::expected::hasError(_tmp_gen_var)) \
return _tmp_gen_var.assumeError().description; \
else \
name = std::move(_tmp_gen_var.assumeValue())

◆ RDB_WSV

#define RDB_WSV   "w"

◆ RDB_XXX

#define RDB_XXX   RDB_DELIMITER "{}" RDB_DELIMITER