hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
mst_transport_grpc.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_MST_TRANSPORT_GRPC_HPP
7 #define IROHA_MST_TRANSPORT_GRPC_HPP
8 
9 #include "mst.grpc.pb.h"
11 
17 #include "logger/logger.hpp"
20 
21 namespace iroha {
22 
23  namespace ametsuchi {
24  class TxPresenceCache;
25  }
26 
27  namespace network {
29  public transport::MstTransportGrpc::Service {
30  public:
31  using TransportFactoryType =
35 
38  async_call,
39  std::shared_ptr<TransportFactoryType> transaction_factory,
40  std::shared_ptr<shared_model::interface::TransactionBatchParser>
41  batch_parser,
42  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
43  transaction_batch_factory,
44  std::shared_ptr<iroha::ametsuchi::TxPresenceCache> tx_presence_cache,
45  std::shared_ptr<Completer> mst_completer,
47 
55  grpc::Status SendState(
56  ::grpc::ServerContext *context,
57  const ::iroha::network::transport::MstState *request,
58  ::google::protobuf::Empty *response) override;
59 
60  void subscribe(
61  std::shared_ptr<MstTransportNotification> notification) override;
62 
63  void sendState(const shared_model::interface::Peer &to,
64  ConstRefState providing_state) override;
65 
66  private:
71  deserializeTransactions(const transport::MstState *request);
72 
73  std::weak_ptr<MstTransportNotification> subscriber_;
74  std::shared_ptr<network::AsyncGrpcClient<google::protobuf::Empty>>
75  async_call_;
76  std::shared_ptr<TransportFactoryType> transaction_factory_;
77  std::shared_ptr<shared_model::interface::TransactionBatchParser>
78  batch_parser_;
79  std::shared_ptr<shared_model::interface::TransactionBatchFactory>
80  batch_factory_;
81  std::shared_ptr<iroha::ametsuchi::TxPresenceCache> tx_presence_cache_;
83  std::shared_ptr<Completer> mst_completer_;
84  const std::string my_key_;
85  };
86 
89  const shared_model::crypto::PublicKey &sender_key,
91 
92  } // namespace network
93 } // namespace iroha
94 
95 #endif // IROHA_MST_TRANSPORT_GRPC_HPP
Definition: peer.hpp:18
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
Definition: mst_transport_grpc.hpp:28
void sendStateAsync(const shared_model::interface::Peer &to, iroha::ConstRefState state, const shared_model::crypto::PublicKey &sender_key, AsyncGrpcClient< google::protobuf::Empty > &async_call)
Definition: mst_transport_grpc.cpp:160
Definition: block_query.hpp:16
Definition: mst_transport.hpp:37
Definition: public_key.hpp:16
Definition: async_grpc_client.hpp:25
Definition: transaction.hpp:22
std::vector< std::shared_ptr< Transaction >> SharedTxsCollectionType
Definition: transaction_sequence_common.hpp:27
ConstRefT< MstState > ConstRefState
Definition: mst_types.hpp:38