Programmatically Verify IPFS Data Transfer

We are creating a desktop application on Electron for sharing media in IPFS. We want to motivate people who either added or installed IPFS, provided data to other users, and actually “sowed” the data. We want to track how much data is sent and received by each user, programmatically and periodically.

Is there a standard template or service to do this?

TIA!

+6
source share
1 answer

In the CLI, you can use the command ipfs stats bw -p <peer id>to see the total number of bytes sent and received between your node and the peer identifier you are transmitting.

$ ipfs stats bw -p  QmeMKDA6HbDD8Bwb4WoAQ7s9oKZTBpy55YFKG1RSHnBz6a
Bandwidth
TotalIn: 875 B
TotalOut: 14 kB
RateIn: 0 B/s
RateOut: 0 B/s

: https://docs.ipfs.io/reference/api/cli/#ipfs-stats-bw.

ipfs.stats.bw js IPFS js-ipfs js-ipfs-http-client http api ipfs.

ipfs.stats.bw , dht- , .

, ipfs bitswap ledger .

$ ipfs bitswap ledger QmeMKDA6HbDD8Bwb4WoAQ7s9oKZTBpy55YFKG1RSHnBz6a
Ledger for QmeMKDA6HbDD8Bwb4WoAQ7s9oKZTBpy55YFKG1RSHnBz6a
Debt ratio: 0.000000
Exchanges:  0
Bytes sent: 0
Bytes received: 0

: https://docs.ipfs.io/reference/api/cli/#ipfs-bitswap-ledger

API js-ipfs js-http-api-client.

0

All Articles