Network RPC Methods
Network RPCs provide information about network status, peer connections, and allow management of network settings.Network Information
getnetworkinfo
Returns information about the node’s network state.Bitcoin Core version number
User agent string
Protocol version
Services offered by this node (hex)
Human-readable service names
Whether transaction relay is enabled
Time offset in seconds
Total number of connections
Number of inbound connections
Number of outbound connections
Whether p2p networking is enabled
Information per network (ipv4, ipv6, onion, i2p, cjdns)
Minimum relay fee for transactions
Minimum fee increment for mempool replacement
List of local addresses
Network warnings
Peer Management
getpeerinfo
Returns data about each connected network peer.Peer index
IP address and port of the peer
Bind address of the connection to the peer
Local address as reported by the peer
Network type: ipv4, ipv6, onion, i2p, cjdns, not_publicly_routable
Services offered by peer (hex)
Human-readable service names
Whether we relay transactions to this peer
Unix timestamp of last send
Unix timestamp of last receive
Unix timestamp of last valid transaction received
Unix timestamp of last block received
Total bytes sent
Total bytes received
Unix timestamp of connection time
Last ping time in seconds
Minimum observed ping time in seconds
Peer version
Peer user agent string
True for inbound connections, false for outbound
Last header we have in common with peer
Last block we have in common with peer
Connection type: outbound-full-relay, block-relay-only, inbound, manual, addr-fetch, feeler
Transport protocol: detecting, v1, v2 (BIP324 encrypted)
Session ID for v2 transport (empty for v1)
getconnectioncount
Returns the number of connections to other nodes.Total number of connections
ping
Requests a ping be sent to all other nodes.Results are provided in
getpeerinfo. The ping command measures processing backlog, not just network ping.addnode
Adds, removes, or tries a connection to a node.disconnectnode
Disconnects from a specified node.Provide either
address or nodeid, not both.getaddednodeinfo
Returns information about manually added nodes.Node address
Whether currently connected
Connection addresses and connection status
getnodeaddresses
Returns known addresses from the node’s address manager.Unix timestamp when address was last seen
Services offered by node
Network address
Network port
Network type
Network Control
setnetworkactive
Enables or disables all P2P network activity.Current network state after command
Ban Management
listbanned
Lists all manually banned IP addresses/subnets.Banned IP/subnet
Unix timestamp when ban was created
Unix timestamp when ban expires
setban
Adds or removes an IP/subnet from the banned list.clearbanned
Clears all banned IPs.Traffic Control
getnettotals
Returns information about network traffic, including bytes received and sent.Total bytes received
Total bytes sent
Current Unix time in milliseconds
Upload target information:
timeframe: Target timeframe in secondstarget: Target in bytes (0 = no limit)target_reached: Whether target was reachedserve_historical_blocks: Whether serving historical blocksbytes_left_in_cycle: Bytes left in current cycletime_left_in_cycle: Seconds left in current cycle
Connection Types
Bitcoin Core maintains different types of connections:Transport Protocols
Network Types
Bitcoin Core supports multiple network types:- ipv4: IPv4 connections
- ipv6: IPv6 connections
- onion: Tor hidden service connections
- i2p: I2P (Invisible Internet Project) connections
- cjdns: CJDNS network connections
- not_publicly_routable: Internal/private network connections