20 #ifndef RIPPLE_CORE_GRPCSERVER_H_INCLUDED
21 #define RIPPLE_CORE_GRPCSERVER_H_INCLUDED
23 #include <ripple/app/main/Application.h>
24 #include <ripple/core/JobQueue.h>
25 #include <ripple/net/InfoSub.h>
26 #include <ripple/protocol/ErrorCodes.h>
27 #include <ripple/resource/Charge.h>
28 #include <ripple/rpc/Context.h>
29 #include <ripple/rpc/GRPCHandlers.h>
30 #include <ripple/rpc/Role.h>
31 #include <ripple/rpc/impl/Handler.h>
32 #include <ripple/rpc/impl/RPCHelpers.h>
33 #include <ripple/rpc/impl/Tuning.h>
35 #include "org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h"
36 #include <grpcpp/grpcpp.h>
80 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService
service_;
95 template <
class Request,
class Response>
97 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService&,
100 grpc::ServerAsyncResponseWriter<Response>*,
101 grpc::CompletionQueue*,
102 grpc::ServerCompletionQueue*,
107 template <
class Request,
class Response>
113 template <
class Request,
class Response>
115 org::xrpl::rpc::v1::XRPLedgerAPIService::Stub*,
116 grpc::ClientContext*,
146 template <
class Request,
class Response>
154 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService&
service_;
157 grpc::ServerCompletionQueue&
cq_;
203 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService& service,
204 grpc::ServerCompletionQueue& cq,
std::shared_ptr< Processor > clone() override
CallData & operator=(const CallData &)=delete
static constexpr unsigned apiVersion
std::vector< boost::asio::ip::address > secureGatewayIPs_
std::vector< boost::asio::ip::address > const & secureGatewayIPs_
org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService service_
std::vector< std::shared_ptr< Processor > > requests_
grpc::ServerCompletionQueue & cq_
RPC::Condition requiredCondition_
std::unique_ptr< grpc::Server > server_
virtual bool isFinished() override
std::atomic_bool finished_
Handler< Request, Response > handler_
virtual bool isFinished()=0
CallData(org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService &service, grpc::ServerCompletionQueue &cq, Application &app, BindListener< Request, Response > bindListener, Handler< Request, Response > handler, Forward< Request, Response > forward, RPC::Condition requiredCondition, Resource::Charge loadType, std::vector< boost::asio::ip::address > const &secureGatewayIPs)
org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService & service_
Forward< Request, Response > forward_
std::unique_ptr< grpc::ServerCompletionQueue > cq_
Resource::Consumer getUsage()
GRPCServer & operator=(const GRPCServer &)=delete
Processor & operator=(const Processor &)=delete
GRPCServerImpl & operator=(const GRPCServerImpl &)=delete
GRPCServerImpl(Application &app)
A generic endpoint for log messages.
Resource::Charge getLoadType()
std::optional< boost::asio::ip::tcp::endpoint > getProxiedClientEndpoint()
void setIsUnlimited(Response &response, bool isUnlimited)
BindListener< Request, Response > bindListener_
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Resource::Charge loadType_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::vector< std::shared_ptr< Processor > > setupListeners()
An endpoint that consumes resources.
virtual std::shared_ptr< Processor > clone()=0
GRPCServer(Application &app)
Role getRole(bool isUnlimited)
std::optional< boost::asio::ip::address > getProxiedClientIpAddress()
void forwardToP2p(RPC::GRPCContext< Request > &context)
std::optional< boost::asio::ip::tcp::endpoint > getClientEndpoint()
virtual ~CallData()=default
virtual ~Processor()=default
std::optional< std::string > getUser()
Role
Indicates the level of administrative permission to grant.
virtual void process() override
std::string serverAddress_
grpc::ServerAsyncResponseWriter< Response > responder_
std::optional< boost::asio::ip::address > getClientIpAddress()