Skip to content

Reading and Verifying

Resolve a registry

registryctl read -author <key> -registry demo/files -relay ws://relay-0 -relay ws://relay-1 -watchdog <key> -quorum 2
{
  "author": "<key>", "registry": "demo/files", "version": 3, "conflict": false,
  "manifest": {}, "assets": {"hello.txt": {"cid": "sha256:...", "size": 6, "origin_url": "..."}},
  "intents": {}, "sources": ["<indexer>", "<indexer>"], "fallback": false
}

-quorum is the number of indexers to consult. -watchdog can be repeated. Without any, all indexers have the neutral score.

What the reader verifies

  • The answer is signed by the indexer it asked, for this nonce and query, and not older than two minutes.
  • Every returned event is signed by the author and belongs to the registry.
  • The returned version, conflict flag and revocations follow from the returned events.
  • The registry's leaf is included in the root of the answer.
  • Every asset is listed in the manifest with the same name and content identifier.
  • A revoked registry returns no assets.

An answer that fails is discarded and logged.

Download

registryctl fetch -author <key> -registry demo/files -name hello.txt -out hello.txt -relay ws://relay-0

The bytes are written to a temporary file, checked against digest and Merkle root, and moved into place only if they match. -proxy (DFDAEMON_PROXY) downloads through a distribution peer. Verification is the same, so peers need not be trusted. Assets of a conflicting registry are refused.

registryctl search -q hello -relay ws://relay-0

Search merges up to 200 name matches from each of a quorum of indexers. Use read to verify a result before relying on it.

Network addresses

Connections to private and loopback addresses are refused unless ALLOW_PRIVATE=true, because indexers and origins are chosen by others. ctl.sh sets it to true for the Compose network.