Module hdk::chain[][src]

Expand description

Tools to interrogate source chains.

Interacting with a source chain is very different to the DHT.

  • Source chains have a linear history guaranteed by header hashes
  • Source chains have a single owner/author signing every chain element
  • Source chains can be iterated over from most recent back to genesis by following the header hashes as references
  • Source chains contain interspersed system and application entries
  • Source chains contain both private (local only) and public (broadcast to DHT) elements

There is a small DSL provided by query that allows for inspecting the current agent’s local source chain. Typically it will be faster, more direct and efficient to query local data than dial out to the network. It is also possible to query local private entries.

Agent activity for any other agent on the network can be fetched. The agent activity is only the headers of the remote agent’s source chain. Agent activity allows efficient building of the history of an agent. Agent activity is retrieved from a dedicated neighbourhood centered around the agent. The agent’s neighbourhood also maintains a passive security net that guards against attempted chain forks and/or rollbacks. The same query DSL for local chain queries is used to filter remote agent activity headers.

Functions

Query the headers of a remote agent’s chain.

Walks the source chain in reverse (latest to oldest) filtering by header and/or entry type