Module Dal_common.RPC

type default_uri_provider = (Dal_node.t, Endpoint.t) Either.t
type local_uri_provider = Dal_node.t
type remote_uri_provider = Endpoint.t
type commitment = string
type controller_profile =
  1. | Attester of string
  2. | Operator of int
  3. | Observer of int

Profiles that operate on shards/slots.

type controller_profiles = controller_profile list

List of controller profiles.

type profile =
  1. | Bootstrap
  2. | Controller of controller_profiles
type slot_id_status =
  1. | Waiting_attestation
  2. | Attested of int
  3. | Unattested
  4. | Unpublished
  5. | Not_found
type slot_header = {
  1. slot_level : int;
  2. slot_index : int;
  3. commitment : string;
  4. status : string;
}

Information contained in a slot header fetched from the DAL node.

val slot_header_of_json : Tezt_wrapper.JSON.t -> slot_header

slot_header_of_json json decodes json as a slot header. The function fails if the given json cannot be decoded.

val slot_headers_of_json : Tezt_wrapper.JSON.t -> slot_header list

slot_header_of_json json_ similar to slot_header_of_json, but the input (and output) is expected to be a list.

type commitment_proof = string
val post_slot : ?slot_index:int -> Helpers.slot -> (commitment * commitment_proof) RPC_core.t

Call RPC "POST /slots" to store a slot and return the commitment and its proof in case of success.

val get_level_slot_content : slot_level:int -> slot_index:int -> Helpers.slot RPC_core.t

Call RPC "GET /levels/<slot_level>/slot/<slot_index>/content" to retrieve the slot content associated with the given level and index.

val get_level_slot_pages : published_level:int -> slot_index:int -> string list RPC_core.t

get_level_slot_pages ~published_level ~slot_index gets the pages of the slot published at level published_level on slot index slot_index.

val get_level_slot_commitment : slot_level:int -> slot_index:int -> commitment RPC_core.t

Call RPC "GET /levels/<published_level>/slot_indices/<slot_index>/commitment" to get the commitment associated to the given level and index.

val patch_profiles : controller_profiles -> unit RPC_core.t

Call RPC "PATCH /profiles" to update the list of profiles tracked by the DAL node.

val get_profiles : unit -> profile RPC_core.t

Call RPC "GET /profiles" to retrieve the list of profiles tracked by the DAL node.

val get_level_slot_status : slot_level:int -> slot_index:int -> slot_id_status RPC_core.t

Call RPC "GET /levels/<slot_level>/slots/<slot_index>/status" to get the status known about the given slot.

val pp_slot_id_status : Stdlib.Format.formatter -> slot_id_status -> unit
val get_assigned_shard_indices : level:int -> pkh:string -> int list RPC_core.t

Call RPC "GET /profiles/<public_key_hash>/attested_levels/<level>/assigned_shard_indices" to get shard ids assigned to the given public key hash at the given level.

type trap = {
  1. delegate : string;
  2. slot_index : int;
}
val get_published_level_known_traps : published_level:int -> pkh:commitment_proof -> slot_index:int -> trap list RPC_core.t

Call RPC "GET /published_levels/<published_level>/known_traps?delegate=<pkh>&slot_index=<slot_index>" and returns the list of traps recorded by the DAL node at ~published_level.

type slot_set = bool list
type attestable_slots =
  1. | Not_in_committee
  2. | Attestable_slots of slot_set
val get_attestable_slots : attester:Account.key -> attested_level:int -> attestable_slots RPC_core.t

Call RPC "GET /profiles/<public_key_hash>/attested_levels/<level>/attestable_slots" to get the slots currently attestable by the given public key hash at the given attested level. The result is either a Not_in_committee or a Attestable_slots flags, where flags is a boolean list of length num_slots. A slot is attestable if it is published at level level - attestation_lag) and all the shards assigned to the given attester at level level are available in the DAL node's store. Please note that with the introduction of attestation_lags list the result is only for the published level corresponding to the maximum lag, so there is not an equivalence between this RPC and the DAL attestation from the chain.

val delete_p2p_peer_disconnect : peer_id:string -> unit RPC_core.t

Call RPC "DELETE /p2p/peers/disconnect" to disconnect the node whose identity is given.

val patch_p2p_peers_by_id : peer_id:string -> ?acl:string -> unit -> unit RPC_core.t

Call RPC "PATCH /p2p/peers/by-id/<peer_id>" to patch the ACL of the node whose identity is given. Ignores the output of the RPC.

type topic = {
  1. topic_slot_index : int;
  2. topic_pkh : string;
}
val get_topics : unit -> topic list RPC_core.t

Call RPC "GET /p2p/gossipsub/topics" to list the topics

val get_topics_peers : ?all:bool -> unit -> (topic * string list) list RPC_core.t

Call RPC "GET /p2p/gossipsub/topics/peers" to list the peers on each subscribed topic. If all is true (the default is false) then list the peers on each known topic (not only the subscribed ones).

val get_slot_indexes_peers : ?all:bool -> unit -> (int * string list) list RPC_core.t

Call RPC "GET /p2p/gossipsub/slot_indexes/peers" to list the peers on each slot index part of a subscribed topic. If all is true (the default is false) then list the peers on each known topic (not only the subscribed ones).

val get_pkhs_peers : ?all:bool -> unit -> (string * string list) list RPC_core.t

Call RPC "GET /p2p/gossipsub/pkhs/peers" to list the peers on each pkh part of a (all) topic. If all is true (the default is false) then list the peers on each known topic (not only the subscribed ones).

val get_gossipsub_connections : unit -> Tezt_wrapper.JSON.t RPC_core.t
type peer_score = {
  1. peer : string;
  2. score : float;
}
val get_scores : unit -> peer_score list RPC_core.t

Call RPC "GET /p2p/gossipsub/scores" to list the scores of peers with a known score.

val get_plugin_commitments_history_hash : proto_hash:string -> hash:string -> unit -> Tezt_wrapper.JSON.t RPC_core.t

Call RPC /plugin/proto_hash/<commitments_history/hash/hash.

val get_level_slot_shard_content : slot_level:int -> slot_index:int -> shard_index:int -> string RPC_core.t

Call /levels/<slot_level>/slots/<slot_index>/shards/<shard_index>/content

val unistring_to_json : string -> Tezt_wrapper.JSON.u

unistring_to_json s converts a possibly invalid UTF-8 string into a JSON object using Data-encoding's unistring representation.