Amount of children

Hi,

Learning more about Merkle DAG I was wondering how was the amount of children choosen ?


Watching image exemple, 2 children is usually shown. However when i try to check my own file in https://dag.ipfs.io/ it can changes.

Is it random ? Is it choosen by default by IPFS ? Can we manually choose it ?

Thank you for your time

Assuming your talking about files. The number of child blocks will be the total size divided by block size. As for folders, it’s the number of files in them.

Very large files or folder works differently.

1 Like

Hi, thanks for your response.

You mean that there are never parent node except the root node for files ? There is only a root node directly connected to the rest of the blocks ?

It is different for folder but it’s easily understandable (1 intermediate parent node by file). But for very large files you said it is different, have you any docs on how are intermediate parent node choosen ?

Thanks again :smiley: @SionoiS

The problem you run into is that one block may be too small to fit all links to all the blocks (same with folder), in this case, you have to use some more advanced data structure.

Maybe someone from IPFS can explain what is being worked on right now to fix this problem.

This can also help you understand.