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
| Field | Type | Description |
|---|---|---|
result | array | Array of peer objects. |
Each peer object:
| Field | Type | Description |
|---|---|---|
peerId | string | The libp2p peer ID. |
roles | string | Peer's roles (e.g. "FULL", "AUTHORITY"). |
bestHash | string | Hash of the peer's best block. |
bestNumber | number | Block 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 unsafeon some node configurations. - The peer count can fluctuate as connections are established and dropped.
Related Methods
system_localListenAddresses-- Get the node's own listen addressessystem_reservedPeers-- List reserved (pinned) peerssystem_addReservedPeer-- Add a reserved peersystem_syncState-- Check the node's sync progresssystem_unstable_networkState-- Detailed network state diagnostics