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:
Brad Chase
2017-10-05 10:52:38 -04:00
parent 02059a27d6
commit 044dd53513
18 changed files with 1140 additions and 201 deletions

View File

@@ -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());