mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Add RPC ping.
This commit is contained in:
@@ -512,6 +512,7 @@ Json::Value RPCParser::parseCommand(std::string strMethod, Json::Value jvParams)
|
||||
// { "nickname_info", &RPCParser::parseNicknameInfo, 1, 1 },
|
||||
{ "owner_info", &RPCParser::parseOwnerInfo, 1, 2 },
|
||||
{ "peers", &RPCParser::parseAsIs, 0, 0 },
|
||||
{ "ping", &RPCParser::parseAsIs, 0, 0 },
|
||||
// { "profile", &RPCParser::parseProfile, 1, 9 },
|
||||
{ "random", &RPCParser::parseAsIs, 0, 0 },
|
||||
{ "ripple_path_find", &RPCParser::parseRipplePathFind, 1, 1 },
|
||||
|
||||
@@ -774,11 +774,16 @@ Json::Value RPCHandler::doOwnerInfo(Json::Value jvRequest)
|
||||
|
||||
Json::Value RPCHandler::doPeers(Json::Value)
|
||||
{
|
||||
Json::Value obj(Json::objectValue);
|
||||
Json::Value jvResult(Json::objectValue);
|
||||
|
||||
obj["peers"]=theApp->getConnectionPool().getPeersJson();
|
||||
jvResult["peers"] = theApp->getConnectionPool().getPeersJson();
|
||||
|
||||
return obj;
|
||||
return jvResult;
|
||||
}
|
||||
|
||||
Json::Value RPCHandler::doPing(Json::Value)
|
||||
{
|
||||
return Json::Value(Json::objectValue);
|
||||
}
|
||||
|
||||
// profile offers <pass_a> <account_a> <currency_offer_a> <account_b> <currency_offer_b> <count> [submit]
|
||||
@@ -874,8 +879,8 @@ Json::Value RPCHandler::doProfile(Json::Value jvRequest)
|
||||
}
|
||||
|
||||
// {
|
||||
// account: <account>|<nickname>|<account_public_key> [<index>]
|
||||
// index: <number> // optional, defaults to 0.
|
||||
// account: <account>|<nickname>|<account_public_key>
|
||||
// account_index: <number> // optional, defaults to 0.
|
||||
// ledger_hash : <ledger>
|
||||
// ledger_index : <ledger_index>
|
||||
// }
|
||||
@@ -952,8 +957,8 @@ Json::Value RPCHandler::doAccountLines(Json::Value jvRequest)
|
||||
}
|
||||
|
||||
// {
|
||||
// account: <account>|<nickname>|<account_public_key> [<index>]
|
||||
// index: <number> // optional, defaults to 0.
|
||||
// account: <account>|<nickname>|<account_public_key>
|
||||
// account_index: <number> // optional, defaults to 0.
|
||||
// ledger_hash : <ledger>
|
||||
// ledger_index : <ledger_index>
|
||||
// }
|
||||
@@ -2714,6 +2719,7 @@ Json::Value RPCHandler::doCommand(const Json::Value& jvRequest, int iRole)
|
||||
// { "nickname_info", &RPCHandler::doNicknameInfo, false, optCurrent },
|
||||
{ "owner_info", &RPCHandler::doOwnerInfo, false, optCurrent },
|
||||
{ "peers", &RPCHandler::doPeers, true, optNone },
|
||||
{ "ping", &RPCHandler::doPing, false, optNone },
|
||||
// { "profile", &RPCHandler::doProfile, false, optCurrent },
|
||||
{ "random", &RPCHandler::doRandom, false, optNone },
|
||||
{ "ripple_path_find", &RPCHandler::doRipplePathFind, false, optCurrent },
|
||||
|
||||
@@ -64,6 +64,7 @@ class RPCHandler
|
||||
Json::Value doNicknameInfo(Json::Value params);
|
||||
Json::Value doOwnerInfo(Json::Value params);
|
||||
Json::Value doPeers(Json::Value params);
|
||||
Json::Value doPing(Json::Value params);
|
||||
Json::Value doProfile(Json::Value params);
|
||||
Json::Value doRandom(Json::Value jvRequest);
|
||||
Json::Value doRipplePathFind(Json::Value jvRequest);
|
||||
|
||||
Reference in New Issue
Block a user