mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add validator list RPC commands (RIPD-1541):
In support of dynamic validator list, this changeset: 1. Adds a new `validator_list_expires` field to `server_info` that indicates when the current validator list will become stale. 2. Adds a new admin only `validator_lists` RPC that returns the current list of known validators and the most recent published validator lists. 3. Adds a new admin only `validator_sites` RPC that returns the list of configured validator publisher sites and when they were most recently queried.
This commit is contained in:
@@ -2148,6 +2148,29 @@ Json::Value NetworkOPsImp::getServerInfo (bool human, bool admin)
|
||||
info[jss::validation_quorum] = static_cast<Json::UInt>(
|
||||
app_.validators ().quorum ());
|
||||
|
||||
if (admin)
|
||||
{
|
||||
if (auto when = app_.validators().expires())
|
||||
{
|
||||
if (human)
|
||||
{
|
||||
if(*when == TimeKeeper::time_point::max())
|
||||
info[jss::validator_list_expires] = "never";
|
||||
else
|
||||
info[jss::validator_list_expires] = to_string(*when);
|
||||
}
|
||||
else
|
||||
info[jss::validator_list_expires] =
|
||||
static_cast<Json::UInt>(when->time_since_epoch().count());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (human)
|
||||
info[jss::validator_list_expires] = "unknown";
|
||||
else
|
||||
info[jss::validator_list_expires] = 0;
|
||||
}
|
||||
}
|
||||
info[jss::io_latency_ms] = static_cast<Json::UInt> (
|
||||
app_.getIOLatency().count());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user