xrpld
Loading...
Searching...
No Matches
RPCCall.h
1#pragma once
2
3#include <xrpld/core/Config.h>
4
5#include <xrpl/basics/Log.h>
6#include <xrpl/beast/utility/Journal.h>
7#include <xrpl/json/json_value.h>
8
9#include <boost/asio/io_context.hpp>
10
11#include <cstdint>
12#include <functional>
13#include <span>
14#include <string>
15#include <string_view>
16#include <unordered_map>
17#include <utility>
18#include <vector>
19
20namespace xrpl {
21
22// This a trusted interface, the user is expected to provide valid input to
23// perform valid requests. Error catching and reporting is not a requirement of
24// the command line interface.
25//
26// Improvements to be more strict and to provide better diagnostics are welcome.
27
31namespace rpc_call {
32
33int
34fromCommandLine(Config const& config, std::vector<std::string> const& vCmd, Logs& logs);
35
36void
38 boost::asio::io_context& ioContext,
39 std::string const& strIp,
40 std::uint16_t const iPort,
41 std::string const& strUsername,
42 std::string const& strPassword,
43 std::string const& strPath,
44 std::string const& strMethod,
45 json::Value const& jvParams,
46 bool const bSSL,
47 bool quiet,
48 Logs& logs,
49 std::function<void(json::Value const& jvInput)> callbackFuncP =
50 std::function<void(json::Value const& jvInput)>(),
51 std::unordered_map<std::string, std::string> headers = {});
52} // namespace rpc_call
53
54json::Value
56 std::vector<std::string> const& args,
57 json::Value& retParams,
58 unsigned int apiVersion,
59 beast::Journal j);
60
67std::span<std::string_view const>
69
74std::pair<int, json::Value>
76 std::vector<std::string> const& args,
77 Config const& config,
78 Logs& logs,
79 unsigned int apiVersion,
80 std::unordered_map<std::string, std::string> const& headers = {});
81
82} // namespace xrpl
Manages partitions for logging.
Definition Log.h:23
Processes XRPL RPC calls.
Definition RPCCall.cpp:2113
void fromNetwork(boost::asio::io_context &ioContext, std::string const &strIp, std::uint16_t const iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, json::Value const &jvParams, bool const bSSL, bool const quiet, Logs &logs, std::function< void(json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Definition RPCCall.cpp:2128
int fromCommandLine(Config const &config, std::vector< std::string > const &vCmd, Logs &logs)
Definition RPCCall.cpp:2116
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
json::Value rpcCmdToJson(std::vector< std::string > const &args, json::Value &retParams, unsigned int apiVersion, beast::Journal j)
Definition RPCCall.cpp:1916
std::span< std::string_view const > commandLineMethodNames()
Return the names of all methods accepted on the command line.
Definition RPCCall.cpp:1909
std::pair< int, json::Value > rpcClient(std::vector< std::string > const &args, Config const &config, Logs &logs, unsigned int apiVersion, std::unordered_map< std::string, std::string > const &headers)
Internal invocation of RPC client.
Definition RPCCall.cpp:1961