Closed alanshaw closed 6 years ago
When given input path /ipfs/QmRoot/path/to/data, return { cid, path }.
/ipfs/QmRoot/path/to/data
{ cid, path }
Where cid is the CID of the node that contains the data addressed by the input path. path in the result is the path within the node to the data.
cid
path
Examples:
multi node:
dag.put({ to: { data: 5 } }, { format: 'dag-cbor' }) // QmLeaf dag.put({ path: new CID('QmLeaf') }, { format: 'dag-cbor' }) // QmRoot
dag.resolve('/ipfs/QmRoot/path/to/data') would return:
dag.resolve('/ipfs/QmRoot/path/to/data')
{ cid: CID<QmLeaf>, path: 'to/data' }
single node:
dag.put({ path: { to: { data: 5 } } }, { format: 'dag-cbor' }) // QmRoot
{ cid: CID<QmRoot>, path: 'path/to/data' }
When given input path
/ipfs/QmRoot/path/to/data
, return{ cid, path }
.Where
cid
is the CID of the node that contains the data addressed by the input path.path
in the result is the path within the node to the data.Examples:
multi node:
dag.resolve('/ipfs/QmRoot/path/to/data')
would return:single node:
dag.resolve('/ipfs/QmRoot/path/to/data')
would return: