Network

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

Response

📌 Examples

Command:

./komodo-cli addnode "192.168.0.6:8233" "onetry"

<collapse-text hidden title="Response">

(none)

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8233", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

(none)

</collapse-text>

clearbanned

clearbanned

The clearbanned method clears all banned IPs.

Arguments

Response

📌 Examples

Command:

./komodo-cli clearbanned

<collapse-text hidden title="Response">

(none)

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

(none)

</collapse-text>

disconnectnode

disconnectnode "node"

The disconnectnode method instructs the daemon to immediately disconnect from the specified node.

Use getpeerinfo to determine the result.

Arguments

Response

📌 Examples

Command:

./komodo-cli disconnectnode "192.168.0.6:8233"

<collapse-text hidden title="Response">

(none)

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:8233"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

(none)

</collapse-text>

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

Response

📌 Examples

Command:

./komodo-cli getaddednodeinfo true

<collapse-text hidden title="Response">

[
  {
    "addednode": "78.47.196.146",
    "connected": true,
    "addresses": [
      {
        "address": "78.47.196.146:7770",
        "connected": "outbound"
      }
    ]
  }
]

</collapse-text>

Command:

./komodo-cli getaddednodeinfo true "78.47.205.239"

<collapse-text hidden title="Response">

[
  {
    "addednode": "78.47.205.239",
    "connected": true,
    "addresses": [
      {
        "address": "78.47.205.239:7770",
        "connected": "outbound"
      }
    ]
  }
]

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": [true, "78.47.205.239"] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": [
    {
      "addednode": "78.47.205.239",
      "connected": true,
      "addresses": [
        {
          "address": "78.47.205.239:7770",
          "connected": "outbound"
        }
      ]
    }
  ],
  "error": null,
  "id": "curltest"
}

</collapse-text>

getconnectioncount

getconnectioncount

The getconnectioncount method returns the number of connections to other nodes.

Arguments

Response

📌 Examples

Command:

./komodo-cli getconnectioncount

<collapse-text hidden title="Response">

10

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getconnectioncount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": 10,
  "error": null,
  "id": "curltest"
}

</collapse-text>

getdeprecationinfo

getdeprecationinfo

The getdeprecationinfo method returns an object containing current version and deprecation block height.

::: tip This method is applicable only to the DIC main net. :::

Arguments

Response

📌 Examples

Command:

./komodo-cli getdeprecationinfo

<collapse-text hidden title="Response">

{
  "version": 1001550,
  "subversion": "/MagicBean:1.0.15/",
  "deprecationheight": 1400000
}

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdeprecationinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": {
    "version": 1001550,
    "subversion": "/MagicBean:1.0.15/",
    "deprecationheight": 1400000
  },
  "error": null,
  "id": "curltest"
}

</collapse-text>

getnettotals

getnettotals

The getnettotals method returns information about network traffic, including bytes in, bytes out, and current time.

Arguments

Response

📌 Examples

Command:

./komodo-cli getnettotals

<collapse-text hidden title="Response">

{
  "totalbytesrecv": 29853501,
  "totalbytessent": 15589555,
  "timemillis": 1536821874559
}

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnettotals", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": {
    "totalbytesrecv": 29872297,
    "totalbytessent": 15650741,
    "timemillis": 1536821938902
  },
  "error": null,
  "id": "curltest"
}

</collapse-text>

getnetworkinfo

getnetworkinfo

The getnetworkinfo method returns an object containing various state info regarding p2p networking.

Arguments

Response

📌 Examples

Command:

./komodo-cli getnetworkinfo

<collapse-text hidden title="Response">

{
  "version": 1001550,
  "subversion": "/MagicBean:1.0.15/",
  "protocolversion": 170003,
  "localservices": "0000000000000001",
  "timeoffset": -1,
  "connections": 10,
  "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.000001,
  "localaddresses": [],
  "warnings": ""
}

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": {
    "version": 1001550,
    "subversion": "/MagicBean:1.0.15/",
    "protocolversion": 170003,
    "localservices": "0000000000000001",
    "timeoffset": -1,
    "connections": 10,
    "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": 1e-6,
    "localaddresses": [],
    "warnings": ""
  },
  "error": null,
  "id": "curltest"
}

</collapse-text>

getpeerinfo

getpeerinfo

The getpeerinfo method returns data about each connected network node as a json array of objects.

Arguments

Response

📌 Examples

Command:

./komodo-cli getpeerinfo

<collapse-text hidden title="Response">

[
  {
    "id": 1,
    "addr": "78.47.196.146:7770",
    "addrlocal": "69.178.104.172:49724",
    "services": "0000000000000001",
    "lastsend": 1536827621,
    "lastrecv": 1536827617,
    "bytessent": 5181633,
    "bytesrecv": 6245958,
    "conntime": 1536792412,
    "timeoffset": -2,
    "pingtime": 0.234065,
    "version": 170003,
    "subver": "/MagicBean:1.0.15/",
    "inbound": false,
    "startingheight": 1007074,
    "banscore": 45,
    "synced_headers": 1007671,
    "synced_blocks": 1007671,
    "inflight": [],
    "whitelisted": false
  }
]

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": [
    {
      "id": 1,
      "addr": "78.47.196.146:7770",
      "addrlocal": "69.178.104.172:49724",
      "services": "0000000000000001",
      "lastsend": 1536827702,
      "lastrecv": 1536827698,
      "bytessent": 5195639,
      "bytesrecv": 6247781,
      "conntime": 1536792412,
      "timeoffset": -2,
      "pingtime": 0.234605,
      "version": 170003,
      "subver": "/MagicBean:1.0.15/",
      "inbound": false,
      "startingheight": 1007074,
      "banscore": 45,
      "synced_headers": 1007672,
      "synced_blocks": 1007672,
      "inflight": [],
      "whitelisted": false
    }
  ],
  "error": null,
  "id": "curltest"
}

</collapse-text>

listbanned

listbanned

The listbanned method lists all banned IP addresses and subnets.

Arguments

Response

📌 Examples

Command:

./komodo-cli listbanned

<collapse-text hidden title="Response">

[
  {
    "address": "78.47.205.239/255.255.255.255",
    "banned_until": 1536945306
  }
]

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": [
    {
      "address": "78.47.205.239/255.255.255.255",
      "banned_until": 1536945306
    }
  ],
  "error": null,
  "id": "curltest"
}

</collapse-text>

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

Response

📌 Examples

Command:

./komodo-cli ping

<collapse-text hidden title="Response">

(none)

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "ping", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

{
  "result": null,
  "error": null,
  "id": "curltest"
}

</collapse-text>

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

Response

::: tip Use listbanned to view results. :::

📌 Examples

Command:

./komodo-cli setban "192.168.0.6" "add" 86400

<collapse-text hidden title="Response">

(none)

</collapse-text>

Command:

./komodo-cli setban "192.168.0.0/24" "add"

<collapse-text hidden title="Response">

(none)

</collapse-text>

You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.

Command:

curl --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setban", "params": ["78.47.205.239", "add", 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

<collapse-text hidden title="Response">

(none)

</collapse-text>

Last updated