Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

Get a large file and watch bitswap acting.


Reset the bitswap statistics.
ipfs bitswap stat
ipfs shutdown
ipfs daemon &
ipfs bitswap stat

Watch the statistics in one terminal.
while true
do
    ipfs bitswap stat | grep -v Qm | grep -v 12D
    sleep 1
done

Watch the bitswap ledger in one terminal.
while true
do
  for peer in $(ipfs swarm peers | awk -F/ '{ print $NF }')
  do
    ledgerdata=$(ipfs bitswap ledger $peer)
    if [[ -n "$(echo $ledgerdata | grep -v '\t0$' | grep -v '\t0.000000$' | grep Bytes)" ]]
    then 
        date
        echo $peer
        echo $ledgerdata
        echo
    fi
  done
  sleep 1
done

Watch the number of connected peers in one terminal.
while true
do
   printf "\rNumber of connected peers: %s" $(ipfs swarm peers | wc -l)
   sleep 1
done

Start the download in one terminal.
ipfs get -o /tmp/bigfile QmYi6yy3ygc3dNJETqFvvyXdZx28dNyNbZLHkiimhd8Jzd

Note: Do you have it already in your repo? You can remove it, i.e. ipfs repo gc. If the download is stalling, you can do the same download from another node in parallel.

ToDo: What is different, if a peer nearby has the big file already downloaded?