Expand description
decdn origin import — seed a cache origin store with local content
(issue #1904).
For every blob it writes the sharded data object {base}/{hex[0..2]}/{hex}
and its sibling pre-order bao outboard {hex}.obao4 — the exact layout the
daemon reads back (ADR 037 §Origin-tier pull-through).
--to is a local filesystem directory: the store is written to disk and
nowhere else. Populating an S3 origin needs no separate writer, because the
fs and S3 object layouts are byte-identical (the S3 reader keys objects
{prefix}{hex[0..2]}/{hex} to match this on-disk shard) — import to a local
directory and aws s3 sync it up. parse_target turns an s3:// (or
http(s)://) target into an error that spells out that recipe rather than
writing to a directory named after the URL.
The work is synchronous (bao encoding + filesystem writes are sync), wrapped
once in tokio::task::spawn_blocking from the async entry point so the CLI’s
runtime isn’t held up.
Functions§
- origin_
dispatch - Dispatcher for
decdn origin .... Every subcommand is offline, config-free local work, so noconfig_pathis threaded through. - origin_
import - Entry point. Resolves the target and chunk options, dispatches file vs
directory import inside
spawn_blocking, and routes the status report — stdout normally, stderr under--dry-run(where stdout carries the manifest).