Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"waitfornewblock", | "waitfornewblock", | ||||
"\nWaits for a specific new block and returns useful " | "\nWaits for a specific new block and returns useful " | ||||
"info about it.\n" | "info about it.\n" | ||||
"\nReturns the current block on timeout or exit.\n", | "\nReturns the current block on timeout or exit.\n", | ||||
{ | { | ||||
{"timeout", RPCArg::Type::NUM, /* opt */ true, | {"timeout", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "0", | /* default_val */ "0", | ||||
"Time in milliseconds to wait for a response. 0 " | "Time in milliseconds to wait for a response. 0 indicates no " | ||||
"indicates no timeout."}, | "timeout."}, | ||||
}, | }, | ||||
RPCResult{"{ (json object)\n" | RPCResult{"{ (json object)\n" | ||||
" \"hash\" : { (string) The blockhash\n" | " \"hash\" : { (string) The blockhash\n" | ||||
" \"height\" : { (int) Block height\n" | " \"height\" : { (int) Block height\n" | ||||
"}\n"}, | "}\n"}, | ||||
RPCExamples{HelpExampleCli("waitfornewblock", "1000") + | RPCExamples{HelpExampleCli("waitfornewblock", "1000") + | ||||
HelpExampleRpc("waitfornewblock", "1000")}, | HelpExampleRpc("waitfornewblock", "1000")}, | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,705 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
"getchaintxstats", | "getchaintxstats", | ||||
"\nCompute statistics about the total number and rate " | "\nCompute statistics about the total number and rate " | ||||
"of transactions in the chain.\n", | "of transactions in the chain.\n", | ||||
{ | { | ||||
{"nblocks", RPCArg::Type::NUM, /* opt */ true, | {"nblocks", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "one month", | /* default_val */ "one month", | ||||
"Size of the window in number of blocks"}, | "Size of the window in number of blocks"}, | ||||
{"blockhash", RPCArg::Type::STR_HEX, /* opt */ true, | {"blockhash", RPCArg::Type::STR_HEX, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "chain tip", | ||||
"The hash of the block that ends the window."}, | "The hash of the block that ends the window."}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"{\n" | "{\n" | ||||
" \"time\": xxxxx, (numeric) The " | " \"time\": xxxxx, (numeric) The " | ||||
"timestamp for the final block in the window in UNIX format.\n" | "timestamp for the final block in the window in UNIX format.\n" | ||||
" \"txcount\": xxxxx, (numeric) The " | " \"txcount\": xxxxx, (numeric) The " | ||||
"total number of transactions in the chain up to that point.\n" | "total number of transactions in the chain up to that point.\n" | ||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
/* opt */ false, | /* opt */ false, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"The block hash or height of the target block", | "The block hash or height of the target block", | ||||
"", | "", | ||||
{"", "string or numeric"}}, | {"", "string or numeric"}}, | ||||
{"stats", | {"stats", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "all values", | ||||
"Values to plot, by default all values (see result below)", | "Values to plot (see result below)", | ||||
{ | { | ||||
{"height", RPCArg::Type::STR, /* opt */ true, | {"height", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", "Selected statistic"}, | /* default_val */ "", "Selected statistic"}, | ||||
{"time", RPCArg::Type::STR, /* opt */ true, | {"time", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", "Selected statistic"}, | /* default_val */ "", "Selected statistic"}, | ||||
}, | }, | ||||
"stats"}, | "stats"}, | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 650 Lines • Show Last 20 Lines |