1#include <test/jtx/Env.h>
2#include <test/jtx/JSONRPCClient.h>
3#include <test/jtx/WSClient.h>
4#include <test/jtx/envconfig.h>
6#include <xrpld/app/ledger/LedgerMaster.h>
8#include <xrpl/basics/base64.h>
9#include <xrpl/beast/test/yield_to.h>
10#include <xrpl/beast/unit_test/suite.h>
11#include <xrpl/config/Constants.h>
12#include <xrpl/json/json_reader.h>
13#include <xrpl/json/json_value.h>
14#include <xrpl/json/to_string.h>
15#include <xrpl/protocol/ErrorCodes.h>
16#include <xrpl/protocol/jss.h>
17#include <xrpl/server/LoadFeeTrack.h>
18#include <xrpl/server/NetworkOPs.h>
20#include <boost/algorithm/string/predicate.hpp>
21#include <boost/asio/buffer.hpp>
22#include <boost/asio/connect.hpp>
23#include <boost/asio/io_context.hpp>
24#include <boost/asio/ip/tcp.hpp>
25#include <boost/asio/spawn.hpp>
26#include <boost/asio/ssl/context.hpp>
27#include <boost/asio/ssl/stream.hpp>
28#include <boost/asio/ssl/stream_base.hpp>
29#include <boost/asio/ssl/verify_mode.hpp>
30#include <boost/asio/write.hpp>
31#include <boost/beast/core/make_printable.hpp>
32#include <boost/beast/core/multi_buffer.hpp>
33#include <boost/beast/http/field.hpp>
34#include <boost/beast/http/status.hpp>
35#include <boost/beast/http/verb.hpp>
36#include <boost/beast/websocket/stream.hpp>
37#include <boost/lexical_cast.hpp>
52 class MyFields :
public boost::beast::http::fields
96 using namespace boost::beast::http;
97 request<string_body> req;
102 req.insert(
"User-Agent",
"test");
103 req.method(boost::beast::http::verb::get);
104 req.insert(
"Upgrade",
"websocket");
115 req.insert(
"Sec-WebSocket-Version",
"13");
116 req.insert(boost::beast::http::field::connection,
"upgrade");
128 using namespace boost::beast::http;
129 request<string_body> req;
133 for (
auto const& f : fields)
134 req.insert(f.name(), f.value());
136 req.insert(
"User-Agent",
"test");
139 req.method(boost::beast::http::verb::get);
143 req.method(boost::beast::http::verb::post);
144 req.insert(
"Content-Type",
"application/json; charset=UTF-8");
147 req.prepare_payload();
154 boost::asio::yield_context& yield,
155 boost::beast::http::request<boost::beast::http::string_body>
const& req,
159 boost::beast::http::response<boost::beast::http::string_body>& resp,
160 boost::system::error_code& ec)
163 using namespace boost::beast::http;
165 ip::tcp::resolver r{ios};
166 boost::beast::multi_buffer sb;
168 auto const it = r.async_resolve(host,
std::to_string(port), yield[ec]);
175 ssl::context ctx{ssl::context::sslv23};
176 ctx.set_verify_mode(ssl::verify_none);
177 ssl::stream<ip::tcp::socket> ss{ios, ctx};
178 async_connect(ss.next_layer(), it, yield[ec]);
181 ss.async_handshake(ssl::stream_base::client, yield[ec]);
184 boost::beast::http::async_write(ss, req, yield[ec]);
187 async_read(ss, sb, resp, yield[ec]);
193 ip::tcp::socket sock{ios};
194 async_connect(sock, it, yield[ec]);
197 boost::beast::http::async_write(sock, req, yield[ec]);
200 async_read(sock, sb, resp, yield[ec]);
209 boost::asio::yield_context& yield,
211 boost::beast::http::response<boost::beast::http::string_body>& resp,
212 boost::system::error_code& ec)
223 boost::asio::yield_context& yield,
225 boost::beast::http::response<boost::beast::http::string_body>& resp,
226 boost::system::error_code& ec,
242 bool subobject =
false)
249 jp[
"admin_user"] = user;
254 jpi[
"admin_password"] = password;
255 jp[
"admin_password"] = jpi;
259 jp[
"admin_password"] = password;
266 jrr = jrc->invoke(
"ledger_accept", jp);
271 jrr = wsc->invoke(
"ledger_accept", jp);
284 testcase <<
"Admin request over " << proto <<
", config "
285 << (admin ?
"enabled" :
"disabled") <<
", credentials "
298 auto const user = env.
app()
302 auto const password = env.
app()
311 BEAST_EXPECT(jrr[jss::error] ==
"forbidden");
313 BEAST_EXPECT(jrr[jss::error_message] ==
"Bad credentials.");
317 BEAST_EXPECT(jrr.isNull());
325 BEAST_EXPECT(jrr[jss::error] ==
"forbidden");
327 BEAST_EXPECT(jrr[jss::error_message] ==
"Bad credentials.");
331 BEAST_EXPECT(jrr.isNull());
339 BEAST_EXPECT(jrr[jss::error] ==
"forbidden");
341 BEAST_EXPECT(jrr[jss::error_message] ==
"Bad credentials.");
345 BEAST_EXPECT(jrr.isNull());
352 BEAST_EXPECT(jrr[jss::error] ==
"forbidden");
354 BEAST_EXPECT(jrr[jss::error_message] ==
"Bad credentials.");
358 BEAST_EXPECT(jrr.isNull());
364 BEAST_EXPECT(jrr[
"status"] ==
"success");
370 BEAST_EXPECT(jrr[
"status"] ==
"success");
374 BEAST_EXPECT(jrr[
"status"] ==
"success");
382 BEAST_EXPECT(jrr[jss::error] ==
"forbidden");
384 BEAST_EXPECT(jrr[jss::error_message] ==
"Bad credentials.");
388 BEAST_EXPECT(jrr.
isNull());
396 testcase(
"WS client to http server fails");
405 boost::system::error_code ec;
406 boost::beast::http::response<boost::beast::http::string_body> resp;
408 if (!BEAST_EXPECTS(!ec, ec.message()))
410 BEAST_EXPECT(resp.result() == boost::beast::http::status::unauthorized);
415 boost::system::error_code ec;
416 boost::beast::http::response<boost::beast::http::string_body> resp;
418 if (!BEAST_EXPECTS(!ec, ec.message()))
420 BEAST_EXPECT(resp.result() == boost::beast::http::status::unauthorized);
437 boost::system::error_code ec;
438 boost::beast::http::response<boost::beast::http::string_body> resp;
440 if (!BEAST_EXPECTS(!ec, ec.message()))
442 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
447 boost::system::error_code ec;
448 boost::beast::http::response<boost::beast::http::string_body> resp;
450 if (!BEAST_EXPECTS(!ec, ec.message()))
452 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
459 testcase(
"Partial WS upgrade request");
462 using namespace boost::beast::http;
471 boost::system::error_code ec;
472 response<string_body> resp;
476 auto reqString = boost::lexical_cast<std::string>(req);
477 reqString.erase(reqString.find_last_of(
"13"), std::string::npos);
480 ip::tcp::resolver r{ios};
481 boost::beast::multi_buffer sb;
483 auto const it = r.async_resolve(
485 if (!BEAST_EXPECTS(!ec, ec.message()))
488 ip::tcp::socket sock{ios};
489 async_connect(sock, it, yield[ec]);
490 if (!BEAST_EXPECTS(!ec, ec.message()))
492 async_write(sock, boost::asio::buffer(reqString), yield[ec]);
493 if (!BEAST_EXPECTS(!ec, ec.message()))
497 async_read(sock, sb, resp, yield[ec]);
505 boost::asio::yield_context& yield)
510 testcase <<
"Connect fails: " << clientProtocol <<
" client to " << serverProtocol
515 boost::beast::http::response<boost::beast::http::string_body> resp;
516 boost::system::error_code ec;
519 doHTTPRequest(env, yield, clientProtocol ==
"https", resp, ec);
524 doWSRequest(env, yield, clientProtocol ==
"wss" || clientProtocol ==
"wss2", resp, ec);
530 testAuth(
bool secure, boost::asio::yield_context& yield)
532 testcase <<
"Server with authorization, " << (secure ?
"secure" :
"non-secure");
545 jr[jss::method] =
"server_info";
546 boost::beast::http::response<boost::beast::http::string_body> resp;
547 boost::system::error_code ec;
549 BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
552 auth.insert(
"Authorization",
"");
554 BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
556 auth.set(
"Authorization",
"Basic NOT-VALID");
558 BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
560 auth.set(
"Authorization",
"Basic " +
base64Encode(
"me:badpass"));
562 BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
571 auth.set(
"Authorization",
"Basic " + user +
":" +
pass);
573 BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
578 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
579 BEAST_EXPECT(!resp.body().empty());
585 testcase <<
"Server with connection limit of " << limit;
589 using namespace boost::beast::http;
603 boost::system::error_code ec;
605 ip::tcp::resolver r{ios};
608 jr[jss::method] =
"server_info";
610 auto const it = r.async_resolve(ip,
std::to_string(port), yield[ec]);
633 int const testTo = (limit == 0) ? 50 : limit + 1;
634 while (
static_cast<int>(clients.
size()) < testTo)
636 clients.
emplace_back(ip::tcp::socket{ios}, boost::beast::multi_buffer{});
637 async_connect(clients.
back().first, it, yield[ec]);
640 async_write(clients.
back().first, req, yield[ec]);
644 int successfulReads = 0;
645 for (
auto& [soc, buf] : clients)
647 boost::beast::http::response<boost::beast::http::string_body> resp;
648 async_read(soc, buf, resp, yield[ec]);
658 int const expectedReads = (limit == 0) ?
static_cast<int>(clients.
size()) : limit - 1;
659 BEAST_EXPECT(successfulReads == expectedReads);
665 testcase(
"Connection with WS handoff");
678 boost::beast::http::response<boost::beast::http::string_body> resp;
679 boost::system::error_code ec;
681 BEAST_EXPECT(resp.result() == boost::beast::http::status::switching_protocols);
682 BEAST_EXPECT(resp.contains(
"Upgrade") && resp[
"Upgrade"] ==
"websocket");
683 BEAST_EXPECT(resp.contains(
"Connection") && boost::iequals(resp[
"Connection"],
"upgrade"));
689 testcase(
"Connection to port with no RPC enabled");
699 boost::beast::http::response<boost::beast::http::string_body> resp;
700 boost::system::error_code ec;
704 BEAST_EXPECT(resp.result() == boost::beast::http::status::forbidden);
705 BEAST_EXPECT(resp.body() ==
"Forbidden\r\n");
711 testcase(
"WS client sends assorted input");
715 using namespace boost::beast::http;
723 boost::system::error_code ec;
726 ip::tcp::resolver r{ios};
728 auto const it = r.async_resolve(ip,
std::to_string(port), yield[ec]);
729 if (!BEAST_EXPECT(!ec))
732 ip::tcp::socket sock{ios};
733 async_connect(sock, it, yield[ec]);
734 if (!BEAST_EXPECT(!ec))
737 boost::beast::websocket::stream<boost::asio::ip::tcp::socket&> ws{sock};
742 ws.async_write_some(
true, buffer(req), yield[ec]);
743 if (!BEAST_EXPECT(!ec))
746 boost::beast::multi_buffer sb;
747 ws.async_read(sb, yield[ec]);
748 if (!BEAST_EXPECT(!ec))
753 if (!BEAST_EXPECT(jr.
parse(
754 boost::lexical_cast<std::string>(boost::beast::make_printable(sb.data())),
757 sb.consume(sb.size());
762 auto resp = sendAndParse(
"NOT JSON");
763 BEAST_EXPECT(resp[jss::error] ==
"jsonInvalid");
764 BEAST_EXPECT(!resp.isMember(jss::error_code));
765 BEAST_EXPECT(resp[jss::error_message].isNull());
766 BEAST_EXPECT(!resp.isMember(jss::status));
771 jv[jss::command] =
"foo";
772 jv[jss::method] =
"bar";
774 BEAST_EXPECT(resp[jss::status] ==
"error");
775 BEAST_EXPECT(resp[jss::error] ==
"missingCommand");
776 BEAST_EXPECT(!resp.isMember(jss::error_code));
777 BEAST_EXPECT(resp[jss::error_message].isNull());
782 jv[jss::command] =
"ping";
784 BEAST_EXPECT(resp.isMember(jss::status) && resp[jss::status] ==
"success");
786 resp.isMember(jss::result) && resp[jss::result].isMember(jss::role) &&
787 resp[jss::result][jss::role] ==
"admin");
794 testcase(
"Status request over WS and RPC with/without Amendment Warning");
797 using namespace boost::beast::http;
816 auto si = env.
rpc(
"server_info")[jss::result];
817 BEAST_EXPECT(si.isMember(jss::info));
818 BEAST_EXPECT(!si[jss::info].isMember(jss::amendment_blocked));
820 BEAST_EXPECT(!si.isMember(jss::warnings));
824 si = env.
rpc(
"server_state")[jss::result];
825 BEAST_EXPECT(si.isMember(jss::state));
826 BEAST_EXPECT(!si[jss::state].isMember(jss::amendment_blocked));
828 BEAST_EXPECT(!si[jss::state].isMember(jss::warnings));
833 boost::system::error_code ec;
834 response<string_body> resp;
848 if (!BEAST_EXPECTS(!ec, ec.message()))
850 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
851 BEAST_EXPECT(resp.body().contains(
"connectivity is working."));
862 si = env.
rpc(
"server_info")[jss::result];
863 BEAST_EXPECT(si.isMember(jss::info));
864 BEAST_EXPECT(!si[jss::info].isMember(jss::amendment_blocked));
866 si[jss::info].isMember(jss::warnings) && si[jss::info][jss::warnings].isArray() &&
867 si[jss::info][jss::warnings].size() == 1 &&
872 si = env.
rpc(
"server_state")[jss::result];
873 BEAST_EXPECT(si.isMember(jss::state));
874 BEAST_EXPECT(!si[jss::state].isMember(jss::amendment_blocked));
876 si[jss::state].isMember(jss::warnings) && si[jss::state][jss::warnings].isArray() &&
877 si[jss::state][jss::warnings].size() == 1 &&
893 if (!BEAST_EXPECTS(!ec, ec.message()))
895 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
896 BEAST_EXPECT(resp.body().contains(
"connectivity is working."));
913 if (!BEAST_EXPECTS(!ec, ec.message()))
915 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
916 BEAST_EXPECT(resp.body().contains(
"connectivity is working."));
922 testcase(
"Status request over WS and RPC with/without Amendment Block");
925 using namespace boost::beast::http;
944 auto si = env.
rpc(
"server_info")[jss::result];
945 BEAST_EXPECT(si.isMember(jss::info));
946 BEAST_EXPECT(!si[jss::info].isMember(jss::amendment_blocked));
948 BEAST_EXPECT(!si.isMember(jss::warnings));
952 si = env.
rpc(
"server_state")[jss::result];
953 BEAST_EXPECT(si.isMember(jss::state));
954 BEAST_EXPECT(!si[jss::state].isMember(jss::amendment_blocked));
956 BEAST_EXPECT(!si[jss::state].isMember(jss::warnings));
961 boost::system::error_code ec;
962 response<string_body> resp;
976 if (!BEAST_EXPECTS(!ec, ec.message()))
978 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
979 BEAST_EXPECT(resp.body().contains(
"connectivity is working."));
990 si = env.
rpc(
"server_info")[jss::result];
991 BEAST_EXPECT(si.isMember(jss::info));
993 si[jss::info].isMember(jss::amendment_blocked) &&
994 si[jss::info][jss::amendment_blocked] ==
true);
996 si[jss::info].isMember(jss::warnings) && si[jss::info][jss::warnings].isArray() &&
997 si[jss::info][jss::warnings].size() == 1 &&
1001 si = env.
rpc(
"server_state")[jss::result];
1003 si[jss::state].isMember(jss::amendment_blocked) &&
1004 si[jss::state][jss::amendment_blocked] ==
true);
1006 si[jss::state].isMember(jss::warnings) && si[jss::state][jss::warnings].isArray() &&
1007 si[jss::state][jss::warnings].size() == 1 &&
1024 if (!BEAST_EXPECTS(!ec, ec.message()))
1026 BEAST_EXPECT(resp.result() == boost::beast::http::status::ok);
1027 BEAST_EXPECT(resp.body().contains(
"connectivity is working."));
1043 if (!BEAST_EXPECTS(!ec, ec.message()))
1045 BEAST_EXPECT(resp.result() == boost::beast::http::status::internal_server_error);
1046 BEAST_EXPECT(resp.body().contains(
"cannot accept clients:"));
1047 BEAST_EXPECT(resp.body().contains(
"Server version too old"));
1053 testcase(
"RPC client sends assorted input");
1058 boost::system::error_code ec;
1060 boost::beast::http::response<boost::beast::http::string_body> resp;
1062 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1063 BEAST_EXPECT(resp.body() ==
"Unable to parse request: \r\n");
1067 boost::beast::http::response<boost::beast::http::string_body> resp;
1071 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1072 BEAST_EXPECT(resp.body() ==
"Null method\r\n");
1076 boost::beast::http::response<boost::beast::http::string_body> resp;
1080 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1081 BEAST_EXPECT(resp.body() ==
"Unable to parse request: \r\n");
1085 boost::beast::http::response<boost::beast::http::string_body> resp;
1091 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1092 BEAST_EXPECT(resp.body() ==
"Unable to parse request: \r\n");
1096 boost::beast::http::response<boost::beast::http::string_body> resp;
1098 jv[jss::method] =
"batch";
1099 jv[jss::params] = 2;
1101 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1102 BEAST_EXPECT(resp.body() ==
"Malformed batch request\r\n");
1106 boost::beast::http::response<boost::beast::http::string_body> resp;
1108 jv[jss::method] =
"batch";
1110 jv[jss::params][
"invalid"] = 3;
1112 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1113 BEAST_EXPECT(resp.body() ==
"Malformed batch request\r\n");
1118 boost::beast::http::response<boost::beast::http::string_body> resp;
1121 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1122 BEAST_EXPECT(resp.body() ==
"Null method\r\n");
1126 boost::beast::http::response<boost::beast::http::string_body> resp;
1127 jv[jss::method] = 1;
1129 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1130 BEAST_EXPECT(resp.body() ==
"method is not string\r\n");
1134 boost::beast::http::response<boost::beast::http::string_body> resp;
1135 jv[jss::method] =
"";
1137 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1138 BEAST_EXPECT(resp.body() ==
"method is empty\r\n");
1142 boost::beast::http::response<boost::beast::http::string_body> resp;
1143 jv[jss::method] =
"some_method";
1144 jv[jss::params] =
"params";
1146 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1147 BEAST_EXPECT(resp.body() ==
"params unparsable\r\n");
1151 boost::beast::http::response<boost::beast::http::string_body> resp;
1153 jv[jss::params][0u] =
"not an object";
1155 BEAST_EXPECT(resp.result() == boost::beast::http::status::bad_request);
1156 BEAST_EXPECT(resp.body() ==
"params unparsable\r\n");
1163 testcase(
"Server status not okay");
1167 cfg->elbSupport =
true;
1174 boost::beast::http::response<boost::beast::http::string_body> resp;
1175 boost::system::error_code ec;
1177 BEAST_EXPECT(resp.result() == boost::beast::http::status::internal_server_error);
1178 std::regex const body{
"Server cannot accept clients"};
1186 for (
auto it : {
"http",
"ws",
"ws2"})
1193 yieldTo([&](boost::asio::yield_context& yield) {
Mix-in to support tests using asio coroutines.
boost::asio::io_context & getIoContext()
Return the io_context associated with the object.
void yieldTo(F0 &&f0, FN &&... fn)
Run one or more functions, each in a coroutine.
void pass()
Record a successful test condition.
TestcaseT testcase
Memberspace for declaring test cases.
Unserialize a JSON document into a Value.
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
bool isNull() const
isNull() tests to see if this field is null.
Value & append(Value const &value)
Append value to array at the end.
virtual Config & config()=0
Section & section(std::string const &name)
Returns the section with the given name.
void tryAdvance()
Signals that the ledger stream may be able to make progress.
virtual void setAmendmentBlocked()=0
virtual json::Value getConsensusInfo()=0
virtual bool beginConsensus(UInt256 const &netLCL, std::unique_ptr< std::stringstream > const &clog)=0
virtual void setAmendmentWarned()=0
std::optional< T > get(std::string const &name) const
virtual NetworkOPs & getOPs()=0
virtual LoadFeeTrack & getFeeTrack()=0
virtual LedgerMaster & getLedgerMaster()=0
void testWSClientToHttpServer(boost::asio::yield_context &yield)
void doWSRequest(test::jtx::Env &env, boost::asio::yield_context &yield, bool secure, boost::beast::http::response< boost::beast::http::string_body > &resp, boost::system::error_code &ec)
void doHTTPRequest(test::jtx::Env &env, boost::asio::yield_context &yield, bool secure, boost::beast::http::response< boost::beast::http::string_body > &resp, boost::system::error_code &ec, std::string const &body="", MyFields const &fields={})
void testAmendmentBlock(boost::asio::yield_context &yield)
static auto makeWSUpgrade(std::string const &host, uint16_t port)
void testNoRPC(boost::asio::yield_context &yield)
void testWSHandoff(boost::asio::yield_context &yield)
void testTruncatedWSUpgrade(boost::asio::yield_context &yield)
void testAdminRequest(std::string const &proto, bool admin, bool credentials)
void testRPCRequests(boost::asio::yield_context &yield)
void testStatusNotOkay(boost::asio::yield_context &yield)
static auto makeAdminRequest(jtx::Env &env, std::string const &proto, std::string const &user, std::string const &password, bool subobject=false)
void run() override
Runs the suite.
void testCantConnect(std::string const &clientProtocol, std::string const &serverProtocol, boost::asio::yield_context &yield)
void testAmendmentWarning(boost::asio::yield_context &yield)
void doRequest(boost::asio::yield_context &yield, boost::beast::http::request< boost::beast::http::string_body > const &req, std::string const &host, uint16_t port, bool secure, boost::beast::http::response< boost::beast::http::string_body > &resp, boost::system::error_code &ec)
void testAuth(bool secure, boost::asio::yield_context &yield)
void testLimit(boost::asio::yield_context &yield, int limit)
void testWSRequests(boost::asio::yield_context &yield)
static auto makeHTTPRequest(std::string const &host, uint16_t port, std::string const &body, MyFields const &fields)
static auto makeConfig(std::string const &proto, bool admin=true, bool credentials=false)
void testStatusRequest(boost::asio::yield_context &yield)
A transaction testing environment.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
std::shared_ptr< ReadView const > closed()
Returns the last closed ledger.
bool disconnectClient(std::chrono::steady_clock::duration timeout=std::chrono::seconds{1})
Disconnect the Env's built-in client and wait for the server to register the dropped connection.
json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
T emplace_back(T... args)
@ Array
array value (ordered list)
@ Object
object value (collection of name/value pairs).
std::unique_ptr< Config > singleThreadIo(std::unique_ptr< Config >)
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
std::unique_ptr< Config > validator(std::unique_ptr< Config >, std::string const &)
adjust configuration with params needed to be a validator
BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl)
std::unique_ptr< AbstractClient > makeJSONRPCClient(Config const &cfg, unsigned rpcVersion)
Returns a client using JSON-RPC over HTTP/S.
char const * getEnvLocalhostAddr()
std::unique_ptr< WSClient > makeWSClient(Config const &cfg, bool v2, unsigned rpcVersion, std::unordered_map< std::string, std::string > const &headers)
Returns a client operating through WebSockets/S.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
@ WarnRpcAmendmentBlocked
@ WarnRpcUnsupportedMajority
std::string to_string(BaseUInt< Bits, Tag > const &a)
std::string base64Encode(std::uint8_t const *data, std::size_t len)
T regex_search(T... args)
static constexpr auto kProtocol
static constexpr auto kLimit
static constexpr auto kAdminPassword
static constexpr auto kUser
static constexpr auto kAdmin
static constexpr auto kPort
static constexpr auto kIp
static constexpr auto kAdminUser
static constexpr auto kPassword
static constexpr auto kPortWs
static constexpr auto kServer
static constexpr auto kPortRpc