6 #ifndef IROHA_CHANNEL_FACTORY_HPP 7 #define IROHA_CHANNEL_FACTORY_HPP 15 #include <grpc++/grpc++.h> 25 const std::set<std::string> &services,
29 const std::set<std::string> &services,
39 template <
typename Service>
43 {Service::service_full_name()}, params);
53 template <
typename Service>
56 std::optional<std::reference_wrapper<GrpcChannelParams const>>
59 address, Service::service_full_name(), maybe_params);
72 const std::string &service_full_name,
73 std::optional<std::reference_wrapper<GrpcChannelParams const>>
83 template <
typename Service>
85 const std::string &address,
86 std::optional<std::reference_wrapper<GrpcChannelParams const>> params) {
87 return Service::NewStub(createInsecureChannel<Service>(address, params));
98 template <
typename Service>
100 const std::string &ip,
102 std::optional<std::reference_wrapper<GrpcChannelParams const>>
104 return createInsecureClient<Service>(ip +
":" + std::to_string(port),
112 std::optional<std::shared_ptr<const GrpcChannelParams>> maybe_params);
117 getChannel(
const std::string &service_full_name,
127 std::unique_ptr<ChannelArgumentsProvider> args_;
std::shared_ptr< grpc::Channel > createInsecureChannel(const shared_model::interface::types::AddressType &address, std::optional< std::reference_wrapper< GrpcChannelParams const >> maybe_params)
Definition: channel_factory.hpp:54
std::string AddressType
Type of peer address.
Definition: types.hpp:50
Definition: channel_factory.cpp:97
Definition: result_fwd.hpp:27
Definition: grpc_channel_params.hpp:16
grpc::ChannelArguments makeChannelArguments(const std::set< std::string > &services, const GrpcChannelParams ¶ms)
Definition: channel_factory.cpp:30
Definition: block_query.hpp:15
Definition: channel_factory.hpp:108
Definition: channel_provider.hpp:24
std::unique_ptr< typename Service::StubInterface > createInsecureClient(const std::string &address, std::optional< std::reference_wrapper< GrpcChannelParams const >> params)
Definition: channel_factory.hpp:84
grpc::ChannelArguments makeInterPeerChannelArguments(const std::set< std::string > &services, const GrpcChannelParams ¶ms)
Definition: channel_factory.cpp:25