hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
indexer.hpp
Go to the documentation of this file.
1 
6 #ifndef AMETSUCHI_INDEXER_HPP
7 #define AMETSUCHI_INDEXER_HPP
8 
9 #include <string>
10 
11 #include "common/result.hpp"
13 
14 namespace iroha {
15  namespace ametsuchi {
16 
21  class Indexer {
22  public:
23  virtual ~Indexer() = default;
24 
26  struct TxPosition {
29  size_t index;
30  };
31 
33  virtual void txHashPosition(
35  TxPosition position) = 0;
36 
38  virtual void committedTxHash(
40  &committed_tx_hash) = 0;
41 
43  virtual void rejectedTxHash(
44  const shared_model::interface::types::HashType &rejected_tx_hash) = 0;
45 
47  virtual void txPositionByCreator(
49  TxPosition position) = 0;
50 
52  virtual void accountAssetTxPosition(
55  TxPosition position) = 0;
56 
63  virtual iroha::expected::Result<void, std::string> flush() = 0;
64  };
65 
66  } // namespace ametsuchi
67 } // namespace iroha
68 
69 #endif /* AMETSUCHI_INDEXER_HPP */
virtual void txHashPosition(const shared_model::interface::types::HashType &hash, TxPosition position)=0
Index tx position by its hash.
uint64_t HeightType
Type of height (for Block, Proposal etc)
Definition: types.hpp:43
Definition: hash.hpp:18
virtual void txPositionByCreator(const shared_model::interface::types::AccountIdType creator, TxPosition position)=0
Index tx position by creator account.
size_t index
the number of this transaction in the block
Definition: indexer.hpp:29
virtual void accountAssetTxPosition(const shared_model::interface::types::AccountIdType &account_id, const shared_model::interface::types::AssetIdType &asset_id, TxPosition position)=0
Index account asset tx position by involved account and asset.
virtual void committedTxHash(const shared_model::interface::types::HashType &committed_tx_hash)=0
Store a committed tx hash.
Definition: block_query.hpp:14
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
hash256_t hash(const T &pb)
Definition: pb_common.hpp:43
virtual iroha::expected::Result< void, std::string > flush()=0
virtual void rejectedTxHash(const shared_model::interface::types::HashType &rejected_tx_hash)=0
Store a rejected tx hash.
Position of a transaction in the ledger.
Definition: indexer.hpp:26
shared_model::interface::types::HeightType height
the height of block containing this transaction
Definition: indexer.hpp:28
virtual ~Indexer()=default
Definition: indexer.hpp:21
std::string AssetIdType
Type of asset id.
Definition: types.hpp:55