The addnode RPC attempts to add or remove a node from the addnode list, or to try a connection to a node once.
Parameter #1—hostname/IP address and port of node to add or remove
|Node||string||Required(Exactly 1)||The node to add as a string in the form of
Parameter #2—whether to add or remove the node, or to try only once to connect
|Command||string||Required(Exactly 1)||What to do with the IP address above. Options are:
Result—null plus error on failed remove
|result||null||Required(Exactly 1)||Always JSON null whether the node was added, removed, tried-and-connected, or tried-and-not-connected. The JSON-RPC error field will be set only if you try removing a node that is not on the addnodes list|
Try connecting to the following node.
PAI-cli -testnet addnode 192.0.2.113:18333 onetry
Result (no output from
PAI-cli because result is set to
GetAddedNodeInfo: 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.