As you learned in the Content Addressing on the Decentralized Web tutorial, CIDs (Content Identifiers) are uniquely matched to the content they represent through cryptographic hashing. Two files with identical contents have identical CIDs and two files with even the smallest difference between them have distinct CIDs. The same is true for directories. Every time you update the contents of a file or directory, its CID changes.
When your root directory was empty and you checked its status using ipfs.files.stat
, you saw this result:
{
"cid": CID("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),
"size": 0,
"cumulativeSize": 4,
"blocks": 0,
"type": "directory",
"withLocality": false
}
What might it look like now that you've added one or more files to it? Which fields should now have changed?
Run files.stat
to check the status of your root directory ( /
) again now that you've added one or more files. Be sure to return your result.
Feeling stuck? We'd love to hear what's confusing so we can improve this lesson. Please share your questions and feedback.