Lesson: Build a Tree of Data in IPFS Using Cryptographic Hashes to Link the Pieces (a Merkle DAG)
Last updated
Was this helpful?
Last updated
Was this helpful?
Work in Progress This is the content from vaguely re-framed to fit the Lesson framework.
Build a tree of data in IPFS using cryptographic hashes to link the pieces (a Merkle DAG)
In ipfs, a block refers to a single unit of data, identified by its key (hash). a block can be any sort of data, and does not necessarily have any sort of format associated with it. an object, on the other hand, refers to a block that follows the merkledag protobuf data format. it can be parsed and manipulated via the ipfs object
command. any given hash may represent an object or a block.
Creating your own blocks is easy! simply put your data in a file and run ipfs block put <yourfile>
on it, or you can pipe your filedata into ipfs block put
, like so:
Note: When making your own block data, you wont be able to read the data with ipfs cat
, this is because you are inputting raw data without the unixfs data format. To read raw blocks use ipfs block get
as shown in the example.