In Kubo sourse code, where is the source code of setting the maximum chunk size?Where is the source code of chunker?
This isn’t in the chunker really, you could just make bigger blocks, issues are gonna happen in the network layer because other nodes will refuse thoses blocks.
Why do you want to do that exactly ?
What is the maximum size of the blocks that other nodes will not refuse?
2MiB is the spec, it’s slightly higher in practice but very unreliable across implementations and even different tools of the same implementation.
2MiB always works (or atleast if it doesn’t it’s wrong and must be fixed)
Thank you very much for your reply ! How can I make the maximum block to be 2M?Where should I make changes in the source code?
Kubo doesn’t support this because it might add dusts around it (so if the blocks were 2MiB precisely, then if it tries to wrap it in protobuf it would reach ~2.000001MiB which would be oversized).
The most Kubo accept is 1MiB, you can use ipfs add --chunker=size-$((1024*1024)) --raw-leaves
to do that.
GitHub - Jorropo/linux2ipfs: Small pipeline and extreme-performance oriented IPFS implementation to upload files and deltas to pinning services very fast. use 2MiB by default