package octez-libs

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

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

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

Module Tezos_base.Network_versionSource

Sourcetype t = {
  1. chain_name : Distributed_db_version.Name.t;
  2. distributed_db_version : Distributed_db_version.t;
  3. p2p_version : P2p_version.t;
}
Sourceval pp : Format.formatter -> t -> unit
Sourceval encoding : t Data_encoding.t
Sourceval announced : chain_name:Distributed_db_version.Name.t -> distributed_db_versions:Distributed_db_version.t list -> p2p_versions:P2p_version.t list -> t

Get the network protocol version to announce on peer connection.

Use the highest distributed_db_versions and the highest p2p_versions. The version also contains the chain_name since it is used to prevent peers from different networks to communicate.

Neither distributed_db_versions nor p2p_versions can be empty.

Sourceval select : chain_name:Distributed_db_version.Name.t -> distributed_db_versions:Distributed_db_version.t list -> p2p_versions:P2p_version.t list -> t -> t Tezos_error_monad.Error_monad.tzresult

Try to find a version which is supported both by us and a peer.

Usage: select ~chain_name ~distributed_db_versions ~p2p_versions remote_version

If the chain name of remote_version is not equal to chain_name, there is no compatible version.

distributed_db_versions is the list of distributed database versions supported by the node. If the highest supported version is lesser or equal to the remote version, use this highest supported version. Otherwise, there is no compatible version.

Similarly, p2p_versions is the list of peer-to-peer versions supported by the node. The rules to find a compatible version are the same as the ones for distributed_db_versions.

If there is no compatible version, return a P2p_rejection.Rejecting error.

OCaml

Innovation. Community. Security.