rippled
Loading...
Searching...
No Matches
GRPCHandlers.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2020 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_RPC_GRPCHANDLER_H_INCLUDED
21#define RIPPLE_RPC_GRPCHANDLER_H_INCLUDED
22
23#include <xrpld/rpc/Context.h>
24
25#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.pb.h>
26
27#include <grpcpp/grpcpp.h>
28
29namespace ripple {
30
31/*
32 * These handlers are for gRPC. They each take in a protobuf message that is
33 * nested inside RPC::GRPCContext<T>, where T is the request type
34 * The return value is the response type, as well as a status
35 * If the status is not Status::OK (meaning an error occurred), then only
36 * the status will be sent to the client, and the response will be ommitted
37 */
38
40doLedgerGrpc(RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerRequest>& context);
41
44 RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerEntryRequest>& context);
45
48 RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerDataRequest>& context);
49
52 RPC::GRPCContext<org::xrpl::rpc::v1::GetLedgerDiffRequest>& context);
53
54} // namespace ripple
55
56#endif
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
std::pair< org::xrpl::rpc::v1::GetLedgerResponse, grpc::Status > doLedgerGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > &context)
std::pair< org::xrpl::rpc::v1::GetLedgerEntryResponse, grpc::Status > doLedgerEntryGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerEntryRequest > &context)
std::pair< org::xrpl::rpc::v1::GetLedgerDiffResponse, grpc::Status > doLedgerDiffGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDiffRequest > &context)
Definition: LedgerDiff.cpp:6
std::pair< org::xrpl::rpc::v1::GetLedgerDataResponse, grpc::Status > doLedgerDataGrpc(RPC::GRPCContext< org::xrpl::rpc::v1::GetLedgerDataRequest > &context)
Definition: LedgerData.cpp:136