hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
block_loader_service.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_BLOCK_LOADER_SERVICE_HPP
7 #define IROHA_BLOCK_LOADER_SERVICE_HPP
8 
11 #include "loader.grpc.pb.h"
12 #include "logger/logger_fwd.hpp"
13 
14 namespace iroha {
15  namespace network {
16  class BlockLoaderService : public proto::Loader::Service {
17  public:
19  std::shared_ptr<ametsuchi::BlockQueryFactory> block_query_factory,
20  std::shared_ptr<iroha::consensus::ConsensusResultCache>
21  consensus_result_cache,
22  logger::LoggerPtr log);
23 
24  grpc::Status retrieveBlocks(
25  ::grpc::ServerContext *context,
26  const proto::BlocksRequest *request,
27  ::grpc::ServerWriter<protocol::Block> *writer) override;
28 
29  grpc::Status retrieveBlock(::grpc::ServerContext *context,
30  const proto::BlockRequest *request,
31  protocol::Block *response) override;
32 
33  private:
34  std::shared_ptr<ametsuchi::BlockQueryFactory> block_query_factory_;
35  std::shared_ptr<iroha::consensus::ConsensusResultCache>
36  consensus_result_cache_;
37  logger::LoggerPtr log_;
38  };
39  } // namespace network
40 } // namespace iroha
41 
42 #endif // IROHA_BLOCK_LOADER_SERVICE_HPP
BlockLoaderService(std::shared_ptr< ametsuchi::BlockQueryFactory > block_query_factory, std::shared_ptr< iroha::consensus::ConsensusResultCache > consensus_result_cache, logger::LoggerPtr log)
Definition: block_loader_service.cpp:16
grpc::Status retrieveBlock(::grpc::ServerContext *context, const proto::BlockRequest *request, protocol::Block *response) override
Definition: block_loader_service.cpp:44
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: block_loader_service.hpp:16
Definition: block_query.hpp:16
grpc::Status retrieveBlocks(::grpc::ServerContext *context, const proto::BlocksRequest *request,::grpc::ServerWriter< protocol::Block > *writer) override
Definition: block_loader_service.cpp:25