Peers retrieves all the information we know about each individual peer at the protocol granularity.
()
| 231 | // Peers retrieves all the information we know about each individual peer at the |
| 232 | // protocol granularity. |
| 233 | func (api *PublicAdminAPI) Peers() ([]*p2p.PeerInfo, error) { |
| 234 | server := api.node.Server() |
| 235 | if server == nil { |
| 236 | return nil, ErrNodeStopped |
| 237 | } |
| 238 | return server.PeersInfo(), nil |
| 239 | } |
| 240 | |
| 241 | // NodeInfo retrieves all the information we know about the host node at the |
| 242 | // protocol granularity. |