Tezos_dal_node_lib.Node_contextA t value contains the needed information for running a DAL node. Its fields are available through accessors.
val init :
Configuration_file.t ->
network_name:Tezos_base.TzPervasives.Distributed_db_version.Name.t ->
Profile_manager.t ->
Tezos_crypto_dal.Cryptobox.t ->
Tezos_crypto_dal.Cryptobox.shards_proofs_precomputation option ->
Proto_plugins.t ->
Store.t ->
Tezos_dal_node_lib_gossipsub.Gossipsub.Worker.t ->
Tezos_dal_node_lib_gossipsub.Gossipsub.Transport_layer.t ->
Tezos_rpc.Context.generic ->
last_finalized_level:int32 ->
?disable_shard_validation:bool ->
ignore_pkhs:Tezos_crypto.Signature.Public_key_hash.Set.t ->
unit ->
tinit creates a t value based on the given arguments.
val get_all_plugins : t -> (module Dal_plugin.T) listReturns all the registered plugins
val get_plugin_and_parameters_for_level :
t ->
level:int32 ->
((module Dal_plugin.T) * Tezos_dal_node_services.Types.proto_parameters)
Tezos_base.TzPervasives.tzresultReturns the plugin to be used for the given (block) level together with the protocol parameters at that level.
Recall that, for a migration level L: * to retrieve the metadata of the block L, one should use the plugin for the old protocol; * to retrieve context-related information, one should use the plugin for the new protocol.
This function returns the plugin of metadata.protocols.next_protocol, so it is tailored for the second use case. To get the plugin for the first use-case, just get the plugin for the predecessor of the target level.
val get_plugin_for_level :
t ->
level:int32 ->
(module Dal_plugin.T) Tezos_base.TzPervasives.tzresultReturns the plugin to be used for the given (block) level. See get_plugin_and_parameters_for_level.
val may_add_plugin :
t ->
Rpc_context.t ->
block_level:int32 ->
proto_level:int ->
unit Tezos_base.TzPervasives.tzresult Lwt.tTries to add a new plugin for the protocol with level proto_level to be used starting with the given block_level.
It returns an error if the node is not ready, if the Chain_services.Blocks.protocols RPC fails, or if the plugin is not registered.
val set_proto_plugins : t -> Proto_plugins.t -> unitSet the protocol plugins to the given value.
val get_proto_parameters :
level:[ `Last_proto | `Level of int32 ] ->
t ->
Tezos_dal_node_services.Types.proto_parameters
Tezos_base.TzPervasives.tzresultget_proto_parameters ~level ctxt returns the DAL node's protocol parameters. When level is `Last_proto, it returns the last known parameters. If level is `Level level, then the protocol parameters for that level are returned. The parameters returned are obtained via get_plugin_and_parameters_for_level.
val may_reconstruct :
reconstruct:
(Tezos_dal_node_services.Types.slot_id ->
(bytes, Errors.other) Stdlib.result Lwt.t) ->
Tezos_dal_node_services.Types.slot_id ->
t ->
(bytes, Errors.other) Stdlib.result Lwt.tReconstruct the given slot id by calling the reconstruct function unless a reconstruction for the given slot id is alredy ongoing in which case the ongoing promise is returned instead.
val get_l1_crawler_status : t -> Tezos_dal_node_services.L1_crawler_status.tReturns the status of the L1 crawler currently stored in the node context.
val get_l1_crawler_status_input :
t ->
Tezos_dal_node_services.L1_crawler_status.t Lwt_watcher.inputget_l1_crawler_status_input ctxt returns the watcher input used to broadcast L1 crawler status updates.
This input can be used with Lwt_watcher.notify to push new L1_crawler_status.t values to all subscribers (e.g., RPC clients monitoring synchronization status). Each call to the monitoring RPC creates a new stream from this watcher, and receives updates pushed through this input.
val set_l1_crawler_status :
t ->
Tezos_dal_node_services.L1_crawler_status.t ->
unitUpdates the status of the L1 crawler with the given value.
val get_profile_ctxt : t -> Profile_manager.tget_profile_ctxt ctxt returns the profile context.
val load_profile_ctxt : t -> Profile_manager.t option Lwt.tload_profile_ctxt ctxt tries to load the profile context from disk.
val set_profile_ctxt : t -> ?save:bool -> Profile_manager.t -> unit Lwt.tset_profile_ctxt ctxt ?save pctxt sets the profile context. If save is set, which is true by default, the profile context is saved on disk.
val get_config : t -> Configuration_file.tget_config ctxt returns the dal node configuration
val get_cryptobox : t -> Tezos_crypto_dal.Cryptobox.tget_cryptobox ctxt returns the DAL node's cryptobox
val set_last_finalized_level : t -> int32 -> unitUpdate the node's last finalized level.
val get_last_finalized_level : t -> int32Get the node's last finalized level. This level may be equal or higher than the node's last processed level.
val is_bootstrap_node : t -> boolReturns true if and only if the node's profile is bootstrap.
val supports_refutations : t -> boolReturns true if and only if the node's profile supports refutation games.
val get_shards_proofs_precomputation :
t ->
Tezos_crypto_dal.Cryptobox.shards_proofs_precomputation optionget_shards_proofs_precomputation ctxt returns the shards proof's precomputation.
val get_gs_worker : t -> Tezos_dal_node_lib_gossipsub.Gossipsub.Worker.tget_gs_worker ctxt returns the Gossipsub worker state.
val get_tezos_node_cctxt : t -> Tezos_rpc.Context.genericget_tezos_node_cctxt ctxt returns the Tezos node's client context.
val get_ongoing_amplifications :
t ->
Tezos_dal_node_services.Types.Slot_id.Set.tget_ongoing_amplification ctxt returns the slot ids for which there are ongoing amplifications.
val set_ongoing_amplifications :
t ->
Tezos_dal_node_services.Types.Slot_id.Set.t ->
unitset_ongoing_amplification ctxt ongoing_amplifications set the slot ids for which there are ongoing amplifications.
val get_ignore_pkhs : t -> Tezos_crypto.Signature.Public_key_hash.Set.tRetrieves the set of pkhs whose messages are not propagated.
val storage_period :
t ->
Tezos_dal_node_services.Types.proto_parameters ->
[ `Always | `Finite of int ]storage_period ctxt proto_parameters returns for how many levels should the node store data about attested slots. This depends on the node's profile and its history mode.
val level_to_gc :
t ->
Tezos_dal_node_services.Types.proto_parameters ->
current_level:int32 ->
int32 optionlevel_to_gc ctxt proto_parameters ~current_level returns the oldest level that should have attested data (like shards and slots, skip list cells) stored; during current_level, such data for commitments published at the returned level will be removed. The returned level is non-negative. In case no removal is needed (either because the node is thus configured, or the current_level is not big enough), the function returns None.
val fetch_assigned_shard_indices :
t ->
level:int32 ->
pkh:Tezos_crypto.Signature.Public_key_hash.t ->
int list Tezos_base.TzPervasives.tzresult Lwt.tfetch_assigned_shard_indices ctxt ~level ~pkh fetches from L1 the shard indices assigned to pkh at level. It internally caches the DAL committee with level as the key with FIFO strategy.
val get_fetched_assigned_shard_indices :
t ->
level:int32 ->
pkh:Tezos_crypto.Signature.public_key_hash ->
Committee_cache.shard_indexes optionget_fetched_assigned_shard_indices is a pure variant of fetch_assigned_shard_indices that doesn't fetch the committee from L1 if not found locally. The function returns None if no committee is found locally for the given level, or Some shard_indexes otherwise, where the list of shards is empty if the given pkh is not in the committee for the givel level.
val fetch_committees :
t ->
level:int32 ->
Committee_cache.committee Tezos_base.TzPervasives.tzresult Lwt.tfetch_committees ctxt ~level fetches from L1 the shard indices assigned to all attesters at level. It internally caches the DAL committee with level as the key with FIFO strategy.
val version : t -> Tezos_dal_node_services.Types.Version.tversion ctxt returns the current version of the node
val warn_if_attesters_not_delegates :
t ->
Tezos_dal_node_services.Controller_profiles.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tEmit a warning for each public key hash in the given controller profiles (if any) that is not that of a L1-registered delegate.
val get_disable_shard_validation : t -> boolget_disable_shard_validation ctxt returns whether we should disable shard validation in the DAL node.
val get_last_migration_level : t -> int32get_last_migration_level ctxt returns the first block with a new proto_level, which is the last block of the old protocol. See Proto_plugins.get_plugin_and_parameters_for_level for more clarifications.
val get_attestable_slots_watcher_table :
t ->
Tezos_dal_node_services.Types.Attestable_slots_watcher_table.tget_attestable_slots_watcher_table ctxt return the table of streams containing attestable slots per pkh.
val get_attestation_lag :
t ->
level:int32 ->
int32 Tezos_base.TzPervasives.tzresultget_attestation_lag ctxt ~level returns the attestation lag found at ~level using protocol parameters obtained using ctxt.
module P2P : sig ... endModule for P2P-related accessors.