diff --git a/manifest/main.ml b/manifest/main.ml index 2a1bbdc99529ad3528943ad53ade27a377db27c6..deae163b8638dc36d7a264f7db1ad25e84e96595 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -5479,6 +5479,7 @@ module Protocol = Protocol octez_protocol_compiler_registerer |> open_; octez_stdlib_unix |> open_; octez_dac_lib |> open_; + octez_dac_client_lib |> open_; client |> if_some |> open_; embedded |> open_; main |> open_; diff --git a/opam/tezos-dac-alpha.opam b/opam/tezos-dac-alpha.opam index c620542e0a5c05922539b0f43d43946199b55c26..4d08e27b05194c9d28d62c146aebc24da72add70 100644 --- a/opam/tezos-dac-alpha.opam +++ b/opam/tezos-dac-alpha.opam @@ -15,6 +15,7 @@ depends: [ "octez-protocol-compiler" "tezos-stdlib-unix" "tezos-dac-lib" + "tezos-dac-client-lib" "tezos-client-alpha" "tezos-embedded-protocol-alpha" "tezos-protocol-alpha" diff --git a/src/proto_alpha/lib_dac_plugin/dac_observer_client.ml b/src/proto_alpha/lib_dac_plugin/dac_observer_client.ml new file mode 100644 index 0000000000000000000000000000000000000000..c18e870a0bd49555a37d5953afaa14c0c780507e --- /dev/null +++ b/src/proto_alpha/lib_dac_plugin/dac_observer_client.ml @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 TriliTech, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +module Reveal_hash = Protocol.Sc_rollup_reveal_hash +module Dac_client = Dac_node_client + +module Configuration = struct + type t = { + observer_endpoint : Uri.t; + reveal_data_dir : string; + timeout_seconds : Z.t option; + } +end + +type t = unit + +let init _config = + let open Lwt_result_syntax in + return_unit + +let fetch_preimage _dac_client _hash = assert false diff --git a/src/proto_alpha/lib_dac_plugin/dac_observer_client.mli b/src/proto_alpha/lib_dac_plugin/dac_observer_client.mli new file mode 100644 index 0000000000000000000000000000000000000000..643d663b13ee524673b008095261690d02ca3ae7 --- /dev/null +++ b/src/proto_alpha/lib_dac_plugin/dac_observer_client.mli @@ -0,0 +1,45 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 TriliTech, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Client module for interacting with a Dac Node in Observer mode. This client + should only used by components that are compiled with a protocol. *) +type t + +module Configuration : sig + type t = { + observer_endpoint : Uri.t; + reveal_data_dir : string; + timeout_seconds : Z.t option; + } +end + +(** [init configuration] initializes a [Dac_observer_client.t] from [configuration]. *) +val init : Configuration.t -> t tzresult Lwt.t + +(** [fetch_preimage dac_observer_client hash] requests the preimage of [hash] + from a Dac Observer Node. +*) +val fetch_preimage : + t -> Protocol.Sc_rollup_reveal_hash.t -> string tzresult Lwt.t diff --git a/src/proto_alpha/lib_dac_plugin/dune b/src/proto_alpha/lib_dac_plugin/dune index dee875addab82210b75fca5f2baeb450eefd5954..ce6fc8440ebbf6b16aa14ec3b2ba8c0551e73093 100644 --- a/src/proto_alpha/lib_dac_plugin/dune +++ b/src/proto_alpha/lib_dac_plugin/dune @@ -10,6 +10,7 @@ octez-protocol-compiler.registerer tezos-stdlib-unix tezos-dac-lib + tezos-dac-client-lib tezos-client-alpha tezos-embedded-protocol-alpha tezos-protocol-alpha) @@ -23,6 +24,7 @@ -open Tezos_protocol_registerer -open Tezos_stdlib_unix -open Tezos_dac_lib + -open Tezos_dac_client_lib -open Tezos_client_alpha -open Tezos_embedded_protocol_alpha -open Tezos_protocol_alpha))