In the IPFS white paper, it was written that blocks were exchanged by BitSwap.
In my understanding is, The block is
・Uploaded data itself
・Files linked to Merkle dag format
・ Or part of the file divided into Merkle dag format
It seems to be written that these blocks are distributed among nodes.
When will it be distributed (or exchanged?)?
If it is distributed when another node downloads the file,
After downloading the file
・Uploaded node
・Downloaded node
・Nodes distributed by BitSwap
the file (or part of it) is cached and distributed in above nodes?
is this understanding is correct?
It will be shared when other peers request the block.
Just to be clear, when you upload a file it doesn’t get pushed to other peers in vanilla IPFS. So I think the second and third point in this list are the same if only one peer has requested a block from the uploading peer.
@leerspace
I think when downloading the file, it will looking for the node where the file exists in the P2P network.
If the file is found, does it establish a P2P network connection directly with the node that has file when downloading?
when download, are file(or the part divided by Merkle DAG) spread only to the following nodes?
1:download node.
2:node that has the file.
In other words, actually file are spread to only one node when download?
Is the file spread by traffic the network when downloading or searching for files?
I had forgotten some of the details in the draft v3 of the whitepaper so I looked through it to refresh myyself. I think a the bartering and especially the part about requesting rare blocks on behalf of other nodes are not reflective of the current implementation of bitswap. Having other nodes request data on behalf of your node could be a problem in cases of regulated content (e.g., copies of copyrighted works, etc).
I think the document is referring to an exchange of blocks between peers – where each peer is getting a block that it wants as part of the transaction. However, I don’t think this is how bitswap currently works; rather, my understanding is that peers altruistically provide blocks to whoever wants them without requiring blocks in return.
I think you’re technically right in practice, since it’s a one-way transaction. The downloading peer didn’t need to give anything to the providing node in order to get what it wants.