package octez-libs

  1. Overview
  2. Docs

Wrapper for the Distributed library. The new API is designed for the distribution of protocols based on a 1 master N workers architecture, in which at each step of the protocol:

  • The master asks all the workers to compute the same function over different inputs. We call these messages requests. Each protocol step will define a request (see Message module), whose payload will change for every worker.
  • Each worker computes the reply to the received request, and sends it back to the master. Each protocol step will define a reply (see Message module).
  • The master waits to receive all the replies from the workers.

Instead of directly using the send and receive, the new API provides two abstractions, `dmap` and `handle_request`, to implement this interaction from the master and worker respectively. These abstractions will enforce via the type-system that the request and reply used correspond to the same protocol step.

module Logger : sig ... end
module type Enriched_message_type = sig ... end

Messages are refined into either a request or a reply. Both these types are parameterized by their protocol step. The ground type of messages (t) is enforced to be bytes, to avoid relying on the Marshalling performed by the Distributed library.

module type Enriched_process = sig ... end
module Make (A : Enriched_message_type) : Enriched_process with type message_type = A.t and type M.t = A.t and type 'a M.step = 'a A.step and type 'a M.request = 'a A.request and type 'a M.reply = 'a A.reply and type 'a io = 'a Lwt.t
OCaml

Innovation. Community. Security.