hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
query_service.hpp
Go to the documentation of this file.
1 
6 #ifndef TORII_QUERY_SERVICE_HPP
7 #define TORII_QUERY_SERVICE_HPP
8 
9 #include <unordered_map>
10 #include "endpoint.grpc.pb.h"
11 #include "endpoint.pb.h"
12 #include "qry_responses.pb.h"
13 
17 #include "cache/cache.hpp"
19 
20 #include "logger/logger.hpp"
21 
22 namespace shared_model {
23  namespace interface {
24  template <typename Interface, typename Transport>
26  }
27 } // namespace shared_model
28 
29 namespace iroha {
30  namespace torii {
36  class QueryService : public iroha::protocol::QueryService_v1::Service {
37  public:
38  using QueryFactoryType =
42 
44  std::shared_ptr<iroha::torii::QueryProcessor> query_processor,
45  std::shared_ptr<QueryFactoryType> query_factory,
46  logger::Logger log = logger::log("Query Service"));
47 
48  QueryService(const QueryService &) = delete;
49  QueryService &operator=(const QueryService &) = delete;
50 
56  void Find(iroha::protocol::Query const &request,
58 
59  grpc::Status Find(grpc::ServerContext *context,
60  const iroha::protocol::Query *request,
61  iroha::protocol::QueryResponse *response) override;
62 
63  grpc::Status FetchCommits(
64  grpc::ServerContext *context,
65  const iroha::protocol::BlocksQuery *request,
66  grpc::ServerWriter<::iroha::protocol::BlockQueryResponse> *writer)
67  override;
68 
69  private:
70  std::shared_ptr<iroha::torii::QueryProcessor> query_processor_;
71  std::shared_ptr<QueryFactoryType> query_factory_;
72 
76  cache_;
77 
78  logger::Logger log_;
79  };
80  } // namespace torii
81 } // namespace iroha
82 
83 #endif // TORII_QUERY_SERVICE_HPP
Definition: hash.hpp:18
Definition: command_client.hpp:16
Definition: query.hpp:34
std::shared_ptr< spdlog::logger > Logger
Definition: logger.hpp:26
static const model::converters::PbQueryFactory query_factory
Definition: sha3_hash.cpp:15
Definition: block_query.hpp:16
Logger log(const std::string &tag)
Definition: logger.cpp:48
Definition: query_service.hpp:36
Definition: cache.hpp:25
Definition: command_executor.hpp:12
Definition: hash.hpp:23