diff --git a/cfg/rippled-example.cfg b/cfg/rippled-example.cfg index e5a208c56..be9f22815 100644 --- a/cfg/rippled-example.cfg +++ b/cfg/rippled-example.cfg @@ -867,7 +867,7 @@ # # source_ip = # -# Required. IP address of the ETL source +# Required. IP address of the ETL source. Can also be a DNS record. # # source_ws_port = # diff --git a/src/ripple/app/reporting/ETLSource.cpp b/src/ripple/app/reporting/ETLSource.cpp index 2a249cd87..5036ca910 100644 --- a/src/ripple/app/reporting/ETLSource.cpp +++ b/src/ripple/app/reporting/ETLSource.cpp @@ -63,14 +63,28 @@ ETLSource::ETLSource( , app_(etl_.getApplication()) , timer_(ioc_) { + std::string connectionString; + try + { + connectionString = + beast::IP::Endpoint( + boost::asio::ip::make_address(ip_), std::stoi(grpcPort_)) + .to_string(); + + JLOG(journal_.info()) + << "Using IP to connect to ETL source: " << connectionString; + } + catch (std::exception const&) + { + connectionString = "dns:" + ip_ + ":" + grpcPort_; + JLOG(journal_.info()) + << "Using DNS to connect to ETL source: " << connectionString; + } try { stub_ = org::xrpl::rpc::v1::XRPLedgerAPIService::NewStub( grpc::CreateChannel( - beast::IP::Endpoint( - boost::asio::ip::make_address(ip_), std::stoi(grpcPort_)) - .to_string(), - grpc::InsecureChannelCredentials())); + connectionString, grpc::InsecureChannelCredentials())); JLOG(journal_.info()) << "Made stub for remote = " << toString(); } catch (std::exception const& e)