From 5d03351dd7a3be8f7877b11b11553a87347bd96d Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 14:18:44 -0800 Subject: [PATCH 1/9] UT: Fix example http server. --- test/config-example.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/config-example.js b/test/config-example.js index 0e6a64f937..1df83b72f1 100644 --- a/test/config-example.js +++ b/test/config-example.js @@ -37,7 +37,7 @@ exports.servers = { exports.http_servers = { // A local test server - "alpha-http" : { + "zed" : { "ip" : "127.0.0.1", "port" : 8088, } From 98fec1fd2f57b4835d46502449431db067ad2fb0 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 21:40:28 -0800 Subject: [PATCH 2/9] Update README. --- README | 10 ---------- README.md | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index 491939d739..0000000000 --- a/README +++ /dev/null @@ -1,10 +0,0 @@ -Dependancies: -- boost 1.47 -- Google protocol buffers 2.4.1 -- openssl - -Sub modules: -- websocketpp: https://github.com/zaphoyd/websocketpp -- sjcl: https://github.com/bitwiseshiftleft/sjcl -- cryptojs: https://github.com/gwjjeff/cryptojs - aka http://code.google.com/p/crypto-js/ diff --git a/README.md b/README.md new file mode 100644 index 0000000000..606259378d --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +Ripple - P2P Payment Network +============================ + +Some portions of this source code are currently closed source. + +This the repository for Ripple's: +* rippled - P2P network server +* ripple.js - JavaScript client libraries. + +Build instructions: +* See: https://ripple.com/wiki/Rippled_build_instructions + +Setup instructions: +* See: https://ripple.com/wiki/Rippled_setup_instructions + +For more information: +* See: https://ripple.com +* See: https://ripple.com/wiki From 12b4273a74c517bd4b3d8bbe888af6add09c746a Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 21:42:27 -0800 Subject: [PATCH 3/9] JS: Add support for client knowing about connecting to testnet server. --- src/js/remote.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/remote.js b/src/js/remote.js index e87feead68..9e46470b49 100644 --- a/src/js/remote.js +++ b/src/js/remote.js @@ -199,7 +199,8 @@ var Remote = function (opts, trace) { this._ledger_current_index = undefined; this._ledger_hash = undefined; this._ledger_time = undefined; - this.stand_alone = undefined; + this._stand_alone = undefined; + this._testnet = undefined; this.online_target = false; this.online_state = 'closed'; // 'open', 'closed', 'connecting', 'closing' this.state = 'offline'; // 'online', 'offline' @@ -859,7 +860,8 @@ Remote.prototype._server_subscribe = function () { this.request_subscribe([ 'ledger', 'server' ]) .on('success', function (message) { - self.stand_alone = !!message.stand_alone; + self._stand_alone = !!message.stand_alone; + self._testnet = !!message.testnet; if (message.random) self.emit('random', utils.hexToArray(message.random)); @@ -899,7 +901,7 @@ Remote.prototype._server_subscribe = function () { // A good way to be notified of the result of this is: // remote.once('ledger_closed', function (ledger_closed, ledger_index) { ... } ); Remote.prototype.ledger_accept = function () { - if (this.stand_alone || undefined === this.stand_alone) + if (this._stand_alone || undefined === this._stand_alone) { var request = new Request(this, 'ledger_accept'); From 3781555bda9d686f2dc5200f62b9537cc6009260 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 22:51:21 -0800 Subject: [PATCH 4/9] Add --testnet flag. --- src/cpp/ripple/Config.cpp | 34 ++++++++++++++++++++++++++++------ src/cpp/ripple/Config.h | 16 +++++++++++++--- src/cpp/ripple/HashPrefixes.h | 15 ++++++++++++--- src/cpp/ripple/main.cpp | 3 ++- 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/cpp/ripple/Config.cpp b/src/cpp/ripple/Config.cpp index 943b5b727e..b2700dbea5 100644 --- a/src/cpp/ripple/Config.cpp +++ b/src/cpp/ripple/Config.cpp @@ -4,6 +4,7 @@ #include "Config.h" #include "utils.h" +#include "HashPrefixes.h" #include #include @@ -56,10 +57,12 @@ #define DEFAULT_FEE_OPERATION 1 Config theConfig; +const char* ALPHABET; -void Config::setup(const std::string& strConf, bool bQuiet) +void Config::setup(const std::string& strConf, bool bTestNet, bool bQuiet) { boost::system::error_code ec; + std::string strDbPath, strConfFile; // // Determine the config and data directories. @@ -67,21 +70,39 @@ void Config::setup(const std::string& strConf, bool bQuiet) // that with "db" as the data directory. // + TESTNET = bTestNet; QUIET = bQuiet; + // TESTNET forces a "test-" prefix on the conf file and db directory. + strDbPath = TESTNET ? "test-db" : "db"; + strConfFile = boost::str(boost::format(TESTNET ? "test-%s" : "%s") + % (strConf.empty() ? CONFIG_FILE_NAME : strConf)); + + VALIDATORS_BASE = boost::str(boost::format(TESTNET ? "test-%s" : "%s") + % VALIDATORS_FILE_NAME); + VALIDATORS_URI = boost::str(boost::format("/%s") % VALIDATORS_BASE); + + SIGN_TRANSACTION = TESTNET ? sHP_TestNetTransactionSign : sHP_TransactionSign; + SIGN_VALIDATION = TESTNET ? sHP_TestNetValidation : sHP_Validation; + SIGN_PROPOSAL = TESTNET ? sHP_TestNetProposal : sHP_Proposal; + + ALPHABET = TESTNET + ? "RPShNAF39wBUDnEGHJKLM4pQrsT7VWXYZ2bcdeCg65jkm8ofqi1tuvaxyz" + : "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"; + if (!strConf.empty()) { // --conf= : everything is relative that file. - CONFIG_FILE = strConf; + CONFIG_FILE = strConfFile; CONFIG_DIR = CONFIG_FILE; CONFIG_DIR.remove_filename(); - DATA_DIR = CONFIG_DIR / "db"; + DATA_DIR = CONFIG_DIR / strDbPath; } else { CONFIG_DIR = boost::filesystem::current_path(); - CONFIG_FILE = CONFIG_DIR / CONFIG_FILE_NAME; - DATA_DIR = CONFIG_DIR / "db"; + CONFIG_FILE = CONFIG_DIR / strConfFile; + DATA_DIR = CONFIG_DIR / strDbPath; if (exists(CONFIG_FILE) // Can we figure out XDG dirs? @@ -111,7 +132,7 @@ void Config::setup(const std::string& strConf, bool bQuiet) } CONFIG_DIR = str(boost::format("%s/" SYSTEM_NAME) % strXdgConfigHome); - CONFIG_FILE = CONFIG_DIR / CONFIG_FILE_NAME; + CONFIG_FILE = CONFIG_DIR / strConfFile; DATA_DIR = str(boost::format("%s/" SYSTEM_NAME) % strXdgDataHome); boost::filesystem::create_directories(CONFIG_DIR, ec); @@ -140,6 +161,7 @@ Config::Config() // Defaults // + TESTNET = false; NETWORK_START_TIME = 1319844908; PEER_PORT = SYSTEM_PEER_PORT; diff --git a/src/cpp/ripple/Config.h b/src/cpp/ripple/Config.h index ca575ddf10..d43de2a6c3 100644 --- a/src/cpp/ripple/Config.h +++ b/src/cpp/ripple/Config.h @@ -19,7 +19,7 @@ #define SYSTEM_CURRENCY_PARTS 1000000ull // 10^SYSTEM_CURRENCY_PRECISION #define SYSTEM_CURRENCY_START (SYSTEM_CURRENCY_GIFT*SYSTEM_CURRENCY_USERS*SYSTEM_CURRENCY_PARTS) -#define CONFIG_FILE_NAME SYSTEM_NAME "d.cfg" // rippled.cfg +#define CONFIG_FILE_NAME SYSTEM_NAME "d.cfg" // rippled.cfg #define DEFAULT_VALIDATORS_SITE "" #define VALIDATORS_FILE_NAME "validators.txt" @@ -47,14 +47,17 @@ class Config public: // Configuration parameters bool QUIET; + bool TESTNET; boost::filesystem::path CONFIG_FILE; boost::filesystem::path CONFIG_DIR; boost::filesystem::path DATA_DIR; boost::filesystem::path DEBUG_LOGFILE; - boost::filesystem::path VALIDATORS_FILE; + boost::filesystem::path VALIDATORS_FILE; // As specifed in rippled.cfg. std::string VALIDATORS_SITE; // Where to find validators.txt on the Internet. + std::string VALIDATORS_URI; // URI of validators.txt. + std::string VALIDATORS_BASE; // Name with testnet-, if needed. std::vector VALIDATORS; // Validators from rippled.cfg. std::vector IPS; // Peer IPs from rippled.cfg. std::vector SNTP_SERVERS; // SNTP servers from rippled.cfg. @@ -120,12 +123,19 @@ public: // Client behavior int ACCOUNT_PROBE_MAX; // How far to scan for accounts. + // Signing signatures. + uint32 SIGN_TRANSACTION; + uint32 SIGN_VALIDATION; + uint32 SIGN_PROPOSAL; + Config(); - void setup(const std::string& strConf, bool bQuiet); + + void setup(const std::string& strConf, bool bTestNet, bool bQuiet); void load(); }; extern Config theConfig; + #endif // vim:ts=4 diff --git a/src/cpp/ripple/HashPrefixes.h b/src/cpp/ripple/HashPrefixes.h index 832349ec64..799b66e625 100644 --- a/src/cpp/ripple/HashPrefixes.h +++ b/src/cpp/ripple/HashPrefixes.h @@ -6,9 +6,6 @@ // TXN - Hash of transaction plus signature to give transaction ID const uint32 sHP_TransactionID = 0x54584E00; -// STX - Hash of inner transaction to sign -const uint32 sHP_TransactionSign = 0x53545800; - // TND - Hash of transaction plus metadata const uint32 sHP_TransactionNode = 0x534E4400; @@ -21,12 +18,24 @@ const uint32 sHP_InnerNode = 0x4D494E00; // LGR - Hash of ledger master data for signing const uint32 sHP_Ledger = 0x4C575200; +// STX - Hash of inner transaction to sign +const uint32 sHP_TransactionSign = 0x53545800; + // VAL - Hash of validation for signing const uint32 sHP_Validation = 0x56414C00; // PRP - Hash of proposal for signing const uint32 sHP_Proposal = 0x50525000; +// stx - TESTNET Hash of inner transaction to sign +const uint32 sHP_TestNetTransactionSign = 0x73747800; + +// val - TESTNET Hash of validation for signing +const uint32 sHP_TestNetValidation = 0x76616C00; + +// prp - TESTNET Hash of proposal for signing +const uint32 sHP_TestNetProposal = 0x70727000; + #endif // vim:ts=4 diff --git a/src/cpp/ripple/main.cpp b/src/cpp/ripple/main.cpp index 3636b0fd9b..6f11ae8080 100644 --- a/src/cpp/ripple/main.cpp +++ b/src/cpp/ripple/main.cpp @@ -120,7 +120,6 @@ int main(int argc, char* argv[]) iResult = 2; } - if (iResult) { nothing(); @@ -154,6 +153,7 @@ int main(int argc, char* argv[]) if (vm.count("unittest")) { unit_test_main(init_unit_test, argc, argv); + return 0; } @@ -161,6 +161,7 @@ int main(int argc, char* argv[]) { theConfig.setup( vm.count("conf") ? vm["conf"].as() : "", // Config file. + !!vm.count("testnet"), // Testnet flag. !!vm.count("quiet")); // Quiet flag. if (vm.count("standalone")) From dfccda5ba8a1b592203b6772ee2bf4f7131b2a9f Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 22:54:29 -0800 Subject: [PATCH 5/9] Announce --testnet in Hello. --- src/cpp/ripple/Peer.cpp | 10 +++++++++- src/cpp/ripple/ripple.proto | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cpp/ripple/Peer.cpp b/src/cpp/ripple/Peer.cpp index 5340075430..c1b3676abd 100644 --- a/src/cpp/ripple/Peer.cpp +++ b/src/cpp/ripple/Peer.cpp @@ -627,7 +627,14 @@ void Peer::recvHello(ripple::TMHello& packet) } #endif - if (packet.has_nettime() && ((packet.nettime() < minTime) || (packet.nettime() > maxTime))) + if ((packet.has_testnet() && packet.testnet()) != theConfig.TESTNET) + { + // Format: actual/requested. + cLog(lsINFO) << boost::str(boost::format("Recv(Hello): Network mismatch: %d/%d") + % packet.testnet() + % theConfig.TESTNET); + } + else if (packet.has_nettime() && ((packet.nettime() < minTime) || (packet.nettime() > maxTime))) { if (packet.nettime() > maxTime) { @@ -1619,6 +1626,7 @@ void Peer::sendHello() h.set_nodeproof(&vchSig[0], vchSig.size()); h.set_ipv4port(theConfig.PEER_PORT); h.set_nodeprivate(theConfig.PEER_PRIVATE); + h.set_testnet(theConfig.TESTNET); Ledger::pointer closedLedger = theApp->getLedgerMaster().getClosedLedger(); if (closedLedger && closedLedger->isClosed()) diff --git a/src/cpp/ripple/ripple.proto b/src/cpp/ripple/ripple.proto index 3e238ddeb6..e0d6c3257c 100644 --- a/src/cpp/ripple/ripple.proto +++ b/src/cpp/ripple/ripple.proto @@ -71,6 +71,7 @@ message TMHello { optional bytes ledgerPrevious = 10; // the ledger before the last closed ledger optional bool nodePrivate = 11; // Request to not forward IP. optional TMProofWork proofOfWork = 12; // request/provide proof of work + optional bool testNet = 13; // Running as testnet. } From 511587da5d75c3dba454f7f97d250a57b2d13986 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 22:55:47 -0800 Subject: [PATCH 6/9] Sign based on --testnet. --- src/cpp/ripple/LedgerProposal.cpp | 2 +- src/cpp/ripple/SerializedTransaction.cpp | 2 +- src/cpp/ripple/SerializedValidation.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpp/ripple/LedgerProposal.cpp b/src/cpp/ripple/LedgerProposal.cpp index 5f5f058735..7d4d193ca0 100644 --- a/src/cpp/ripple/LedgerProposal.cpp +++ b/src/cpp/ripple/LedgerProposal.cpp @@ -42,7 +42,7 @@ uint256 LedgerProposal::getSigningHash() const { Serializer s((32 + 32 + 32 + 256 + 256) / 8); - s.add32(sHP_Proposal); + s.add32(theConfig.SIGN_PROPOSAL); s.add32(mProposeSeq); s.add32(mCloseTime); s.add256(mPreviousLedger); diff --git a/src/cpp/ripple/SerializedTransaction.cpp b/src/cpp/ripple/SerializedTransaction.cpp index 7b5a58afc6..115f8343e9 100644 --- a/src/cpp/ripple/SerializedTransaction.cpp +++ b/src/cpp/ripple/SerializedTransaction.cpp @@ -126,7 +126,7 @@ std::vector SerializedTransaction::getAffectedAccounts() const uint256 SerializedTransaction::getSigningHash() const { - return STObject::getSigningHash(sHP_TransactionSign); + return STObject::getSigningHash(theConfig.SIGN_TRANSACTION); } uint256 SerializedTransaction::getTransactionID() const diff --git a/src/cpp/ripple/SerializedValidation.cpp b/src/cpp/ripple/SerializedValidation.cpp index 3f502d447c..f50ed08947 100644 --- a/src/cpp/ripple/SerializedValidation.cpp +++ b/src/cpp/ripple/SerializedValidation.cpp @@ -1,7 +1,7 @@ #include "SerializedValidation.h" -#include "HashPrefixes.h" +#include "Config.h" #include "Log.h" DECLARE_INSTANCE(SerializedValidation); @@ -70,7 +70,7 @@ void SerializedValidation::sign(uint256& signingHash, const RippleAddress& raPri uint256 SerializedValidation::getSigningHash() const { - return STObject::getSigningHash(sHP_Validation); + return STObject::getSigningHash(theConfig.SIGN_VALIDATION); } uint256 SerializedValidation::getLedgerHash() const From e7e16e5c75b97d0e609e2ffad911d9aab338c1e4 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 22:57:11 -0800 Subject: [PATCH 7/9] Provide --testnet status to API. --- src/cpp/ripple/NetworkOPs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index fa775e6788..4b95204914 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -1079,6 +1079,9 @@ Json::Value NetworkOPs::getServerInfo() { Json::Value info = Json::objectValue; + if (theConfig.TESTNET) + info["testnet"] = theConfig.TESTNET; + switch (mMode) { case omDISCONNECTED: info["serverState"] = "disconnected"; break; @@ -1462,7 +1465,11 @@ bool NetworkOPs::subServer(InfoSub* ispListener, Json::Value& jvResult) { uint256 uRandom; - jvResult["stand_alone"] = theConfig.RUN_STANDALONE; + if (theConfig.RUN_STANDALONE) + jvResult["stand_alone"] = theConfig.RUN_STANDALONE; + + if (theConfig.TESTNET) + jvResult["testnet"] = theConfig.TESTNET; getRand(uRandom.begin(), uRandom.size()); jvResult["random"] = uRandom.ToString(); From 94444a89b4ad4aec2f94c72dc086f64a4570f959 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 22:58:44 -0800 Subject: [PATCH 8/9] Vary alphabet by --testnet. --- src/cpp/ripple/base58.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpp/ripple/base58.h b/src/cpp/ripple/base58.h index 3a623c24f4..733216faa1 100644 --- a/src/cpp/ripple/base58.h +++ b/src/cpp/ripple/base58.h @@ -23,7 +23,7 @@ #include "bignum.h" #include "BitcoinUtil.h" -static const char* pszBase58 = "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"; +extern const char* ALPHABET; inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend) { @@ -52,12 +52,12 @@ inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char throw bignum_error("EncodeBase58 : BN_div failed"); bn = dv; unsigned int c = rem.getulong(); - str += pszBase58[c]; + str += ALPHABET[c]; } // Leading zeroes encoded as base58 zeros for (const unsigned char* p = pbegin; p < pend && *p == 0; p++) - str += pszBase58[0]; + str += ALPHABET[0]; // Convert little endian std::string to big endian reverse(str.begin(), str.end()); @@ -82,7 +82,7 @@ inline bool DecodeBase58(const char* psz, std::vector& vchRet) // Convert big endian string to bignum for (const char* p = psz; *p; p++) { - const char* p1 = strchr(pszBase58, *p); + const char* p1 = strchr(ALPHABET, *p); if (p1 == NULL) { while (isspace(*p)) @@ -91,7 +91,7 @@ inline bool DecodeBase58(const char* psz, std::vector& vchRet) return false; break; } - bnChar.setulong(p1 - pszBase58); + bnChar.setulong(p1 - ALPHABET); if (!BN_mul(&bn, &bn, &bn58, pctx)) throw bignum_error("DecodeBase58 : BN_mul failed"); bn += bnChar; @@ -106,7 +106,7 @@ inline bool DecodeBase58(const char* psz, std::vector& vchRet) // Restore leading zeros int nLeadingZeros = 0; - for (const char* p = psz; *p == pszBase58[0]; p++) + for (const char* p = psz; *p == ALPHABET[0]; p++) nLeadingZeros++; vchRet.assign(nLeadingZeros + vchTmp.size(), 0); From f873c1fc27f636eb6d4ba73536285de3d1fb7bb8 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 2 Jan 2013 23:02:29 -0800 Subject: [PATCH 9/9] Load UNL by --testnet. --- src/cpp/ripple/UniqueNodeList.cpp | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cpp/ripple/UniqueNodeList.cpp b/src/cpp/ripple/UniqueNodeList.cpp index ad7e56348d..83bdd46924 100644 --- a/src/cpp/ripple/UniqueNodeList.cpp +++ b/src/cpp/ripple/UniqueNodeList.cpp @@ -3,6 +3,7 @@ #include "UniqueNodeList.h" +#include #include #include @@ -24,7 +25,6 @@ SETUP_LOG(); #define VALIDATORS_FETCH_SECONDS 30 -#define VALIDATORS_FILE_PATH "/" VALIDATORS_FILE_NAME #define VALIDATORS_FILE_BYTES_MAX (50 << 10) // Gather string constants. @@ -41,10 +41,6 @@ SETUP_LOG(); #define REFERRAL_VALIDATORS_MAX 50 #define REFERRAL_IPS_MAX 50 -#ifndef MIN -#define MIN(x,y) ((x)<(y)?(x):(y)) -#endif - UniqueNodeList::UniqueNodeList(boost::asio::io_service& io_service) : mdtScoreTimer(io_service), mFetchActive(0), @@ -633,9 +629,9 @@ void UniqueNodeList::processIps(const std::string& strSite, const RippleAddress& // Add new referral entries. if (pmtVecStrIps && !pmtVecStrIps->empty()) { - std::vector vstrValues; + std::vector vstrValues; - vstrValues.resize(MIN(pmtVecStrIps->size(), REFERRAL_IPS_MAX)); + vstrValues.resize(std::min((int) pmtVecStrIps->size(), REFERRAL_IPS_MAX)); int iValues = 0; BOOST_FOREACH(const std::string& strReferral, *pmtVecStrIps) @@ -707,7 +703,7 @@ int UniqueNodeList::processValidators(const std::string& strSite, const std::str if (pmtVecStrValidators && pmtVecStrValidators->size()) { std::vector vstrValues; - vstrValues.reserve(MIN(pmtVecStrValidators->size(), REFERRAL_VALIDATORS_MAX)); + vstrValues.reserve(std::min((int) pmtVecStrValidators->size(), REFERRAL_VALIDATORS_MAX)); BOOST_FOREACH(const std::string& strReferral, *pmtVecStrValidators) { @@ -1555,13 +1551,13 @@ void UniqueNodeList::validatorsResponse(const boost::system::error_code& err, st void UniqueNodeList::nodeNetwork() { - if(!theConfig.VALIDATORS_SITE.empty()) + if (!theConfig.VALIDATORS_SITE.empty()) { HttpsClient::httpsGet( theApp->getIOService(), theConfig.VALIDATORS_SITE, 443, - VALIDATORS_FILE_PATH, + theConfig.VALIDATORS_URI, VALIDATORS_FILE_BYTES_MAX, boost::posix_time::seconds(VALIDATORS_FETCH_SECONDS), boost::bind(&UniqueNodeList::validatorsResponse, this, _1, _2)); @@ -1597,9 +1593,10 @@ void UniqueNodeList::nodeBootstrap() // If never loaded anything try the current directory. if (!bLoaded && theConfig.VALIDATORS_FILE.empty()) { - cLog(lsINFO) << "Bootstrapping UNL: loading from '" VALIDATORS_FILE_NAME "'."; + cLog(lsINFO) << boost::str(boost::format("Bootstrapping UNL: loading from '%s'.") + % theConfig.VALIDATORS_BASE); - bLoaded = nodeLoad(VALIDATORS_FILE_NAME); + bLoaded = nodeLoad(theConfig.VALIDATORS_BASE); } // Always load from rippled.cfg @@ -1607,15 +1604,17 @@ void UniqueNodeList::nodeBootstrap() { RippleAddress naInvalid; // Don't want a referrer on added entries. - cLog(lsINFO) << "Bootstrapping UNL: loading from " CONFIG_FILE_NAME "."; + cLog(lsINFO) << boost::str(boost::format("Bootstrapping UNL: loading from '%s'.") + % theConfig.CONFIG_FILE); - if (processValidators("local", CONFIG_FILE_NAME, naInvalid, vsConfig, &theConfig.VALIDATORS)) + if (processValidators("local", theConfig.CONFIG_FILE.native(), naInvalid, vsConfig, &theConfig.VALIDATORS)) bLoaded = true; } if (!bLoaded) { - cLog(lsINFO) << "Bootstrapping UNL: loading from " << theConfig.VALIDATORS_SITE << "."; + cLog(lsINFO) << boost::str(boost::format("Bootstrapping UNL: loading from '%s'.") + % theConfig.VALIDATORS_SITE); nodeNetwork(); } @@ -1667,7 +1666,8 @@ void UniqueNodeList::nodeProcess(const std::string& strSite, const std::string& } else { - cLog(lsWARNING) << "'" VALIDATORS_FILE_NAME "' missing [" SECTION_VALIDATORS "]."; + cLog(lsWARNING) << boost::str(boost::format("'%s' missing [" SECTION_VALIDATORS "].") + % theConfig.VALIDATORS_BASE); } }