Merkle dag node and link structure

I am able to replicate the “ipfs add” command on small file that less than 256kb. When I try to add a large file, the final hash “Qm…” is different than the ipfs add command. There are two protobuf message structure: “Data” which wraps FSNode and “PBNode” which wraps ProtoNode(merkledag node). My question are:

  1. what does the Tsize in the link/PBLink correspond to
  2. what does the Size in PBNode correspond to
  3. what does the Blocksizes in PBNode corresponds to

I have tried the length of marshaled data from FSNode, the size of raw data in FSNode and accumulative size(length of marshaled data from PBNode). But the root node hash is still different, only leaf nodes hash are the same. Thanks!

1 Like

Any hints on the serialization of the merkledag node?