mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Support ipv6 for peer and RPC comms:
Fixes: RIPD-1574 Alias beast address classes to the asio equivalents. Adjust users of address classes accordingly. Fix resolver class so that it can support ipv6 addresses. Make unit tests use ipv6 localhost network. Extend endpoint peer message to support string endpoint representations while also supporting the existing fields (both are optional/repeated types). Expand test for Livecache and Endpoint. Workaround some false positive ipaddr tests on windows (asio bug?) Replaced usage of address::from_string(deprecated) with free function make_address. Identified a remaining use of v4 address type and replaced with the more appropriate IPEndpoint type (rpc_ip cmdline option). Add CLI flag for using ipv4 with unit tests. Release Notes ------------- The optional rpc_port command line flag is deprecated. The rpc_ip parameter now works as documented and accepts ip and port combined.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <ripple/protocol/Feature.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <test/jtx.h>
|
||||
#include <test/jtx/envconfig.h>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <ripple/beast/utility/temp_dir.h>
|
||||
#include <ripple/resource/ResourceManager.h>
|
||||
@@ -265,7 +266,7 @@ class NoRippleCheckLimits_test : public beast::unit_test::suite
|
||||
using namespace std::chrono;
|
||||
using namespace beast::IP;
|
||||
auto c = env.app().getResourceManager()
|
||||
.newInboundEndpoint (Endpoint::from_string ("127.0.0.1"));
|
||||
.newInboundEndpoint (Endpoint::from_string (test::getEnvLocalhostAddr()));
|
||||
if (dropThreshold - c.balance() <= 20)
|
||||
{
|
||||
using clock_type = beast::abstract_clock <steady_clock>;
|
||||
|
||||
@@ -178,8 +178,6 @@ public:
|
||||
testDynamicUNL()
|
||||
{
|
||||
using namespace test::jtx;
|
||||
using endpoint_type = boost::asio::ip::tcp::endpoint;
|
||||
using address_type = boost::asio::ip::address;
|
||||
|
||||
auto toStr = [](PublicKey const& publicKey) {
|
||||
return toBase58(TokenType::NodePublic, publicKey);
|
||||
@@ -208,7 +206,9 @@ public:
|
||||
// Publisher list site unavailable
|
||||
{
|
||||
// Publisher site information
|
||||
std::string siteURI = "http://127.0.0.1:1234/validators";
|
||||
using namespace std::string_literals;
|
||||
std::string siteURI =
|
||||
"http://"s + getEnvLocalhostAddr() + ":1234/validators";
|
||||
|
||||
Env env{
|
||||
*this,
|
||||
@@ -271,9 +271,6 @@ public:
|
||||
{
|
||||
NetClock::time_point const expiration{3600s};
|
||||
|
||||
// 0 port means to use OS port selection
|
||||
endpoint_type ep{address_type::from_string("127.0.0.1"), 0};
|
||||
|
||||
// Manage single thread io_service for server
|
||||
struct Worker : BasicApp
|
||||
{
|
||||
@@ -282,7 +279,6 @@ public:
|
||||
Worker w;
|
||||
|
||||
TrustedPublisherServer server(
|
||||
ep,
|
||||
w.get_io_service(),
|
||||
publisherSigningKeys,
|
||||
manifest,
|
||||
@@ -291,9 +287,9 @@ public:
|
||||
1,
|
||||
validators);
|
||||
|
||||
endpoint_type const & local_ep = server.local_endpoint();
|
||||
std::string siteURI = "http://127.0.0.1:" +
|
||||
std::to_string(local_ep.port()) + "/validators";
|
||||
std::stringstream uri;
|
||||
uri << "http://" << server.local_endpoint() << "/validators";
|
||||
auto siteURI = uri.str();
|
||||
|
||||
Env env{
|
||||
*this,
|
||||
|
||||
Reference in New Issue
Block a user