package octez-shell-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-shell-libs.shell/Tezos_shell/Distributed_db/Operations/index.html
Module Distributed_db.Operations
Source
Index of all the operations of a given block (per validation pass).
For instance, fetch chain_db (block_hash, validation_pass) operation_list_list_hash
queries the operation requester to get all the operations for block block_hash
and validation pass validation_pass
. It returns a list of operation, guaranteed to be valid with respect to operation_list_list_hash
(root of merkle tree for this block).
The index key
The indexed data
know t k
returns true iff the key is present in the memory table or the disk.
Return value if it is found in-memory, or else on disk. Otherwise fail with error Missing_data
.
Same as read
but returns None
if not found.
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
val fetch :
chain_db ->
?peer:Tezos_base.TzPervasives.P2p_peer.Id.t ->
?timeout:Tezos_base.TzPervasives.Time.System.Span.t ->
key ->
Tezos_base.TzPervasives.Operation_list_list_hash.t ->
value 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).