Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/net.cpp
Show First 20 Lines • Show All 322 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() == 0 || | ||||
"disconnectnode", | "disconnectnode", | ||||
"\nImmediately disconnects from the specified peer node.\n" | "\nImmediately disconnects from the specified peer node.\n" | ||||
"\nStrictly one out of 'address' and 'nodeid' can be provided " | "\nStrictly one out of 'address' and 'nodeid' can be provided " | ||||
"to identify the node.\n" | "to identify the node.\n" | ||||
"\nTo disconnect by nodeid, either set 'address' to the empty " | "\nTo disconnect by nodeid, either set 'address' to the empty " | ||||
"string, or call using the named 'nodeid' argument only.\n", | "string, or call using the named 'nodeid' argument only.\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, /* opt */ true, | {"address", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", "The IP address/port of the node"}, | /* default_val */ "fallback to nodeid", | ||||
"The IP address/port of the node"}, | |||||
{"nodeid", RPCArg::Type::NUM, /* opt */ true, | {"nodeid", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "fallback to address", | ||||
"The node ID (see getpeerinfo for node IDs)"}, | "The node ID (see getpeerinfo for node IDs)"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{ | RPCExamples{ | ||||
HelpExampleCli("disconnectnode", "\"192.168.0.6:8333\"") + | HelpExampleCli("disconnectnode", "\"192.168.0.6:8333\"") + | ||||
HelpExampleCli("disconnectnode", "\"\" 1") + | HelpExampleCli("disconnectnode", "\"\" 1") + | ||||
HelpExampleRpc("disconnectnode", "\"192.168.0.6:8333\"") + | HelpExampleRpc("disconnectnode", "\"192.168.0.6:8333\"") + | ||||
HelpExampleRpc("disconnectnode", "\"\", 1")}, | HelpExampleRpc("disconnectnode", "\"\", 1")}, | ||||
Show All 39 Lines | static UniValue getaddednodeinfo(const Config &config, | ||||
if (request.fHelp || request.params.size() > 1) { | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"getaddednodeinfo", | "getaddednodeinfo", | ||||
"\nReturns information about the given added node, or " | "\nReturns information about the given added node, or " | ||||
"all added nodes\n" | "all added nodes\n" | ||||
"(note that onetry addnodes are not listed here)\n", | "(note that onetry addnodes are not listed here)\n", | ||||
{ | { | ||||
{"node", RPCArg::Type::STR, /* opt */ true, | {"node", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "all nodes", | ||||
"If provided, return information about this " | "If provided, return information about this specific node, " | ||||
"specific node, otherwise all nodes are returned."}, | "otherwise all nodes are returned."}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"[\n" | "[\n" | ||||
" {\n" | " {\n" | ||||
" \"addednode\" : \"192.168.0.201\", (string) The node IP " | " \"addednode\" : \"192.168.0.201\", (string) The node IP " | ||||
"address or name (as provided to addnode)\n" | "address or name (as provided to addnode)\n" | ||||
" \"connected\" : true|false, (boolean) If " | " \"connected\" : true|false, (boolean) If " | ||||
"connected\n" | "connected\n" | ||||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"The IP/Subnet (see getpeerinfo for nodes IP) with an " | "The IP/Subnet (see getpeerinfo for nodes IP) with an " | ||||
"optional netmask (default is /32 = single IP)"}, | "optional netmask (default is /32 = single IP)"}, | ||||
{"command", RPCArg::Type::STR, /* opt */ false, | {"command", RPCArg::Type::STR, /* opt */ false, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"'add' to add an IP/Subnet to the list, 'remove' to " | "'add' to add an IP/Subnet to the list, 'remove' to " | ||||
"remove an IP/Subnet from the list"}, | "remove an IP/Subnet from the list"}, | ||||
{"bantime", RPCArg::Type::NUM, /* opt */ true, | {"bantime", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "0", | ||||
"time in seconds how long (or until when if [absolute] is " | "time in seconds how long (or until when if [absolute] is " | ||||
"set) the IP is banned (0 or empty means using the " | "set) the IP is banned (0 or empty means using the default " | ||||
"default time of 24h which can also be overwritten by the " | "time of 24h which can also be overwritten by the -bantime " | ||||
"-bantime startup argument)"}, | "startup argument)"}, | ||||
{"absolute", RPCArg::Type::BOOL, /* opt */ true, | {"absolute", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "false", | ||||
"If set, the bantime must be an absolute timestamp in " | "If set, the bantime must be an absolute timestamp in seconds " | ||||
"seconds since epoch (Jan 1 1970 GMT)"}, | "since epoch (Jan 1 1970 GMT)"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{ | RPCExamples{ | ||||
HelpExampleCli("setban", "\"192.168.0.6\" \"add\" 86400") + | HelpExampleCli("setban", "\"192.168.0.6\" \"add\" 86400") + | ||||
HelpExampleCli("setban", "\"192.168.0.0/24\" \"add\"") + | HelpExampleCli("setban", "\"192.168.0.0/24\" \"add\"") + | ||||
HelpExampleRpc("setban", "\"192.168.0.6\", \"add\", 86400")}, | HelpExampleRpc("setban", "\"192.168.0.6\", \"add\", 86400")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines |