Expand description
Core check engine for bee-check.
The CLI in main.rs and (in future) the bee-check-web SPA both
consume the same Report shape produced here. See SPEC.md for
the JSON shape.
Structs§
- Chunk
Probe - Chunk
Stat Row - Chunk
Stats - Aggregate statistics over the per-chunk probe data. Per-vantage stats surface “fast on bee-A, slow on bee-B”; per-neighborhood stats surface “chunks in nb 0x1a are slow no matter which vantage”.
- Chunk
Vantage - Cold
Download Result - Cold end-to-end download probe. Pulls the full byte stream from
/bytes/{ref}(for Bee vantages) or/bzz/{ref}/(for gateways) and times the entire transfer. Distinct from the stewardship probe, which only walks the chunk graph — cold-download exercises the HTTP body transport too. Added in 0.5. - Gateway
Result - HEAD-probe of a public Swarm gateway. The gateway resolves the reference end-to-end through forwarding Kademlia; a 2xx means “anyone could retrieve this through this gateway right now”, independent of any specific Bee node the user controls.
- Report
- Reseed
Request - Stamp
Status - Result of the
--reseed --stamp <id>pre-flight check. Mirrors ipfs-check’s “stale records” hint in spirit: surface upstream-data problems before doing the operation. - Vantage
Result
Enums§
- Output
Format - Parsed
Input - Output of
parse_input. - Resolution
- Records the input → reference resolution when the user supplied a mutable handle (currently: Swarm feeds). Added in 0.3.
- Status
- Outcome enum reported per vantage and aggregated for the whole check.
Constants§
- DEFAULT_
GATEWAY - Default public gateway used when no
--gatewayflag is supplied.api.gateway.ethswarm.orgis the Foundation-operated forwarding gateway that returns proper 404s for unknown references (unlikegateway.ethswarm.org, which currently fronts a static page that 200s everything).
Functions§
- annotate_
target_ overlay - Annotate each vantage with
target_proximity(PO between its overlay andtarget_overlay_hex) and sort the vantages array by that proximity in descending order — closest first. No-op whentarget_overlay_hexdoesn’t decode. Added in 0.4. - check_
gateways - Probe public Swarm gateways via
HEAD {gateway}/bzz/{ref}in parallel. Mirrors the BYO-Bee philosophy: gateway results complement (don’t replace) the vantage probes and aggregate into the same top-levelstatus. - check_
multi_ vantage - Probe
/stewardship/{ref}across all vantages in parallel. Alongside the retrievability call, fetches/addresses(overlay) and/health(Bee version) so the rendered report can surface which neighborhood the probe came from. These ancillary calls are best-effort: failure leavesoverlay/bee_versionunset rather than failing the whole vantage. - check_
stamp - Pre-flight check before
--reseed: look upGET /stamps/{id}on the target Bee and surface usable/expiry concerns. Mirrors the spirit of ipfs-check’s “stale records” UX hint — flag freshness problems before doing the operation. - cold_
download_ all - Cold end-to-end download probe. For each Bee vantage, issues
GET /bytes/{ref}and streams the body to EOF, counting bytes and timing the full transfer. For each gateway, issuesGET /bzz/{ref}/instead (the canonical gateway path). Recordsbytes_downloaded+elapsed_msper URL. Distinct from the stewardship probe: this exercises HTTP body transport, not just chunk-graph walking. - compute_
chunk_ stats - Roll up per-vantage + per-neighborhood timing statistics from a
flat list of
ChunkProbes. Pure function; runs in milliseconds even for the 1000-chunk cap. - drill_
down - Walk the manifest at
report.reference, probe each leaf chunk viaGET /chunks/{addr}from every vantage, and attach the result to the report. When the per-vantage overlay is known (already fetched incheck_multi_vantage), eachChunkVantagealso carries the proximity between that vantage and the chunk. - merge_
gateways - Append gateway results to an existing report and re-aggregate the top-level status. Splits the gateway probe from the main check so the SPA can show partial progress.
- parse_
input - Parse a positional input. Accepts either:
- render_
report - render_
stamp_ status - Human-readable summary of a stamp pre-flight check, suitable for
stderr before a
--reseedoperation. - reseed
- resolve_
feed - Resolve a
feed:OWNER:TOPICinput to its current chunk reference.bee_urlis the first Bee vantage; the feed lookup goes through it. Returns the resolved reference and aResolutionrecord describing what was done.