Docs

system_peers - Bittensor RPC Method

List all peers currently connected to a Bittensor node.

Returns a list of peers the Bittensor node is currently connected to, including their peer ID, roles, best block information, and protocol details. This is useful for network monitoring, debugging connectivity issues, and understanding the node's position in the peer-to-peer network.

Parameters

None.

Response

FieldTypeDescription
resultarrayArray of peer objects.

Each peer object:

FieldTypeDescription
peerIdstringThe libp2p peer ID.
rolesstringPeer's roles (e.g. "FULL", "AUTHORITY").
bestHashstringHash of the peer's best block.
bestNumbernumberBlock number of the peer's best block.

Code Examples

Use Cases

  • Connectivity monitoring -- Track the number and identity of connected peers to ensure the node is well-connected to the Bittensor network.
  • Sync diagnostics -- Compare peer best block numbers to the node's own to diagnose sync issues.
  • Network topology -- Build a view of the peer-to-peer network topology for monitoring dashboards.
  • Peer health checks -- Detect when a node becomes isolated or has too few peers.

Notes

  • On public shared RPC endpoints, the peer list may be masked, truncated, or empty for security reasons.
  • The method may require --rpc-methods unsafe on some node configurations.
  • The peer count can fluctuate as connections are established and dropped.