Get Added Node Info

The getaddednodeinfo RPC returns information about the given added node, or all added nodes (except onetry nodes). Only nodes which have been manually added using the addnode RPC will have their information displayed.

Parameter #1—whether to display connection information

Name Type Presence Description
Details bool Required
(exactly 1)
Set to true to display detailed information about each added node; set to false to only display the IP address or hostname and port added

Parameter #2—what node to display information about

Name Type Presence Description
Node string Optional
(0 or 1)
The node to get information about in the same <IP address>:<port> format as the addnode RPC. If this parameter is not provided, information about all added nodes will be returned

Result—a list of added nodes

Name Type Presence Description
result array Required
(exactly 1)
An array containing objects describing each added node. If no added nodes are present, the array will be empty. Nodes added with onetry will not be returned

Added Node
object Optional
(0 or more)
An object containing details about a single added node
→ →
addednode
string Required
(exactly 1)
An added node in the same <IP address>:<port> format as used in the addnode RPC. This element is present for any added node whether or not the Details parameter was set to true
→ →
connected
bool Optional
(0 or 1)
If the Details parameter was set to true, this will be set to true if the node is currently connected and false if it is not
→ →
addresses
array Optional
(0 or 1)
If the Details parameter was set to true, this will be an array of addresses belonging to the added node
→ → →
Address
object Optional
(0 or more)
An object describing one of this node’s addresses
→ → → →
address
string Required
(exactly 1)
An IP address and port number of the node. If the node was added using a DNS address, this will be the resolved IP address
→ → → →
connected
string Required
(exactly 1)
Whether or not the local node is connected to this addnode using this IP address. Valid values are:
false for not connected
inbound if the addnode connected to us
outbound if we connected to the addnode

Example

pai-cli getaddednodeinfo

Result (real hostname and IP address replaced):

[
    {
        "addednode" : "paid.example.com:8333",
        "connected" : true,
        "addresses" : [
            {
                "address" : "192.0.2.113:8333",
                "connected" : "outbound"
            }
        ]
    }
]

See also

  • AddNode: attempts to add or remove a node from the addnode list, or to try a connection to a node once.
  • GetPeerInfo: returns data about each connected network node.