3#include <xrpld/app/main/Application.h>
4#include <xrpld/rpc/Context.h>
5#include <xrpld/rpc/GRPCHandlers.h>
6#include <xrpld/rpc/Role.h>
7#include <xrpld/rpc/detail/Handler.h>
9#include <xrpl/core/JobQueue.h>
10#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
11#include <xrpl/resource/Charge.h>
12#include <xrpl/server/InfoSub.h>
14#include <grpcpp/grpcpp.h>
58 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService
service_;
81 template <
class Request,
class Response>
83 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService&,
86 grpc::ServerAsyncResponseWriter<Response>*,
87 grpc::CompletionQueue*,
88 grpc::ServerCompletionQueue*,
93 template <
class Request,
class Response>
98 template <
class Request,
class Response>
100 org::xrpl::rpc::v1::XRPLedgerAPIService::Stub*,
101 grpc::ClientContext*,
130 [[nodiscard]] boost::asio::ip::tcp::endpoint
139 template <
class Request,
class Response>
146 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService&
service_;
149 grpc::ServerCompletionQueue&
cq_;
195 org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService& service,
196 grpc::ServerCompletionQueue& cq,
308 [[nodiscard]] boost::asio::ip::tcp::endpoint
A generic endpoint for log messages.
Forward< Request, Response > forward_
Resource::Consumer getUsage()
CallData(CallData const &)=delete
std::vector< boost::asio::ip::address > const & secureGatewayIPs_
std::optional< boost::asio::ip::address > getClientIpAddress()
org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService & service_
bool isFinished() override
Handler< Request, Response > handler_
RPC::Condition requiredCondition_
std::optional< std::string > getUser()
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)
BindListener< Request, Response > bindListener_
Role getRole(bool isUnlimited)
CallData & operator=(CallData const &)=delete
Resource::Charge getLoadType()
~CallData() override=default
std::optional< boost::asio::ip::address > getProxiedClientIpAddress()
std::optional< boost::asio::ip::tcp::endpoint > getClientEndpoint()
std::atomic_bool finished_
grpc::ServerAsyncResponseWriter< Response > responder_
std::shared_ptr< Processor > clone() override
Resource::Charge loadType_
void setIsUnlimited(Response &response, bool isUnlimited)
grpc::ServerCompletionQueue & cq_
void forwardToP2p(RPC::GRPCContext< Request > &context)
std::optional< boost::asio::ip::tcp::endpoint > getProxiedClientEndpoint()
std::uint16_t serverPort_
GRPCServerImpl & operator=(GRPCServerImpl const &)=delete
GRPCServerImpl(GRPCServerImpl const &)=delete
std::optional< std::string > sslKeyPath_
std::optional< std::string > sslCertPath_
std::function< grpc::Status( org::xrpl::rpc::v1::XRPLedgerAPIService::Stub *, grpc::ClientContext *, Request, Response *)> Forward
std::function< std::pair< Response, grpc::Status >(RPC::GRPCContext< Request > &)> Handler
std::vector< boost::asio::ip::address > secureGatewayIPs_
std::optional< std::string > sslCertChainPath_
std::unique_ptr< grpc::ServerCompletionQueue > cq_
std::vector< std::shared_ptr< Processor > > setupListeners()
std::optional< std::string > sslClientCAPath_
GRPCServerImpl(Application &app)
std::unique_ptr< grpc::Server > server_
boost::asio::ip::tcp::endpoint getEndpoint() const
std::vector< std::shared_ptr< Processor > > requests_
std::string serverAddress_
org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService service_
std::function< void( org::xrpl::rpc::v1::XRPLedgerAPIService::AsyncService &, grpc::ServerContext *, Request *, grpc::ServerAsyncResponseWriter< Response > *, grpc::CompletionQueue *, grpc::ServerCompletionQueue *, void *)> BindListener
static constexpr unsigned kApiVersion
std::shared_ptr< grpc::ServerCredentials > createServerCredentials()
boost::asio::ip::tcp::endpoint getEndpoint() const
GRPCServer & operator=(GRPCServer const &)=delete
GRPCServer(Application &app)
GRPCServer(GRPCServer const &)=delete
Processor(Processor const &)=delete
virtual ~Processor()=default
virtual bool isFinished()=0
Processor & operator=(Processor const &)=delete
virtual std::shared_ptr< Processor > clone()=0
An endpoint that consumes resources.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Role
Indicates the level of administrative permission to grant.
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.