rippled
Loading...
Searching...
No Matches
ServerInfo.cpp
1#include <xrpld/app/misc/NetworkOPs.h>
2#include <xrpld/rpc/Context.h>
3#include <xrpld/rpc/Role.h>
4
5#include <xrpl/json/json_value.h>
6#include <xrpl/json/json_writer.h>
7#include <xrpl/protocol/jss.h>
8
9namespace ripple {
10
13{
15
16 ret[jss::info] = context.netOps.getServerInfo(
17 true,
18 context.role == Role::ADMIN,
19 context.params.isMember(jss::counters) &&
20 context.params[jss::counters].asBool());
21
22 return ret;
23}
24
25} // namespace ripple
Represents a JSON value.
Definition json_value.h:131
bool asBool() const
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Json::Value getServerInfo(bool human, bool admin, bool counters)=0
@ objectValue
object value (collection of name/value pairs).
Definition json_value.h:27
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Json::Value doServerInfo(RPC::JsonContext &)
NetworkOPs & netOps
Definition Context.h:24