package octez-shell-libs

  1. Overview
  2. Docs
Octez shell libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a

doc/octez-shell-libs.shell/Tezos_shell/Distributed_db/Operation/index.html

Module Distributed_db.OperationSource

Index of operations (for the mempool).

Sourceval known : chain_db -> Tezos_base.TzPervasives.Operation_hash.t -> bool Lwt.t

know t k returns true iff the key is present in the memory table or the disk.

Sourcetype Tezos_base.TzPervasives.error +=
  1. | Missing_data of Tezos_base.TzPervasives.Operation_hash.t
Sourcetype Tezos_base.TzPervasives.error +=
  1. | Canceled of Tezos_base.TzPervasives.Operation_hash.t
Sourcetype Tezos_base.TzPervasives.error +=
  1. | Timeout of Tezos_base.TzPervasives.Operation_hash.t
Sourceval read : chain_db -> Tezos_base.TzPervasives.Operation_hash.t -> Tezos_base.Operation.t Tezos_base.TzPervasives.tzresult Lwt.t

Return value if it is found in-memory, or else on disk. Otherwise fail with error Missing_data.

Sourceval read_opt : chain_db -> Tezos_base.TzPervasives.Operation_hash.t -> Tezos_base.Operation.t option Lwt.t

Same as read but returns None if not found.

Sourceval inject : chain_db -> Tezos_base.TzPervasives.Operation_hash.t -> Tezos_base.Operation.t -> bool Lwt.t

inject t k v returns false if k is already present in the memory table or in the disk, or has already been requested. Otherwise it updates the memory table and return true

Sourceval fetch : chain_db -> ?peer:Tezos_base.TzPervasives.P2p_peer.Id.t -> ?timeout:Tezos_base.TzPervasives.Time.System.Span.t -> Tezos_base.TzPervasives.Operation_hash.t -> unit -> Tezos_base.Operation.t Tezos_base.TzPervasives.tzresult Lwt.t

fetch t ?peer ?timeout k param returns the value when it is known. It can fail with Timeout k if timeout is provided and the value isn't know before the timeout expires. It can fail with Cancel if the request is canceled.

The key is first looked up in memory, then on disk. If not present and not already requested, it schedules a request, and blocks until the requester is notified with notify. param is used to validate the notified value once it is received. (see also PROBE and notify).

Requests are re-sent via a 1.5 exponential back-off, with initial delay set to Request.initial_delay. If the function is called multiple time with the same key but with distinct peers, the internal scheduler randomly chooses the requested peer (at each retry).

Sourceval clear_or_cancel : chain_db -> Tezos_base.TzPervasives.Operation_hash.t -> unit

Remove the data from the memory table if present. Otherwise decrements the number of watcher to this data. If their is only one watcher any pending fetch promises are resolved with the error Canceled.

OCaml

Innovation. Community. Security.