Skip to main content

Module listing

Module listing 

Source
Expand description

Listing another mesh (CONTRACT-http-listing, http 0.6.0): the functions of a mesh this mesh does not host, as descriptions only, with no cells stored.

A run for one listed host is two steps, so that the store side is tested without a network:

  • fetch: read-only HTTP against the host’s origin (L2): the key document (SPEC 9: host, keys, validity), the mesh document (agreeing on host and proto), the host’s own catalogue cells <host>/catalog/subject(...) (each verified against the key document, its keys and source(k) names taken, the cell dropped), and for each name under <host>/, describe and /descriptor/<hash> (the bytes must hash to the function hash), and its label and description from /fn/<name>?format=json (describe carries neither). Never a cell, slice or receipt of a listed function. Within Limits; past one, what is verified so far is kept and the cut recorded.
  • apply: writes the result into the store (L3, L8): the present state only, nothing when nothing changed.

run_host is the two together; the mesh’s listing thread calls it for each host of Config::listed_meshes every Config::listing_interval.

Structs§

Applied
What apply did.
FetchedName
One verified name of a listed host.
Limits
The limits of one run of one host (L2.5).
ListingError
A failure of apply (the store’s), which leaves the store as it was before the failing write.

Enums§

Cut
Which limit cut a run.
Fetch
What one fetch of a host gave.
Outcome
The outcome of a run, as /metrics reports it.

Constants§

DEFAULT_INTERVAL
The default interval between two runs of one host (DATUMESH_LISTING_INTERVAL_SECS, six hours).
MAX_HOSTS
The most hosts DATUMESH_LISTED_MESHES may name.
UNREACHABLE_DROP_AFTER
How long a host may be unreachable before its listings drop out (L8), counted from the first failed run after the last success. At exactly seven days it drops out; at six days 23 hours it does not.

Functions§

apply
Applies a fetch of host at now (an instant) to the store (L3, L8, the re-review’s N1, N3, N4):
fetch
Fetches host at origin (L2), read-only, within limits; now (an instant) is the time the key document’s keys must be valid at.
origin_of
Where host is reached: its origin in Config::peers when it has one, else https://<host>.
run_host
fetch then apply.