Skip to content

Serialize to DAG-JSON Using CID Values in the Nodes #30

@dysbulic

Description

@dysbulic

Currently, the DAG-JSON export starts with a two element object: the root hash of a Merkle Tree & an Ethereum signature over those bytes in 0xhex format.

Each node is in a different DAG-JSON blob, but those blobs don't contain the CIDs of their children. There root of the document is a massive index which lists all the node CIDs (unnecessary) & all the relationships. I worked it out with Claude & the fear was what would happen if there's cycle in the graph?

The way around having cycles is solved using a special token in the path stream. When the resource locator is dereferencing a path, when it sees one of those it skips up to the root of the file system, and from there any node in the tree is reachable.

When the tree is being serialized, however, those tokens are replaced with directories which contain the same thing as the root of the file system, and whatever the path is that postcedes that location is dereferenced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IPFSProblems with IPFS.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions