diff --git a/CHANGES.rst b/CHANGES.rst index 15c58b9a268e3c2711f407aa6761f1cf5ff2277b..3f19a483c5d40bae405f773c9a1c477b307b0c78 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -85,6 +85,9 @@ Signer Proxy server ------------ +- Changed the proxy server's handling of requests it doesn't know how to serve: + it now forwards the client to the full node at the given `--endpoint`, by + responding with a ``301 Moved Permanently`` redirect. Protocol Compiler And Environment --------------------------------- diff --git a/docs/user/proxy-server.rst b/docs/user/proxy-server.rst index a967925a54d46e0d1650cc78e803b0558cf767cb..fd27f0560a617e1681153beb15dd578c136d9dd9 100644 --- a/docs/user/proxy-server.rst +++ b/docs/user/proxy-server.rst @@ -2,12 +2,20 @@ Proxy server ------------ This page describes the *proxy server*, a readonly frontend to ``tezos-node`` -which is designed to lower the load of nodes. It is named after two things: +which is designed to lower the load of full nodes. It can be run separately from +a node and will handle some RPC requests by itself. It is named after two +things: * The :doc:`proxy mode` of the client on which it builds upon. * Regular HTTP proxies, as proxy servers are meant to be deployed in front of a node, to lower the node's load. +While the proxy server can only serve a subset of the RPCs a full node can serve +(detailed :ref:`below `), one can transparently +use a proxy server as a replacement for a full node, in the manner described +:ref:`below `: it will use HTTP redirects to redirect clients +to the node when it cannot handle a certain request. + Launching a proxy server ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -262,15 +270,16 @@ All arguments are optional as they can either be specified in the configuration file or on the command line. However, the union of the configuration file and the command line should specify the endpoint to use and the RPC address to serve. +.. _what_the_proxy_server_serves: + What the proxy server serves ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The proxy server serves a subset of what a node serves. The proxy server -serves the protocol-specific RPCs, which are listed -`here `_ for protocol Alpha. -The proxy server's purpose is to serve only readonly requests (``GET`` requests, as well -as a subset of the ``POST`` requests), as it's a readonly frontend for the underlying node. -Requests that are not readonly should be sent to the node. +The proxy server itself serves protocol-specific RPCs, which are listed +`here `_ for protocol Alpha, +but not all of them: since the proxy server is a readonly frontend for the +underlying node, it only serves the readonly requests (``GET`` requests, as +well as a subset of the ``POST`` requests). Because computations done by the proxy server are protocol dependent, the proxy server does not support all protocols. However, it is expected than, at any @@ -278,6 +287,31 @@ given time, the proxy server supports ``Alpha`` and the three protocols before that. In doubt, execute ``tezos-client list proxy protocols`` to see the supported protocols. +.. _unsupported_rpcs: + +Unsupported RPCs +~~~~~~~~~~~~~~~~ + +Requests that are not readonly can only be handled by a full node. However, it +is possible to *send* any RPC to the proxy server: if the RPC is not supported +by the proxy server, it will redirect clients to the appropriate endpoint on the +underlying node using an HTTP redirect (``301 Moved Permanently``), and the node +will then handle the request. + +This can be easily demonstrated with a simple test: start a proxy server, and +make a request to it with ``curl -vL /``. +(For example, ``/chains/main/blocks/head/header`` is one such RPC.) The output +from ``curl`` will show that the proxy server asks curl to follow a redirect to +the node's endpoint, which it will do because of the ``-L`` flag, and +then it is finally responded to by the node. Any RPC that can be handled by the +proxy server itself will of course not show this behaviour. + +Clearly, making such requests to the proxy server does not decrease the load of +the node. (To be precise, it in fact also adds a slight delay to the HTTP +request if the redirect is not cached by the client.) However, it does allow the +use of a single endpoint for all RPC requests, which may be more convenient for +certain use-cases. + Deployment ~~~~~~~~~~ @@ -312,7 +346,7 @@ see the :ref:`Support ` section. Support ~~~~~~~ -The proxy server is a project led by `smelc `_. +The proxy server is a project led by `evertedsphere `_. To contact us: * We are on the `Tezos-dev slack `_, or diff --git a/manifest/main.ml b/manifest/main.ml index 1fbe40703da8468561e0225cc568bcdabbb75c73..ca9a4860e930b82fe3508dd69b8f1098429fa18b 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -2181,7 +2181,7 @@ let tezos_rpc_http_server = tezos_rpc |> open_; tezos_rpc_http |> open_; ] - ~modules:["RPC_server"; "RPC_logging"] + ~modules:["RPC_server"; "RPC_logging"; "RPC_middleware"] ~private_modules:["RPC_logging"] let _tezos_rpc_http_server_tests = diff --git a/src/bin_proxy_server/main_proxy_server.ml b/src/bin_proxy_server/main_proxy_server.ml index aaa5ea94b982ea00fae0c183f15881fec41e6fb3..84e6b7129c62b002efb6b20e1c36f306ba1968e0 100644 --- a/src/bin_proxy_server/main_proxy_server.ml +++ b/src/bin_proxy_server/main_proxy_server.ml @@ -222,6 +222,7 @@ let main_promise (config_file : string option) address = rpc_server_address; port = rpc_server_port; tls_cert_and_key = rpc_server_tls; + forwarding_endpoint = endpoint; } in Proxy_server_main_run.run dir server_args diff --git a/src/bin_proxy_server/proxy_server_main_run.ml b/src/bin_proxy_server/proxy_server_main_run.ml index f42ca9365e87e04b983ca3f47c3b542eb8e79a60..723037d7de5c977ff2412482fdb8e60b9ab5a146 100644 --- a/src/bin_proxy_server/proxy_server_main_run.ml +++ b/src/bin_proxy_server/proxy_server_main_run.ml @@ -31,6 +31,7 @@ type args = { address : P2p_addr.t; port : int; tls_cert_and_key : (string * string) option; + forwarding_endpoint : Uri.t; } let () = @@ -52,7 +53,8 @@ let () = | _ -> None) (fun addrlist -> Proxy_server_RPC_Port_already_in_use addrlist) -let launch_rpc_server dir {address; port; tls_cert_and_key} = +let launch_rpc_server dir {address; port; tls_cert_and_key; forwarding_endpoint} + = let open Lwt_result_syntax in let host = Ipaddr.V6.to_string address in let mode = @@ -61,6 +63,9 @@ let launch_rpc_server dir {address; port; tls_cert_and_key} = | Some (cert, key) -> `TLS (`Crt_file_path cert, `Key_file_path key, `No_password, `Port port) in + let middleware = + Tezos_rpc_http_server.RPC_middleware.query_forwarder forwarding_endpoint + in Lwt.catch (fun () -> Lwt_result.ok @@ -68,6 +73,7 @@ let launch_rpc_server dir {address; port; tls_cert_and_key} = ~host mode dir + ~middleware ~media_types:Tezos_rpc_http.Media_type.all_media_types) (function | Unix.Unix_error (Unix.EADDRINUSE, "bind", "") -> diff --git a/src/bin_proxy_server/proxy_server_main_run.mli b/src/bin_proxy_server/proxy_server_main_run.mli index 00308b4b875bc011ee72921279758aa3ffab2792..9271b2e210cf3ceefcb7d958a4a050d32f0f163e 100644 --- a/src/bin_proxy_server/proxy_server_main_run.mli +++ b/src/bin_proxy_server/proxy_server_main_run.mli @@ -29,6 +29,8 @@ type args = { port : int; (** The port of the server *) tls_cert_and_key : (string * string) option; (** The paths to the certificate and the key to use for TLS *) + forwarding_endpoint : Uri.t; + (** The endpoint of the main node to forward unsupported requests to *) } (** [run dir args] launches a server honoring [dir], configured by [args] *) diff --git a/src/lib_rpc_http/RPC_client.ml b/src/lib_rpc_http/RPC_client.ml index d31316bc63bb97dc30dae6ca0782b4690daadc15..c415041479520bc8f36ec2883cebd03d9df786d4 100644 --- a/src/lib_rpc_http/RPC_client.ml +++ b/src/lib_rpc_http/RPC_client.ml @@ -146,6 +146,8 @@ module Make (Client : Resto_cohttp_client.Client.CALL) = struct | ( `Conflict _ | `Error _ | `Forbidden _ | `Unauthorized _ | `Not_found _ | `Gone _ ) as v -> return_ok v + | `Unexpected_status_code (`Moved_permanently, _) -> + request_failed meth uri Redirect_not_supported | `Unexpected_status_code (code, (content, _, media_type)) -> let media_type = Option.map Media_type.name media_type in let* content = Cohttp_lwt.Body.to_string content in diff --git a/src/lib_rpc_http/RPC_client_errors.ml b/src/lib_rpc_http/RPC_client_errors.ml index d6cd9024ae27936e34526893d4c93990e09344c1..08d28b102e8a2f14a37a9cf818cef6e31046bc8d 100644 --- a/src/lib_rpc_http/RPC_client_errors.ml +++ b/src/lib_rpc_http/RPC_client_errors.ml @@ -49,6 +49,7 @@ type rpc_error = | OCaml_exception of string | Unauthorized_host of string option | Unauthorized_uri + | Redirect_not_supported type error += | Request_failed of {meth : RPC_service.meth; uri : Uri.t; error : rpc_error} @@ -164,6 +165,12 @@ let rpc_error_encoding = unit (function Unauthorized_uri -> Some () | _ -> None) (function () -> Unauthorized_uri); + case + (Tag 11) + ~title:"Redirect not supported" + unit + (function Redirect_not_supported -> Some () | _ -> None) + (function () -> Redirect_not_supported); ] let pp_rpc_error ppf err = @@ -242,6 +249,10 @@ let pp_rpc_error ppf err = Format.fprintf ppf "@[The server doesn't authorize this endpoint (ACL filtering).@]" + | Redirect_not_supported -> + Format.fprintf + ppf + "@[The client does not support following HTTP redirects yet.@]" let () = register_error_kind diff --git a/src/lib_rpc_http/RPC_client_errors.mli b/src/lib_rpc_http/RPC_client_errors.mli index 34773b64d17480ae2ca978921b54feb04cd5e07c..7260d85df6aed317603dd9d2b4c013fb2a290001 100644 --- a/src/lib_rpc_http/RPC_client_errors.mli +++ b/src/lib_rpc_http/RPC_client_errors.mli @@ -49,6 +49,9 @@ type rpc_error = | OCaml_exception of string | Unauthorized_host of string option | Unauthorized_uri + | Redirect_not_supported + (** Indicates that the endpoint returned a redirect, which the client does + not yet know how to follow. *) type error += | Request_failed of {meth : RPC_service.meth; uri : Uri.t; error : rpc_error} diff --git a/src/lib_rpc_http/RPC_middleware.ml b/src/lib_rpc_http/RPC_middleware.ml new file mode 100644 index 0000000000000000000000000000000000000000..1a5bf63513609e9db763f373388fd686a4b9d4b0 --- /dev/null +++ b/src/lib_rpc_http/RPC_middleware.ml @@ -0,0 +1,46 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* 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. *) +(* *) +(*****************************************************************************) + +let make_transform_callback forwarding_endpoint callback conn req body = + let open Lwt_syntax in + let* answer = callback conn req body in + let open Cohttp in + let uri = Request.uri req in + let answer_has_not_found_status = function + | `Expert (response, _) | `Response (response, _) -> + Cohttp.Response.status response = `Not_found + in + if answer_has_not_found_status answer then + let overriding = Uri.to_string forwarding_endpoint ^ Uri.path uri in + let headers = Cohttp.Header.of_list [("Location", overriding)] in + let response = + Cohttp.Response.make ~status:`Moved_permanently ~headers () + in + Lwt.return (`Response (response, Cohttp_lwt.Body.empty)) + else Lwt.return answer + +let query_forwarder forwarding_endpoint = + Resto_cohttp_server.Server. + {transform_callback = make_transform_callback forwarding_endpoint} diff --git a/src/lib_rpc_http/RPC_middleware.mli b/src/lib_rpc_http/RPC_middleware.mli new file mode 100644 index 0000000000000000000000000000000000000000..c3b4c4182370a6148963d644a0d0f7fb8a610c07 --- /dev/null +++ b/src/lib_rpc_http/RPC_middleware.mli @@ -0,0 +1,31 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs, *) +(* *) +(* 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. *) +(* *) +(*****************************************************************************) + +(** This module provides a middleware that is used by the proxy server to + forward unsupported RPCs to a full node. *) + +(** A Resto middleware that rewrites any queries that the proxy server cannot + handle and forwards them to the full node at the given [Uri.t]. *) +val query_forwarder : Uri.t -> Resto_cohttp_server.Server.middleware diff --git a/src/lib_rpc_http/dune b/src/lib_rpc_http/dune index 6c9b3f3a24e3ac78489bf88f9f0b75aaf6c2ab6d..b429656f0a6d33e6aa19c30648777dd59ed78b40 100644 --- a/src/lib_rpc_http/dune +++ b/src/lib_rpc_http/dune @@ -61,5 +61,5 @@ -open Tezos_stdlib_unix -open Tezos_rpc -open Tezos_rpc_http) - (modules RPC_server RPC_logging) + (modules RPC_server RPC_logging RPC_middleware) (private_modules RPC_logging)) diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- contracts.out index 6172051e773ef3a20b52dbc70b6f719fba68562a..8153ff7f385048c1412641bee773c41271feb61e 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- contracts.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- contracts.out @@ -48,24 +48,32 @@ null ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' { "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", @@ -84,19 +92,25 @@ Fatal error: "[PUBLIC_KEY_HASH]" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' { "balance": "0", @@ -118,14 +132,18 @@ Fatal error: "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { @@ -325,14 +343,18 @@ null "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- contracts.out index 6172051e773ef3a20b52dbc70b6f719fba68562a..8153ff7f385048c1412641bee773c41271feb61e 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- contracts.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- contracts.out @@ -48,24 +48,32 @@ null ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' { "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", @@ -84,19 +92,25 @@ Fatal error: "[PUBLIC_KEY_HASH]" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' { "balance": "0", @@ -118,14 +132,18 @@ Fatal error: "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { @@ -325,14 +343,18 @@ null "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { diff --git a/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_data_dir) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_data_dir) RPC regression tests- contracts.out index 6172051e773ef3a20b52dbc70b6f719fba68562a..8153ff7f385048c1412641bee773c41271feb61e 100644 --- a/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_data_dir) RPC regression tests- contracts.out +++ b/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_data_dir) RPC regression tests- contracts.out @@ -48,24 +48,32 @@ null ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' { "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", @@ -84,19 +92,25 @@ Fatal error: "[PUBLIC_KEY_HASH]" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' { "balance": "0", @@ -118,14 +132,18 @@ Fatal error: "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { @@ -325,14 +343,18 @@ null "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { diff --git a/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_rpc) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_rpc) RPC regression tests- contracts.out index 6172051e773ef3a20b52dbc70b6f719fba68562a..8153ff7f385048c1412641bee773c41271feb61e 100644 --- a/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_rpc) RPC regression tests- contracts.out +++ b/tezt/tests/expected/RPC_test.ml/Ithaca- (mode proxy_server_rpc) RPC regression tests- contracts.out @@ -48,24 +48,32 @@ null ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' { "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", @@ -84,19 +92,25 @@ Fatal error: "[PUBLIC_KEY_HASH]" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' { "balance": "0", @@ -118,14 +132,18 @@ Fatal error: "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { @@ -325,14 +343,18 @@ null "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { diff --git a/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_data_dir) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_data_dir) RPC regression tests- contracts.out index 6172051e773ef3a20b52dbc70b6f719fba68562a..8153ff7f385048c1412641bee773c41271feb61e 100644 --- a/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_data_dir) RPC regression tests- contracts.out +++ b/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_data_dir) RPC regression tests- contracts.out @@ -48,24 +48,32 @@ null ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' { "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", @@ -84,19 +92,25 @@ Fatal error: "[PUBLIC_KEY_HASH]" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' { "balance": "0", @@ -118,14 +132,18 @@ Fatal error: "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { @@ -325,14 +343,18 @@ null "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { diff --git a/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_rpc) RPC regression tests- contracts.out b/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_rpc) RPC regression tests- contracts.out index 6172051e773ef3a20b52dbc70b6f719fba68562a..8153ff7f385048c1412641bee773c41271feb61e 100644 --- a/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_rpc) RPC regression tests- contracts.out +++ b/tezt/tests/expected/RPC_test.ml/Jakarta- (mode proxy_server_rpc) RPC regression tests- contracts.out @@ -48,24 +48,32 @@ null ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/delegate + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]' { "balance": "99999393", "delegate": "[PUBLIC_KEY_HASH]", @@ -84,19 +92,25 @@ Fatal error: "[PUBLIC_KEY_HASH]" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/entrypoints + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/script + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[PUBLIC_KEY_HASH]/storage + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]' { "balance": "0", @@ -118,14 +132,18 @@ Fatal error: "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { @@ -325,14 +343,18 @@ null "0" ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/counter + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc get '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key' -Fatal error: - No service found at this URL - +Error: + Rpc request failed: + - meth: GET + - uri: http://localhost:[PORT]/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/manager_key + - error: The client does not support following HTTP redirects yet. ./tezos-client rpc post '/chains/main/blocks/head/context/contracts/[CONTRACT_HASH]/big_map_get' with '{ "key": { diff --git a/tezt/tests/proxy_server_test.ml b/tezt/tests/proxy_server_test.ml index 66ff4d973177f49d684001cc9a40fc715eb87f23..014243eb698a129490b7ac8351fdfa16a85e8024 100644 --- a/tezt/tests/proxy_server_test.ml +++ b/tezt/tests/proxy_server_test.ml @@ -223,6 +223,32 @@ let test_wrong_data_dir = re_str else Lwt.return_unit +let test_proxy_server_redirect_unsupported = + Protocol.register_test + ~__FILE__ + ~title:"proxy_server redirect curl" + ~tags:["redirect"] + @@ fun protocol -> + let* node, _client = Client.init_with_protocol `Client ~protocol () in + let* _ps = Proxy_server.init node in + let p = + sf + "http://%s:%d/chains/main/blocks/head/header" + "localhost" + (Proxy_server.rpc_port _ps) + in + let r = Process.spawn "curl" ["-vL"; p] in + let* err = Process.check_and_read_stderr r in + let re_str = "301 Moved Permanently" in + let re_str' = "200 OK" in + let good_match = err =~ rex re_str && err =~ rex re_str' in + if not good_match then + Test.fail + "Unexpected error message: %s. It doesn't match the regexp %S" + err + re_str + else Lwt.return_unit + let register ~protocols = let register mode = let mode_tag = @@ -241,5 +267,6 @@ let register ~protocols = register `Node ; register `Proxy_server_data_dir ; register `Proxy_server_rpc ; + test_proxy_server_redirect_unsupported protocols ; test_equivalence protocols ; test_wrong_data_dir protocols