Skip to content

I have a large file. I want to transfer this file block by block. #4213

Closed Answered by thomaseizinger
blackshadowsoftwareltd asked this question in Q&A
Discussion options

You must be logged in to vote

You can certainly do that. You can:

  • look into using an existing protocol like https://github.com/ipfs-rust/libp2p-bitswap
  • implement your own using libp2p-request-response if you want to follow a request-response model
  • roll a custom protocol by implementing NetworkBehaviour and ConnectionHandler if you e.g. want to use more of a streaming approach

For the most part, rust-libp2p deals with the abstractions around managing connections for you and running protocols over them concurrently. A very simple example of a file-sharing protocol is in https://github.com/libp2p/rust-libp2p/tree/master/examples/file-sharing but that one is not using blocks.

If you want to implement your own protocol, …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by blackshadowsoftwareltd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants