Network
The following RPC calls interact with the komodod
software, and are made available through the komodo-cli
software.
addnode
addnode "node" "add|remove|onetry"
The addnode
method attempts to add or remove a node from the addnode list, or to make a single attempt to connect to a node.
Arguments
"node"
(string, required)
the node (see getpeerinfo for nodes)
"command"
(string, required)
'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once
Response
(none)
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
clearbanned
clearbanned
The clearbanned
method clears all banned IPs.
Arguments
(none)
Response
(none)
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
disconnectnode
disconnectnode "node"
The disconnectnode
method instructs the daemon to immediately disconnect from the specified node.
Use getpeerinfo
to determine the result.
Arguments
"node"
(string, required)
the node's address (see getpeerinfo for nodes)
Response
(none)
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
getaddednodeinfo
getaddednodeinfo dns ( "node" )
The getaddednodeinfo
method returns information about the given added node, or all added nodes.
If dns
is set to false
, only a list of added nodes is returned. Otherwise, connection information is also provided.
::: tip Nodes added via onetry are not listed here. :::
Arguments
dns
(boolean, required)
if false, only a list of added nodes will be provided; otherwise, connection information is also provided
"node"
(string, optional)
if provided, the method returns information about this specific node; otherwise, all nodes are returned
Response
"addednode"
(string)
the node ip address
"connected"
(boolean)
if connected
"addresses" : [ ... ]
(array of jsons)
"address"
(string)
the server host and port
"connected"
(string)
"connected" accepts two possible values: "inbound" or "outbound"
📌 Examples
Command:
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
getconnectioncount
getconnectioncount
The getconnectioncount
method returns the number of connections to other nodes.
Arguments
(none)
Response
n
(numeric)
the connection count
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
getdeprecationinfo
getdeprecationinfo
The getdeprecationinfo
method returns an object containing current version and deprecation block height.
::: tip This method is applicable only to the KMD main net. :::
Arguments
(none)
Response
"version"
(numeric)
the server version
"subversion"
(string)
the server sub-version string (i.e. "/MagicBean:x.y.z[-v]/")
"deprecationheight"
(numeric)
the block height at which this version will deprecate and shut down (unless disabledeprecation is set)
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
getnettotals
getnettotals
The getnettotals
method returns information about network traffic, including bytes in, bytes out, and current time.
Arguments
(none)
Response
"totalbytesrecv"
(numeric)
total bytes received
"totalbytessent"
(numeric)
total bytes sent
"timemillis"
(numeric)
total cpu time
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
getnetworkinfo
getnetworkinfo
The getnetworkinfo
method returns an object containing various state info regarding p2p networking.
Arguments
(none)
Response
"version"
(numeric)
the server version
"subversion"
(string)
the server subversion string (i.e. "/MagicBean:x.y.z[-v]/")
"protocolversion"
(numeric)
the protocol version
"localservices"
(string)
the services we offer to the network
"timeoffset"
(numeric)
the time offset
"connections"
(numeric)
the number of connections
"networks": [ ... ]
(array of jsons)
information per network
"name"
(string)
network (ipv4, ipv6 or onion)
"limited"
(boolean)
whether the network is limited using -onlynet
"reachable"
(boolean)
whether the network is reachable
"proxy"
(string)
(submitted as "host:port") the proxy that is used for this network, or empty if none
"relayfee"
(numeric)
minimum relay fee for non-free transactions in COIN/kB
"localaddresses": [ ... ]
(array of jsons)
list of local addresses
"address"
(string)
network address
"port"
(numeric)
network port
"score"
(numeric)
relative score
"warnings"
(string)
any network warnings (such as alert messages)
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
getpeerinfo
getpeerinfo
The getpeerinfo
method returns data about each connected network node as a json array of objects.
Arguments
(none)
Response
"id"
(numeric)
peer index
"addr":,
(string)
the ip address and port of the peer ("host:port")
"addrlocal"
(string)
local address ("ip:port")
"services"
(string)
the services offered
"lastsend"
(numeric)
the time in seconds since epoch (Jan 1 1970 GMT) of the last send
"lastrecv"
(numeric)
the time in seconds since epoch (Jan 1 1970 GMT) of the last receive
"bytessent"
(numeric)
the total bytes sent
"bytesrecv"
(numeric)
the total bytes received
"conntime"
(numeric)
the connection time in seconds since epoch (Jan 1 1970 GMT)
"timeoffset"
(numeric)
the time offset in seconds
"pingtime"
(numeric)
ping time
"pingwait"
(numeric)
ping wait
"version"
(numeric)
the peer version, such as 170002
"subver"
(string)
the string version (i.e. "/MagicBean:x.y.z[-v]/")
"inbound"
(boolean)
inbound (true) or outbound (false)
"startingheight"
(numeric)
the starting height (block) of the peer
"banscore"
(numeric)
the ban score
"synced_headers"
(numeric)
the last header we have in common with this peer
"synced_blocks"
(numeric)
the last block we have in common with this peer
"inflight": [ ... ]
(array)
number
(numeric)
the block height requested from this peer
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
listbanned
listbanned
The listbanned
method lists all banned IP addresses and subnets.
Arguments
(none)
Response
"address"
(string)
the address/subnet that is banned
"banned_until"
(numeric)
the timestamp, at which point the ban will be removed
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
ping
ping
The ping
method requests that a ping be sent to all other nodes, to measure ping time.
Results provided in getpeerinfo
, pingtime
and pingwait
fields are decimal seconds.
The ping
command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
::: tip Use getpeerinfo to see ping results. :::
Arguments
(none)
Response
(none)
📌 Examples
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
setban
setban "ip(/netmask)" "add|remove" (bantime) (absolute)
The setban
method attempts to add or remove an IP address (and subnet, if indicated) from the banned list.
Arguments
"ip(/netmask)"
(string, ip required)
the IP/subnet (see getpeerinfo
for nodes ip) with an optional netmask (default is /32 = single ip)
"command"
(string, required)
use "add" to add an IP/subnet to the list, or "remove" to remove an IP/subnet from the list
bantime
(numeric, optional)
indicates how long (in seconds) the ip is banned (or until when, if [absolute] is set). 0 or empty means the ban is using the default time of 24h, which can also be overwritten using the -bantime runtime parameter.
absolute
(boolean, optional)
if set to true, the bantime must be an absolute timestamp (in seconds) since epoch (Jan 1 1970 GMT)
Response
(none)
::: tip Use listbanned to view results. :::
📌 Examples
Command:
Command:
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command: