Network RPC Commands
Documentation for Raptoreum Network RPC calls.
addnode
Attempts to add or remove a node from the addnode list.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
Result
null (json null)
Examples
raptoreum-cli addnode "192.168.0.6:9999" "onetry"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:9999", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
clearbanned
Clear all banned IPs.
Arguments
No arguments.
Result
null (json null)
Examples
raptoreum-cli clearbanned
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
disconnectnode
Immediately disconnects from the specified peer node.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 1 | address |
string | Optional | fallback to nodeid | See CLI help for details |
| 2 | nodeid |
numeric | Optional | fallback to address) The node ID (see getpeerinfo for node IDs | See CLI help for details |
Result
null (json null)
Examples
raptoreum-cli disconnectnode "192.168.0.6:9999"
raptoreum-cli disconnectnode "" 1
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:9999"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
getaddednodeinfo
Returns information about the given added node, or all added nodes
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 1 | node |
string | Optional | all nodes | See CLI help for details |
Result
[ (json array)
{ (json object)
"addednode" : "str", (string) The node IP address or name (as provided to addnode)
"connected" : true|false, (boolean) If connected
"addresses" : [ (json array) Only when connected = true
{ (json object)
"address" : "str", (string) The Raptoreum server IP and port we're connected to
"connected" : "str" (string) connection, inbound or outbound
},
...
]
},
...
]
Examples
raptoreum-cli getaddednodeinfo "192.168.0.201"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": ["192.168.0.201"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
getconnectioncount
Returns the number of connections to other nodes.
Arguments
No arguments.
Result
n (numeric) The connection count
Examples
raptoreum-cli getconnectioncount
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getconnectioncount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
getnettotals
Returns information about network traffic, including bytes in, bytes out,
Arguments
No arguments.
Result
{ (json object)
"totalbytesrecv" : n, (numeric) Total bytes received
"totalbytessent" : n, (numeric) Total bytes sent
"timemillis" : xxx, (numeric) Current UNIX time in milliseconds
"uploadtarget" : { (json object)
"timeframe" : n, (numeric) Length of the measuring timeframe in seconds
"target" : n, (numeric) Target in bytes
"target_reached" : true|false, (boolean) True if target is reached
"serve_historical_blocks" : true|false, (boolean) True if serving historical blocks
"bytes_left_in_cycle" : n, (numeric) Bytes left in current time cycle
"time_left_in_cycle" : n (numeric) Seconds left in current time cycle
}
}
Examples
raptoreum-cli getnettotals
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnettotals", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
getnetworkinfo
{ (json object)
Arguments
No arguments.
Result
{ (json object)
"version" : n, (numeric) the server version
"buildversion" : "str", (string) the server build version including RC info or commit as relevant
"subversion" : "str", (string) the server subversion string
"protocolversion" : n, (numeric) the protocol version
"localservices" : "hex", (string) the services we offer to the network
"localservicesnames" : [ (json array) the services we offer to the network, in human-readable form
"str", (string) the service name
...
],
"localrelay" : true|false, (boolean) true if transaction relay is requested from peers
"timeoffset" : n, (numeric) the time offset
"connections" : n, (numeric) the number of connections
"networkactive" : true|false, (boolean) whether p2p networking is enabled
"socketevents" : "str", (string) the socket events mode, either kqueue, epoll, poll or select
"networks" : [ (json array) information per network
{ (json object)
"name" : "str", (string) network (ipv4, ipv6 or onion)
"limited" : true|false, (boolean) is the network limited using -onlynet?
"reachable" : true|false, (boolean) is the network reachable?
"proxy" : "str", (string) ("host:port") the proxy that is used for this network, or empty if none
"proxy_randomize_credentials" : true|false (boolean) Whether randomized credentials are used
},
...
],
"relayfee" : n, (numeric) minimum relay fee for transactions in RTM/kB
"incrementalfee" : n, (numeric) minimum fee increment for mempool limiting in RTM/kB
"localaddresses" : [ (json array) list of local addresses
{ (json object)
"address" : "str", (string) network address
"port" : n, (numeric) network port
"score" : n (numeric) relative score
},
...
],
"warnings" : "str" (string) any network and blockchain warnings
}
Examples
raptoreum-cli getnetworkinfo
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
getnodeaddresses
Return known addresses which can potentially be used to find new nodes in the network
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 1 | count |
numeric | Optional | 1 | See CLI help for details |
Result
[ (json array)
{ (json object)
"time" : xxx, (numeric) The UNIX epoch time of when the node was last seen
"services" : n, (numeric) The services offered
"address" : "str", (string) The address of the node
"port" : n (numeric) The port of the node
},
...
]
Examples
raptoreum-cli getnodeaddresses 8
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnodeaddresses", "params": [8] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
getpeerinfo
Returns data about each connected network node as a json array of objects.
Arguments
No arguments.
Result
[ (json array)
{ (json object)
"id" : n, (numeric) Peer index
"addr" : "str", (string) (host:port) The IP address and port of the peer
"addrlocal" : "str", (string) (ip:port) Local address as reported by the peer
"addrbind" : "str", (string) (ip:port) Bind address of the connection to the peer
"mapped_as" : "str", (string) The AS in the BGP route to the peer used for diversifying peer selection
"services" : "hex", (string) The services offered
"verified_proregtx_hash" : "hex", (string, optional) Only present when the peer is a smartnode and successfully authenticated via MNAUTH. In this case, this field contains the protx hash of the smartnode
"verified_pubkey_hash" : "hex", (string, optional) Only present when the peer is a smartnode and successfully authenticated via MNAUTH. In this case, this field contains the hash of the smartnode's operator public key
"servicesnames" : [ (json array) the services offered, in human-readable form
"str", (string) the service name if it is recognised
...
],
"relaytxes" : true|false, (boolean) Whether peer has asked us to relay transactions to it
"lastsend" : xxx, (numeric) The UNIX epoch time of the last send
"lastrecv" : xxx, (numeric) The UNIX epoch time of the last receive
"bytessent" : n, (numeric) The total bytes sent
"bytesrecv" : n, (numeric) The total bytes received
"conntime" : xxx, (numeric) The UNIX epoch time of the connection
"timeoffset" : n, (numeric) The time offset in seconds
"pingtime" : n, (numeric) ping time (if available)
"minping" : n, (numeric) minimum observed ping time (if any at all)
"pingwait" : n, (numeric) ping wait (if non-zero)
"version" : n, (numeric) The peer version, such as 70001
"subver" : "str", (string) The string version
"inbound" : true|false, (boolean) Inbound (true) or Outbound (false)
"addnode" : true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection
"smartnode" : true|false, (boolean) Whether connection was due to smartnode connection attempt
"startingheight" : n, (numeric) The starting height (block) of the peer
"banscore" : n, (numeric) The ban score
"synced_headers" : n, (numeric) The last header we have in common with this peer
"synced_blocks" : n, (numeric) The last block we have in common with this peer
"inflight" : [ (json array)
n, (numeric) The heights of blocks we're currently asking from this peer
...
],
"whitelisted" : true|false, (boolean) Whether the peer is whitelisted
"bytessent_per_msg" : { (json object)
"msg" : n, (numeric) The total bytes sent aggregated by message type
When a message type is not listed in this json object, the bytes sent are 0.
Only known message types can appear as keys in the object.
...
},
"bytesrecv_per_msg" : { (json object)
"msg" : n (numeric) The total bytes received aggregated by message type
When a message type is not listed in this json object, the bytes received are 0.
Only known message types can appear as keys in the object and all bytes received of unknown message types are listed under '*other*'.
}
},
...
]
Examples
raptoreum-cli getpeerinfo
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
listbanned
List all manually banned IPs/Subnets.
Arguments
No arguments.
Result
[ (json array)
{ (json object)
"address" : "str", (string)
"banned_until" : xxx, (numeric)
"ban_created" : xxx (numeric)
},
...
]
Examples
raptoreum-cli listbanned
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
ping
Requests that a ping be sent to all other nodes, to measure ping time.
Arguments
No arguments.
Result
null (json null)
Examples
raptoreum-cli ping
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "ping", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
setban
Attempts to add or remove an IP/Subnet from the banned list.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 3 | bantime |
numeric | Optional | 0) time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument | See CLI help for details |
| 4 | absolute |
boolean | Optional | false | See CLI help for details |
Result
null (json null)
Examples
raptoreum-cli setban "192.168.0.6" "add" 86400
raptoreum-cli setban "192.168.0.0/24" "add"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setban", "params": ["192.168.0.6", "add", 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
setnetworkactive
Disable/enable all p2p network activity.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
Result
true|false (boolean) The value that was passed in