ipfs / ipfs/kubo

need Peers Count api

Open
#7,539 2 comments 2 reactions 0 assignees View on GitHub
exp/novice kind/enhancement need/analysis P3 topic/commands
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

the api lack of Peers Count

because pooling for peers count by getting a full list of peers is not making sense,
```js
const peerInfos = await ipfs.swarm.peers({ timeout: 2500 })
return peerInfos.length
```

especially when the peers is around 6k-7k list... every 2.5s pooling for the long list is consuming CPU inefficiently.

_Originally posted by @thienpow in https://github.com/ipfs/go-ipfs/issues/7528#issuecomment-658686189_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.