Allow server to download cache from another clio server (#246)

* Allow server to download cache from another clio server

* Config takes an array of clio peers. If any of these peers have a
  full cache, clio picks a peer at random to download the cache from.
  Otherwise, fall back to downloading cache from the database.
This commit is contained in:
CJ Cobb
2022-10-04 12:29:29 -04:00
committed by GitHub
parent 4c9c606202
commit 97ef66d130
4 changed files with 250 additions and 11 deletions

View File

@@ -184,6 +184,8 @@ doLedgerData(Context const& context)
objects.push_back(toJson(sle));
}
response[JS(state)] = std::move(objects);
if (outOfOrder)
response["cache_full"] = context.backend->cache().isFull();
auto end2 = std::chrono::system_clock::now();
time = std::chrono::duration_cast<std::chrono::microseconds>(end2 - end)