| 642 | } |
| 643 | |
| 644 | static RPCMethod getnetworkinfo() |
| 645 | { |
| 646 | return RPCMethod{"getnetworkinfo", |
| 647 | "Returns an object containing various state info regarding P2P networking.\n", |
| 648 | {}, |
| 649 | RPCResult{ |
| 650 | RPCResult::Type::OBJ, "", "", |
| 651 | { |
| 652 | {RPCResult::Type::NUM, "version", "the server version"}, |
| 653 | {RPCResult::Type::STR, "subversion", "the server subversion string"}, |
| 654 | {RPCResult::Type::NUM, "protocolversion", "the protocol version"}, |
| 655 | {RPCResult::Type::STR_HEX, "localservices", "the services we offer to the network"}, |
| 656 | {RPCResult::Type::ARR, "localservicesnames", "the services we offer to the network, in human-readable form", |
| 657 | { |
| 658 | {RPCResult::Type::STR, "SERVICE_NAME", "the service name"}, |
| 659 | }}, |
| 660 | {RPCResult::Type::BOOL, "localrelay", "true if transaction relay is requested from peers"}, |
| 661 | {RPCResult::Type::NUM, "timeoffset", "the time offset"}, |
| 662 | {RPCResult::Type::NUM, "connections", "the total number of connections"}, |
| 663 | {RPCResult::Type::NUM, "connections_in", "the number of inbound connections"}, |
| 664 | {RPCResult::Type::NUM, "connections_out", "the number of outbound connections"}, |
| 665 | {RPCResult::Type::BOOL, "networkactive", "whether p2p networking is enabled"}, |
| 666 | {RPCResult::Type::ARR, "networks", "information per network", |
| 667 | { |
| 668 | {RPCResult::Type::OBJ, "", "", |
| 669 | { |
| 670 | {RPCResult::Type::STR, "name", "network (" + Join(GetNetworkNames(), ", ") + ")"}, |
| 671 | {RPCResult::Type::BOOL, "limited", "is the network limited using -onlynet?"}, |
| 672 | {RPCResult::Type::BOOL, "reachable", "is the network reachable?"}, |
| 673 | {RPCResult::Type::STR, "proxy", "(\"host:port\") the proxy that is used for this network, or empty if none"}, |
| 674 | {RPCResult::Type::BOOL, "proxy_randomize_credentials", "Whether randomized credentials are used"}, |
| 675 | }}, |
| 676 | }}, |
| 677 | {RPCResult::Type::NUM, "relayfee", "minimum relay fee rate for transactions in " + CURRENCY_UNIT + "/kvB"}, |
| 678 | {RPCResult::Type::NUM, "incrementalfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB"}, |
| 679 | {RPCResult::Type::ARR, "localaddresses", "list of local addresses", |
| 680 | { |
| 681 | {RPCResult::Type::OBJ, "", "", |
| 682 | { |
| 683 | {RPCResult::Type::STR, "address", "network address"}, |
| 684 | {RPCResult::Type::NUM, "port", "network port"}, |
| 685 | {RPCResult::Type::NUM, "score", "relative score"}, |
| 686 | }}, |
| 687 | }}, |
| 688 | (IsDeprecatedRPCEnabled("warnings") ? |
| 689 | RPCResult{RPCResult::Type::STR, "warnings", "any network and blockchain warnings (DEPRECATED)"} : |
| 690 | RPCResult{RPCResult::Type::ARR, "warnings", "any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)", |
| 691 | { |
| 692 | {RPCResult::Type::STR, "", "warning"}, |
| 693 | } |
| 694 | } |
| 695 | ), |
| 696 | } |
| 697 | }, |
| 698 | RPCExamples{ |
| 699 | HelpExampleCli("getnetworkinfo", "") |
| 700 | + HelpExampleRpc("getnetworkinfo", "") |
| 701 | }, |
nothing calls this directly
no test coverage detected