Networking

P2P Related Commands.

You can use mvc-cli help command to view the usage of specific commands. The JsonRpc call method is in the example.

Commands

== Network ==
addnode "node" "add|remove|onetry"
clearbanned
disconnectnode "[address]" [nodeid]
getaddednodeinfo ( "node" )
getconnectioncount
getexcessiveblock
getnettotals
getnetworkinfo
getpeerinfo
listbanned
ping
setban "subnet" "add|remove" (bantime) (absolute)
setblockmaxsize blockSize
setexcessiveblock blockSize
setnetworkactive true|false
settxnpropagationfreq freq

addnode

Attempts add or remove a node from the addnode list. Or try a connection to a node once.

Param๏ผš

  • node (string, required)

  • command (string, required)

clearbanned

Clear all banned IPs.

disconnectnode

ๆ–ญๅผ€ไธŽๆŒ‡ๅฎš่Š‚็‚น็š„่ฟžๆŽฅใ€‚

Param๏ผš

  • address (string, optional) ่ฆๆ–ญๅผ€่ฟžๆŽฅ็š„่Š‚็‚น็š„IPๅœฐๅ€ๅ’Œ็ซฏๅฃใ€‚

  • nodeid (string, optional) ่ฆๆ–ญๅผ€่ฟžๆŽฅ็š„่Š‚็‚น็š„IDใ€‚

getaddednodeinfo

Returns information about the given added node, or all added nodes(note that onetry addnodes are not listed here)

Param๏ผš

  • node (string, optional)

getconnectioncount

Returns the number of connections to other nodes.

getexcessiveblock

Return the excessive block size.

getnettotals

Returns information about network traffic, including bytes in, bytes out, and current time.

getnetworkinfo

Returns an object containing various state info regarding P2P networking.

getpeerinfo

Returns data about each connected network node as a json array of objects.

listbanned

List all banned IPs/Subnets.

ping

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. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.

setban

Attempts add or remove a IP/Subnet from the banned list.

Param๏ผš

  • subnet (string, required)

  • command (string, required)

  • bantime (numeric, optional)

  • absolute (boolean, optional)

setblockmaxsize

Sets maximum size of produced block.

Param๏ผš

  • blockSize (numeric, required)

setexcessiveblock

Set the excessive block size. Excessive blocks will not be used in the active chain or relayed. This discourages the propagation of blocks that you consider excessively large.

Param๏ผš

  • blockSize (numeric, required)

setnetworkactive

Disable/enable all p2p network activity.

Param๏ผš

  • state true|false (boolean, required)

settxnpropagationfreq

Set the frequency (in milli-seconds) the transaction propagator runs at.

Param๏ผš

  • freq (numeric, required)