We put our best effort into covering all topics related to Dimecoin. Each section will cover a different category. Not all documentation may be 100% accurate, if you spot an error, please report it or submit a PR request on GitHub.
REMINDER: This documentation is always evolving. If you have not been here for a while, perhaps check again. Things may have been added or updated since your last visit!
Network RPCs#
AddNode#
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
Name |
Type |
Presence |
Description |
---|---|---|---|
|
string |
Required |
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
Name |
Type |
Presence |
Description |
---|---|---|---|
|
string |
Required |
What to do with the IP address above. Options are: |
Result—null
plus error on failed remove
Name |
Type |
Presence |
Description |
---|---|---|---|
|
null |
Required |
Always JSON |
Example from Dimecoin Core 2.3.0.0
Try connecting to the following node.
dimecoin-cli -mainnet addnode 147.43.22.113:11391 onetry
Result (no output from dimecoin-cli
because result is set to null
).
See also
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.
ClearBanned#
The clearbanned
RPC clears list of banned nodes.
Parameters: none
Result—null
on success
Name |
Type |
Presence |
Description |
---|---|---|---|
|
null |
Required |
JSON |
Example from Dimecoin Core 2.3.0.0
Clears the ban list.
dimecoin-cli clearbanned
Result (no output from dimecoin-cli
because result is set to null
).
See also
ListBanned: lists all manually banned IPs/Subnets.
SetBan: attempts add or remove a IP/Subnet from the banned list.
DisconnectNode#
The disconnectnode
RPC immediately disconnects from a specified node.
Parameter #1—hostname/IP address and port of node to disconnect
Name |
Type |
Presence |
Description |
---|---|---|---|
|
string |
Required |
The node you want to disconnect from as a string in the form of |
Parameter #2—nodeid
Name |
Type |
Presence |
Description |
---|---|---|---|
nodeid |
number |
Optional |
The node ID (see |
*Result—null
on success or error on failed disconnect_
Name |
Type |
Presence |
Description |
---|---|---|---|
|
null |
Required |
JSON |
Example from Dimecoin Core 2.3.0.0
Disconnects following node by address.
dimecoin-cli -mainnet disconnectnode 147.43.22.113:11391
Result (no output from dimecoin-cli
because result is set to null
).
Disconnects following node by id.
dimecoin-cli -mainnet disconnectnode "" 3
Result (no output from dimecoin-cli
because result is set to null
).
See also
AddNode: attempts to add or remove a node from the addnode list, or to try a connection to a node once.
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.
GetAddedNodeInfo#
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.
Prior to Dimecoin Core 2.0.0.0, this dummy parameter was required for historical purposes but not used:
DEPRECATED Parameter #1—whether to display connection information
Name |
Type |
Presence |
Description |
---|---|---|---|
Dummy |
bool |
Required |
Removed in Dimecoin Core 2.0.0.0 |
Beginning with Dimecoin Core 2.0.0.0, this is the single (optional) parameter:
Parameter #1—what node to display information about
Name |
Type |
Presence |
Description |
---|---|---|---|
|
string |
Optional |
The node to get information about in the same |
Result—a list of added nodes
Name |
Type |
Presence |
Description |
---|---|---|---|
|
array |
Required |
An array containing objects describing each added node. If no added nodes are present, the array will be empty. Nodes added with |
→ |
object |
Optional |
An object containing details about a single added node |
→ → |
string |
Required |
An added node in the same |
→ → |
bool |
Optional |
This will be set to |
→ → |
array |
Required |
This will be an array of addresses belonging to the added node |
→ → → |
object |
Optional |
An object describing one of this node’s addresses |
→ → → → |
string |
Required |
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 |
→ → → → |
string |
Required |
Whether or not the local node is connected to this addnode using this IP address. Valid values are: |
Example from Dimecoin Core 2.3.0.0
dimecoin-cli getaddednodeinfo
Result (real hostname and IP address replaced with RFC5737 reserved address):
[
{
"addednode": "147.43.22.113:11391",
"connected": true,
"addresses": [
{
"address": "147.43.22.113:11391",
"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.
GetConnectionCount#
The getconnectioncount
RPC returns the number of connections to other nodes.
Parameters: none
Result—the number of connections to other nodes
Name |
Type |
Presence |
Description |
---|---|---|---|
|
number (int) |
Required |
The total number of connections to other nodes (both inbound and outbound) |
Example from Dimecoin Core 2.3.0.0 : 8 is currently the default max connection amount for node seeding purposes
dimecoin-cli -mainnet getconnectioncount
Result:
8
See also
GetNetTotals: returns information about network traffic, including bytes in, bytes out, and the current time.
GetPeerInfo: returns data about each connected network node.
GetNetworkInfo: returns information about the node’s connection to the network.
GetNetTotals#
The getnettotals
RPC returns information about network traffic, including bytes in, bytes out, and the current time.
Parameters: none
Result—the current bytes in, bytes out, and current time
Name |
Type |
Presence |
Description |
---|---|---|---|
|
object |
Required |
An object containing information about the node’s network totals |
→ |
number (int) |
Required |
The total number of bytes received since the node was last restarted |
→ |
number (int) |
Required |
The total number of bytes sent since the node was last restarted |
→ |
number (int) |
Required |
Unix epoch time in milliseconds according to the operating system’s clock (not the node adjusted time) |
→ |
string : |
Required |
The upload target information |
→ → |
number (int) |
Required |
Length of the measuring timeframe in seconds (currently set to |
→ → |
number (int) |
Required |
The maximum allowed outbound traffic in bytes (default is |
→ → |
bool |
Required |
Indicates if the target is reached. If the target is reached the node won’t serve SPV and historical block requests anymore |
→ → |
bool |
Required |
Indicates if historical blocks are served |
→ → |
number (int) |
Required |
Amount of bytes left in current time cycle. |
→ → |
number (int) |
Required |
Seconds left in current time cycle. |
Example from Dimecoin Core 2.3.0.0
dimecoin-cli getnettotals
Result:
{
"totalbytesrecv": 14648877947,
"totalbytessent": 679218045,
"timemillis": 1709936767876,
"uploadtarget": {
"timeframe": 86400,
"target": 0,
"target_reached": false,
"serve_historical_blocks": true,
"bytes_left_in_cycle": 0,
"time_left_in_cycle": 0
}
}
See also
GetNetworkInfo: returns information about the node’s connection to the network.
GetPeerInfo: returns data about each connected network node.
GetNetworkInfo#
The getnetworkinfo
RPC returns information about the node’s connection to the network.
Parameters: none
Result—information about the node’s connection to the network
Name |
Type |
Presence |
Description |
---|---|---|---|
|
object |
Required |
Information about this node’s connection to the network |
→ |
number |
Required |
This node’s version of Dimecoin Core in its internal integer format. For example, Dimecoin Core 2.3.0.0 has the integer version number 2030000 |
→ |
string |
Required |
The node’s build version including RC info or commit as relevant |
→ |
string |
Required |
The user agent this node sends in its |
→ |
number (int) |
Required |
The protocol version number used by this node. See the protocol versions section for more information |
→ |
string (hex) |
Required |
The services supported by this node as advertised in its |
→ |
array |
Required |
An array of strings describing the services offered, in human-readable form. |
→ → |
string |
Required |
The service name. |
→ |
bool |
Required |
The services supported by this node as advertised in its |
→ |
number (int) |
Required |
The offset of the node’s clock from the computer’s clock (both in UTC) in seconds. The offset may be up to 4200 seconds (70 minutes) |
→ |
bool |
Required |
Set to |
→ |
number (int) |
Required |
The total number of open connections (both outgoing and incoming) between this node and other nodes |
→ |
number (int) |
Required |
The number of inbound connections |
→ |
array |
Required |
An array with three objects: one describing the IPv4 connection, one describing the IPv6 connection, and one describing the Tor hidden service (onion) connection |
→ → |
object |
Optional |
An object describing a network. If the network is unroutable, it will not be returned |
→ → → |
string |
Required |
The name of the network. Either |
→ → → |
bool |
Required |
Set to |
→ → → |
bool |
Required |
Set to |
→ → → |
string |
Required |
The hostname and port of any proxy being used for this network. If a proxy is not in use, an empty string |
→ → → |
bool |
Required |
Set to |
→ |
number (DIME) |
Required |
The minimum relay fee per kilobyte for transactions in order for this node to accept it into its memory pool |
→ |
number (DIME) |
Required |
The minimum fee increment for mempool limiting or BIP 125 replacement in DIME/kB |
→ |
array |
Required |
An array of objects each describing the local addresses this node believes it listens on |
→ → |
object |
Optional |
An object describing a particular address this node believes it listens on |
→ → → |
string |
Required |
An IP address or .onion address this node believes it listens on. This may be manually configured, auto detected, or based on |
→ → → |
number (int) |
Required |
The port number this node believes it listens on for the associated |
→ → → |
number (int) |
Required |
The number of incoming connections during the uptime of this node that have used this |
→ |
string |
Required |
A plain-text description of any network warnings. If there are no warnings, an empty string will be returned. |
Example from Dimecoin Core 2.3.0.0
dimecoin-cli getnetworkinfo
Result (actual addresses have been replaced with RFC5737 reserved addresses):
{
"version": 2030000,
"subversion": "/dimecoin:2.3.0/",
"protocolversion": 70008,
"localservices": "000000000100040d",
"localrelay": true,
"timeoffset": -1,
"networkactive": true,
"connections": 8,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "ipv6",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "onion",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
}
],
"relayfee": 0.01000,
"incrementalfee": 0.01000,
"localaddresses": [
],
"warnings": ""
}
See also
GetPeerInfo: returns data about each connected network node.
GetNetTotals: returns information about network traffic, including bytes in, bytes out, and the current time.
SetNetworkActive: disables/enables all P2P network activity.
GetPeerInfo#
The getpeerinfo
RPC returns data about each connected network node.
Parameters: none
Result—information about each currently-connected network node
Name |
Type |
Presence |
Description |
---|---|---|---|
|
array |
Required |
An array of objects each describing one connected node. If there are no connections, the array will be empty |
→ |
object |
Optional |
An object describing a particular connected node |
→ → |
number (int) |
Required |
The node’s index number in the local node address database |
→ → |
string |
Required |
The IP address and port number used for the connection to the remote node |
→ → |
string |
Optional |
Our IP address and port number according to the remote node. May be incorrect due to error or lying. Most SPV nodes set this to |
→ → |
string |
Optional |
Bind address of the connection to the peer |
→ → |
string (hex) |
Required |
The services advertised by the remote node in its |
| → →lastsend
| number (int) | Required
(exactly 1) | The Unix epoch time when we last successfully sent data to the TCP socket for this node |
| → →lastrecv
| number (int) | Required
(exactly 1) | The Unix epoch time when we last received data from this node |
| → →bytessent
| number (int) | Required
(exactly 1) | The total number of bytes we’ve sent to this node |
| → →bytesrecv
| number (int) | Required
(exactly 1) | The total number of bytes we’ve received from this node |
| → →conntime
| number (int) | Required
(exactly 1) | The Unix epoch time when we connected to this node |
| → →timeoffset
| number (int) | Required
(exactly 1) | The time offset in seconds |
| → →pingtime
| number (real) | Required
(exactly 1) | The number of seconds this node took to respond to our last P2P ping
message |
| → →minping
| number (real) | Optional
(0 or 1) | The minimum observed ping time (if any at all) |
| → →pingwait
| number (real) | Optional
(0 or 1) | The number of seconds we’ve been waiting for this node to respond to a P2P ping
message. Only shown if there’s an outstanding ping
message |
| → →version
| number (int) | Required
(exactly 1) | The protocol version number used by this node. See the protocol versions section for more information |
| → →subver
| string | Required
(exactly 1) | The user agent this node sends in its version
message. This string will have been sanitized to prevent corrupting the JSON results. May be an empty string |
| → →inbound
| bool | Required
(exactly 1) | Set to true
if this node connected to us (inbound); set to false
if we connected to this node (outbound) |
| → →addnode
| bool | Required
(exactly 1) | Set to true
if this node was added via the addnode
RPC. |
| → →startingheight
| number (int) | Required
(exactly 1) | The height of the remote node’s blockchain when it connected to us as reported in its version
message |
| → →banscore
| number (int) | Required
(exactly 1) | The ban score we’ve assigned the node based on any misbehavior it’s made. By default, Dimecoin Core disconnects when the ban score reaches 100
|
| → →synced_headers
| number (int) | Required
(exactly 1) | The highest-height header we have in common with this node based the last P2P headers
message it sent us. If a headers
message has not been received, this will be set to -1
|
| → →synced_blocks
| number (int) | Required
(exactly 1) | The highest-height block we have in common with this node based on P2P inv
messages this node sent us. If no block inv
messages have been received from this node, this will be set to -1
|
| → →inflight
| array | Required
(exactly 1) | An array of blocks which have been requested from this peer. May be empty |
| → → →
Blocks | number (int) | Optional
(0 or more) | The height of a block being requested from the remote peer |
| → →whitelisted
| bool | Required
(exactly 1) | Set to true
if the remote peer has been whitelisted; otherwise, set to false
. Whitelisted peers will not be banned if their ban score exceeds the maximum (100 by default). By default, peers connecting from localhost are whitelisted |
| → →bytessent_per_msg
| string :
object | Required
(exactly 1) | Information about total sent bytes aggregated by message type |
| → → →
Message Type | number (int) | Required
(1 or more) | Total sent bytes aggregated by message type. One field for every used message type |
| → →bytesrecv_per_msg
| string :
object | Required
(exactly 1) | Information about total received bytes aggregated by message type |
| → → →
Message Type | number (int) | Required
(1 or more) | Total received bytes aggregated by message type. One field for every used message type |
Example from Dimecoin Core 2.3.0.0
dimecoin-cli -mainnet getpeerinfo
Result (edited to show only a single entry, with IP addresses changed to
RFC5737 reserved IP addresses):
[
{
"id": 51,
"addr": "25.31.126.30:11931",
"addrlocal": "42.76.160.67:50780",
"addrbind": "182.178.3.14:50780",
"services": "000000000100040d",
"relaytxes": true,
"lastsend": 1709937478,
"lastrecv": 1709937478,
"bytessent": 78171543,
"bytesrecv": 936013475,
"conntime": 1709864306,
"timeoffset": -1,
"pingtime": 0.095316,
"minping": 0.093957,
"version": 70008,
"subver": "/dimecoin:2.3.0/",
"inbound": false,
"addnode": false,
"startingheight": 5781425,
"banscore": 0,
"synced_headers": 5782938,
"synced_blocks": 5782938,
"inflight": [
],
"whitelisted": false,
"bytessent_per_msg": {
"addr": 385,
"checkpoint": 128001,
"dseg": 65,
"getaddr": 24,
"getdata": 76468394,
"getheaders": 806598,
"getsporks": 48,
"headers": 84962,
"inv": 639952,
"mnp": 704,
"mnw": 3220,
"ping": 19520,
"pong": 19520,
"verack": 24,
"version": 126
}
}
]
See also
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.GetNetTotals: returns information about network traffic, including bytes in, bytes out, and the current time.
GetNetworkInfo: returns information about the node’s connection to the network.
ListBanned#
The listbanned
RPC lists all manually banned IPs/Subnets.
Parameters: none
Result—information about each banned IP/Subnet
Name |
Type |
Presence |
Description |
---|---|---|---|
|
object |
Required |
An array of objects each describing one entry. If there are no entries in the ban list, the array will be empty |
→ |
object |
Optional |
A ban list entry |
→ → |
string |
Required |
The IP/Subnet of the entry |
→ → |
number |
Required |
The Unix epoch time when the entry was added to the ban list |
→ → |
number |
Required |
The Unix epoch time until the IP/Subnet is banned |
Examples from Dimecoin Core 2.3.0.0
dimecoin-cli listbanned
Result:
[
{
"address": "192.0.2.201/32",
"banned_until": 1507906175,
"ban_created": 1507819775,
},
{
"address": "192.0.2.101/32",
"banned_until": 1507906199,
"ban_created": 1507819799,
}
]
See also
SetBan: attempts add or remove a IP/Subnet from the banned list.
ClearBanned: clears list of banned nodes.
Ping#
The ping
RPC sends a P2P ping message to all connected nodes to measure ping time. Results are provided by the getpeerinfo
RPC pingtime and pingwait fields as decimal seconds. The P2P ping
message is handled in a queue with all other commands, so it measures processing backlog, not just network ping.
Parameters: none
Result—null
Name |
Type |
Presence |
Description |
---|---|---|---|
|
null |
Required |
Always JSON |
Example from Dimecoin Core 2.3.0.0
dimecoin-cli -mainnet ping
(Success: no result printed.)
Get the results using the getpeerinfo
RPC:
dimecoin-cli -mainnet getpeerinfo | grep ping
Results:
"pingtime": 0.167647,
"pingtime": 0.164519,
"pingtime": 0.226734,
"pingtime": 0.117908,
"pingtime": 0.113373,
"pingtime": 0.239833,
"pingtime": 0.132679,
"pingtime": 0.124652
See also
GetPeerInfo: returns data about each connected network node.
SetBan#
The setban
RPC attempts add or remove a IP/Subnet from the banned list.
Parameter #1—IP/Subnet of the node
Name |
Type |
Presence |
Description |
---|---|---|---|
IP(/Netmask) |
string |
Required |
The node to add or remove as a string in the form of |
Parameter #2—whether to add or remove the node
Name |
Type |
Presence |
Description |
---|---|---|---|
Command |
string |
Required |
What to do with the IP/Subnet address above. Options are: |
Parameter #3—time how long the ip is banned
Name |
Type |
Presence |
Description |
---|---|---|---|
Bantime |
numeric |
Optional |
Time in seconds how long (or until when if |
Parameter #4—whether a relative or absolute timestamp
Name |
Type |
Presence |
Description |
---|---|---|---|
Absolute |
bool |
Optional |
If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT) |
Result—null
on success
Name |
Type |
Presence |
Description |
---|---|---|---|
|
null |
Required |
Always JSON |
Example from Dimecoin Core 2.3.0.0
Ban the following node.
dimecoin-cli -mainnet setban 147.22.2.111 add 1591000
Result (no output from dimecoin-cli
because result is set to null
).
See also
ListBanned: lists all manually banned IPs/Subnets.
ClearBanned: clears list of banned nodes.
SetNetworkActive#
The setnetworkactive
RPC disables/enables all P2P network activity.
Parameter #1—whether to disable or enable all P2P network activity
Name |
Type |
Presence |
Description |
---|---|---|---|
Activate |
bool |
Required |
Set to |
*Result—null
or error on failure_
Name |
Type |
Presence |
Description |
---|---|---|---|
|
null |
Required |
JSON |
Example from Dimecoin Core 2.3.0.0
dimecoin-cli setnetworkactive true
Result (no output from dimecoin-cli
because result is set to null
).
See also
GetNetworkInfo: returns information about the node’s connection to the network.