package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

dune-project
 Dependency

Authors

Maintainers

Sources

tezos-18.0.tar.gz
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a

doc/octez-libs.base/Tezos_base/P2p_identity/index.html

Module Tezos_base.P2p_identitySource

Type of an identity, comprising a peer_id, a cryptographic key pair, and a proof of work stamp with enough difficulty so that the network accept this identity as genuine.

Sourceval encoding : t Data_encoding.t
Sourceval generate : ?yield_every:int -> Tezos_crypto.Crypto_box.pow_target -> t Lwt.t

generate pow_target is a freshly minted identity whose proof of work stamp difficulty is at least equal to pow_target.

The argument yield_every (defaults to 500) introduces a call to Lwt.pause every that many operations.

Sourceval generate_with_bound : ?yield_every:int -> ?max:int -> Tezos_crypto.Crypto_box.pow_target -> t Lwt.t

generate_with_bound pow_target is a freshly minted identity whose proof of work stamp difficulty is at least equal to pow_target.

The optional argument max sets a maximum number of attempts. If that many attempts are made without finding a successful pow, the function fails with Not_found.

Sourceval generate_with_pow_target_0 : unit -> t

generate_with_pow_target_0 pk generates a proof of work for the public key pk following a (hard-coded) 0 proof-of-work target.

NOTICE: This function is meant for generating dummy identities. It is useful for tests and other such controlled environment but it is not suitable for generating identities for an open network.