Skip to main content

dag_export

Function dag_export 

Source
pub async fn dag_export(cid_str: &str, output: Option<&Path>) -> Result<()>
Expand description

Export a DAG sub-graph as a CAR v1 stream.

When output is None, the CAR bytes are written to stdout. Traversal is breadth-first; only locally available blocks are included.

CAR v1 format (simplified, no compression):

<varint: header-len> <dag-cbor-header> <blocks…>

Each block:

<varint: cid-len + data-len> <cid-bytes> <data-bytes>