From 58388bd3048c7a2c0d5d9c2273ecfe678f8fe746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Mon, 22 Jan 2018 20:08:44 +0100 Subject: [PATCH] Refactor: Merge `lib_node_shell_base/lib_node_services}` -> `lib_shell_services` --- src/bin_node/jbuild | 4 ++-- src/bin_node/tezos-node.opam | 6 +++++ src/lib_client_base/client_commands.ml | 2 +- src/lib_client_base/client_commands.mli | 6 ++--- src/lib_client_base/client_config.ml | 6 ++--- src/lib_client_base/client_debug.ml | 6 ++--- src/lib_client_base/client_node_rpcs.ml | 4 ++-- src/lib_client_base/client_node_rpcs.mli | 2 +- src/lib_client_base/client_rpcs.ml | 2 +- src/lib_client_base/client_rpcs.mli | 2 +- src/lib_client_base/jbuild | 5 ++-- src/lib_client_base/tezos-client-base.opam | 2 +- src/lib_node_services/jbuild | 18 --------------- src/lib_node_shell/jbuild | 6 ++--- src/lib_node_shell/node.ml | 4 ++-- src/lib_node_shell/node.mli | 4 ++-- src/lib_node_shell/node_rpc.ml | 20 ++++++++-------- src/lib_node_shell/tezos-node-shell.opam | 4 ++-- .../tezos-node-shell-base.opam | 23 ------------------- src/lib_node_updater/jbuild | 4 ++-- src/lib_node_updater/tezos-node-updater.opam | 2 +- src/lib_rpc_http/jbuild | 4 +--- src/lib_rpc_http/tezos-rpc-http.opam | 1 - .../block_validator_errors.ml | 0 .../block_validator_errors.mli | 0 .../block_validator_worker_state.ml | 0 .../block_validator_worker_state.mli | 0 .../jbuild | 8 ++++--- .../net_validator_worker_state.ml | 0 .../net_validator_worker_state.mli | 0 .../peer_validator_worker_state.ml | 0 .../peer_validator_worker_state.mli | 0 .../prevalidator_worker_state.ml | 0 .../prevalidator_worker_state.mli | 0 .../shell_services.ml} | 1 - .../shell_services.mli} | 0 .../tezos-shell-services.opam} | 2 -- .../worker_types.ml | 0 .../worker_types.mli | 0 .../lib_client_alpha/client_proto_rpcs.ml | 8 +++---- .../lib_client_alpha/client_proto_rpcs.mli | 2 +- src/proto_alpha/lib_client_alpha/jbuild | 4 ++-- .../tezos-embedded-client-alpha.opam | 2 +- .../lib_client_demo/client_proto_rpcs.ml | 2 +- .../lib_client_demo/client_proto_rpcs.mli | 2 +- .../lib_client_genesis/client_proto_main.ml | 2 +- src/proto_genesis/lib_client_genesis/jbuild | 4 ++-- .../tezos-embedded-client-genesis.opam | 2 +- 48 files changed, 67 insertions(+), 109 deletions(-) delete mode 100644 src/lib_node_services/jbuild delete mode 100644 src/lib_node_shell_base/tezos-node-shell-base.opam rename src/{lib_node_shell_base => lib_shell_services}/block_validator_errors.ml (100%) rename src/{lib_node_shell_base => lib_shell_services}/block_validator_errors.mli (100%) rename src/{lib_node_shell_base => lib_shell_services}/block_validator_worker_state.ml (100%) rename src/{lib_node_shell_base => lib_shell_services}/block_validator_worker_state.mli (100%) rename src/{lib_node_shell_base => lib_shell_services}/jbuild (60%) rename src/{lib_node_shell_base => lib_shell_services}/net_validator_worker_state.ml (100%) rename src/{lib_node_shell_base => lib_shell_services}/net_validator_worker_state.mli (100%) rename src/{lib_node_shell_base => lib_shell_services}/peer_validator_worker_state.ml (100%) rename src/{lib_node_shell_base => lib_shell_services}/peer_validator_worker_state.mli (100%) rename src/{lib_node_shell_base => lib_shell_services}/prevalidator_worker_state.ml (100%) rename src/{lib_node_shell_base => lib_shell_services}/prevalidator_worker_state.mli (100%) rename src/{lib_node_services/node_rpc_services.ml => lib_shell_services/shell_services.ml} (99%) rename src/{lib_node_services/node_rpc_services.mli => lib_shell_services/shell_services.mli} (100%) rename src/{lib_node_services/tezos-node-services.opam => lib_shell_services/tezos-shell-services.opam} (92%) rename src/{lib_node_shell_base => lib_shell_services}/worker_types.ml (100%) rename src/{lib_node_shell_base => lib_shell_services}/worker_types.mli (100%) diff --git a/src/bin_node/jbuild b/src/bin_node/jbuild index 302c3922f..84d05edc1 100644 --- a/src/bin_node/jbuild +++ b/src/bin_node/jbuild @@ -7,7 +7,7 @@ tezos-rpc-http tezos-p2p-services tezos-p2p - tezos-node-shell-base + tezos-shell-services tezos-node-shell tezos-node-updater tezos-embedded-protocol-genesis @@ -21,7 +21,7 @@ -open Tezos_rpc_http -open Tezos_p2p_services -open Tezos_p2p - -open Tezos_node_shell_base + -open Tezos_shell_services -open Tezos_node_shell -open Tezos_node_updater -linkall)))) diff --git a/src/bin_node/tezos-node.opam b/src/bin_node/tezos-node.opam index 9799a9509..086c59147 100644 --- a/src/bin_node/tezos-node.opam +++ b/src/bin_node/tezos-node.opam @@ -10,6 +10,12 @@ depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } "tezos-base" + "tezos-rpc-http" + "tezos-p2p-services" + "tezos-p2p" + "tezos-shell-services" + "tezos-node-shell" + "tezos-node-updater" "tezos-embedded-protocol-genesis" "tezos-embedded-protocol-demo" "tezos-embedded-protocol-alpha" diff --git a/src/lib_client_base/client_commands.ml b/src/lib_client_base/client_commands.ml index d31a300f4..305484caa 100644 --- a/src/lib_client_base/client_commands.ml +++ b/src/lib_client_base/client_commands.ml @@ -44,7 +44,7 @@ class type wallet = object end class type block = object - method block : Node_rpc_services.Blocks.block + method block : Shell_services.Blocks.block end class type logging_wallet = object diff --git a/src/lib_client_base/client_commands.mli b/src/lib_client_base/client_commands.mli index 60a290b87..740a8c7ef 100644 --- a/src/lib_client_base/client_commands.mli +++ b/src/lib_client_base/client_commands.mli @@ -28,7 +28,7 @@ class type wallet = object end class type block = object - method block : Node_rpc_services.Blocks.block + method block : Shell_services.Blocks.block end class type logging_wallet = object @@ -56,7 +56,7 @@ end val make_context : ?base_dir:string -> - ?block:Node_rpc_services.Blocks.block -> + ?block:Shell_services.Blocks.block -> ?rpc_config:Client_rpcs.config -> (string -> string -> unit Lwt.t) -> full_context (** [make_context ?config log_fun] builds a context whose logging @@ -81,4 +81,4 @@ val get_versions: unit -> (Protocol_hash.t * (command list)) list val force_switch : (bool, full_context) Cli_entries.arg val default_base_dir : string -val default_block : Node_rpc_services.Blocks.block +val default_block : Shell_services.Blocks.block diff --git a/src/lib_client_base/client_config.ml b/src/lib_client_base/client_config.ml index 75f1cc42b..f5cf391ea 100644 --- a/src/lib_client_base/client_config.ml +++ b/src/lib_client_base/client_config.ml @@ -103,7 +103,7 @@ module Cfg_file = struct end type cli_args = { - block: Node_rpc_services.Blocks.block ; + block: Shell_services.Blocks.block ; protocol: Protocol_hash.t option ; print_timings: bool ; log_requests: bool ; @@ -124,7 +124,7 @@ let string_parameter : (string, Client_commands.full_context) parameter = let block_parameter = parameter - (fun _ block -> match Node_rpc_services.Blocks.parse_block block with + (fun _ block -> match Shell_services.Blocks.parse_block block with | Error _ -> fail (Invalid_block_argument block) | Ok block -> return block) @@ -161,7 +161,7 @@ let block_arg = default_arg ~parameter:"-block" ~doc:"The block on which to apply contextual commands." - ~default:(Node_rpc_services.Blocks.to_string default_cli_args.block) + ~default:(Shell_services.Blocks.to_string default_cli_args.block) block_parameter let protocol_arg = arg diff --git a/src/lib_client_base/client_debug.ml b/src/lib_client_base/client_debug.ml index 4b3da078a..41c5c71b1 100644 --- a/src/lib_client_base/client_debug.ml +++ b/src/lib_client_base/client_debug.ml @@ -10,7 +10,7 @@ (* Commands used to debug the node/alphanet *) let pp_block ppf - { Node_rpc_services.Blocks.hash ; net_id ; level ; + { Shell_services.Blocks.hash ; net_id ; level ; proto_level ; predecessor ; timestamp ; operations_hash ; fitness ; data ; operations ; protocol ; test_network } = @@ -62,7 +62,7 @@ let registered_protocols ppf = (Client_commands.get_versions ()) let print_heads ppf cctxt = - Client_rpcs.call_service0 cctxt Node_rpc_services.Blocks.list + Client_rpcs.call_service0 cctxt Shell_services.Blocks.list { include_ops = true ; length = Some 1 ; heads = None ; @@ -82,7 +82,7 @@ let print_heads ppf cctxt = let print_rejected ppf cctxt = Client_rpcs.call_service0 cctxt - Node_rpc_services.Blocks.list_invalid () >>=? fun invalid -> + Shell_services.Blocks.list_invalid () >>=? fun invalid -> return @@ Format.pp_print_list (fun ppf (hash, level, errors) -> diff --git a/src/lib_client_base/client_node_rpcs.ml b/src/lib_client_base/client_node_rpcs.ml index 39439e239..0cf10f552 100644 --- a/src/lib_client_base/client_node_rpcs.ml +++ b/src/lib_client_base/client_node_rpcs.ml @@ -10,7 +10,7 @@ (* Tezos Command line interface - RPC Calls *) open Client_rpcs -module Services = Node_rpc_services +module Services = Shell_services let errors (rpc : #Client_rpcs.ctxt) = call_service0 rpc RPC_error.service () @@ -44,7 +44,7 @@ let complete cctxt ?block prefix = let describe cctxt ?(recurse = true) path = Client_rpcs.call_service cctxt - Node_rpc_services.describe + Shell_services.describe ((), path) { recurse } () module Blocks = struct diff --git a/src/lib_client_base/client_node_rpcs.mli b/src/lib_client_base/client_node_rpcs.mli index b92ffc880..994c77a3b 100644 --- a/src/lib_client_base/client_node_rpcs.mli +++ b/src/lib_client_base/client_node_rpcs.mli @@ -40,7 +40,7 @@ val inject_protocol: module Blocks : sig - type block = Node_rpc_services.Blocks.block + type block = Shell_services.Blocks.block val net_id: #Client_rpcs.ctxt -> diff --git a/src/lib_client_base/client_rpcs.ml b/src/lib_client_base/client_rpcs.ml index 5dd884775..472ea84f4 100644 --- a/src/lib_client_base/client_rpcs.ml +++ b/src/lib_client_base/client_rpcs.ml @@ -130,7 +130,7 @@ let call_err_service1 ctxt service a1 body = let call_err_service2 ctxt service a1 a2 body = call_err_service ctxt service (((), a1), a2) () body -type block = Node_rpc_services.Blocks.block +type block = Shell_services.Blocks.block let last_baked_block = function | `Prevalidation -> `Head 0 diff --git a/src/lib_client_base/client_rpcs.mli b/src/lib_client_base/client_rpcs.mli index d8484b6b7..b8f251b1c 100644 --- a/src/lib_client_base/client_rpcs.mli +++ b/src/lib_client_base/client_rpcs.mli @@ -106,7 +106,7 @@ val call_err_service2: 'o tzresult, 'e) RPC_service.t -> 'a -> 'b -> 'i -> 'o tzresult Lwt.t -type block = Node_rpc_services.Blocks.block +type block = Shell_services.Blocks.block val last_baked_block: block -> [> diff --git a/src/lib_client_base/jbuild b/src/lib_client_base/jbuild index e1705498c..234d75fa0 100644 --- a/src/lib_client_base/jbuild +++ b/src/lib_client_base/jbuild @@ -7,8 +7,7 @@ tezos-storage tezos-rpc-http tezos-p2p-services - tezos-node-shell-base - tezos-node-services + tezos-shell-services tezos-node-updater tezos-protocol-compiler)) (flags (:standard -w -9+27-30-32-40@8 @@ -17,7 +16,7 @@ -open Tezos_storage -open Tezos_rpc_http -open Tezos_p2p_services - -open Tezos_node_services + -open Tezos_shell_services -open Tezos_node_updater)))) (alias diff --git a/src/lib_client_base/tezos-client-base.opam b/src/lib_client_base/tezos-client-base.opam index aaf13ba9c..2bc8483d5 100644 --- a/src/lib_client_base/tezos-client-base.opam +++ b/src/lib_client_base/tezos-client-base.opam @@ -13,7 +13,7 @@ depends: [ "tezos-storage" "tezos-rpc-http" "tezos-p2p-services" - "tezos-node-services" + "tezos-shell-services" "tezos-node-updater" "tezos-protocol-compiler" "tezos-embedded-protocol-genesis" diff --git a/src/lib_node_services/jbuild b/src/lib_node_services/jbuild deleted file mode 100644 index 5cd78cf2b..000000000 --- a/src/lib_node_services/jbuild +++ /dev/null @@ -1,18 +0,0 @@ -(jbuild_version 1) - -(library - ((name tezos_node_services) - (public_name tezos-node-services) - (libraries (tezos-base - tezos-p2p-services - tezos-node-shell-base)) - (flags (:standard -w -9+27-30-32-40@8 - -safe-string - -open Tezos_base__TzPervasives - -open Tezos_p2p_services - -open Tezos_node_shell_base)))) - -(alias - ((name runtest_indent) - (deps ((glob_files *.ml) (glob_files *.mli))) - (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${^})))) diff --git a/src/lib_node_shell/jbuild b/src/lib_node_shell/jbuild index 337291134..8b1d3dae8 100644 --- a/src/lib_node_shell/jbuild +++ b/src/lib_node_shell/jbuild @@ -8,8 +8,7 @@ tezos-rpc-http tezos-p2p-services tezos-p2p - tezos-node-services - tezos-node-shell-base + tezos-shell-services tezos-node-updater)) (flags (:standard -w -9+27-30-32-40@8 -safe-string @@ -18,8 +17,7 @@ -open Tezos_rpc_http -open Tezos_p2p_services -open Tezos_p2p - -open Tezos_node_services - -open Tezos_node_shell_base + -open Tezos_shell_services -open Tezos_node_updater)))) (alias diff --git a/src/lib_node_shell/node.ml b/src/lib_node_shell/node.ml index 49274819d..7539081f2 100644 --- a/src/lib_node_shell/node.ml +++ b/src/lib_node_shell/node.ml @@ -159,8 +159,8 @@ let shutdown node = node.shutdown () module RPC = struct - type block = Node_rpc_services.Blocks.block - type block_info = Node_rpc_services.Blocks.block_info = { + type block = Shell_services.Blocks.block + type block_info = Shell_services.Blocks.block_info = { hash: Block_hash.t ; net_id: Net_id.t ; level: Int32.t ; diff --git a/src/lib_node_shell/node.mli b/src/lib_node_shell/node.mli index b571d76b8..60e253587 100644 --- a/src/lib_node_shell/node.mli +++ b/src/lib_node_shell/node.mli @@ -49,8 +49,8 @@ val create: module RPC : sig - type block = Node_rpc_services.Blocks.block - type block_info = Node_rpc_services.Blocks.block_info + type block = Shell_services.Blocks.block + type block_info = Shell_services.Blocks.block_info val inject_block: t -> ?force:bool -> ?net_id:Net_id.t -> diff --git a/src/lib_node_shell/node_rpc.ml b/src/lib_node_shell/node_rpc.ml index 8739f1e1c..8a488df10 100644 --- a/src/lib_node_shell/node_rpc.ml +++ b/src/lib_node_shell/node_rpc.ml @@ -9,7 +9,7 @@ open Logging.RPC -module Services = Node_rpc_services +module Services = Shell_services let filter_bi operations (bi: Services.Blocks.block_info) = let bi = if operations then bi else { bi with operations = None } in @@ -102,7 +102,7 @@ let register_bi_dir node dir = RPC_directory.register1 dir Services.Blocks.test_network implementation in let dir = - let implementation b () { Node_rpc_services.Blocks.contents ; monitor } = + let implementation b () { Shell_services.Blocks.contents ; monitor } = match b with | `Prevalidation when monitor -> monitor_operations node contents @@ -411,7 +411,7 @@ let build_rpc_directory node = implementation in let dir = let implementation () - { Node_rpc_services.raw ; blocking ; force ; operations } = + { Shell_services.raw ; blocking ; force ; operations } = begin Node.RPC.inject_block node ~force @@ -455,14 +455,14 @@ let build_rpc_directory node = (* Workers : Prevalidators *) let dir = - RPC_directory.register0 dir Services.Workers.Prevalidators.list + RPC_directory.register0 dir Shell_services.Workers.Prevalidators.list (fun () () -> RPC_answer.return (List.map (fun (id, w) -> (id, Prevalidator.status w)) (Prevalidator.running_workers ()))) in let dir = - RPC_directory.register1 dir Services.Workers.Prevalidators.state + RPC_directory.register1 dir Shell_services.Workers.Prevalidators.state (fun net_id () () -> let w = List.assoc net_id (Prevalidator.running_workers ()) in RPC_answer.return @@ -474,7 +474,7 @@ let build_rpc_directory node = (* Workers : Block_validator *) let dir = - RPC_directory.register0 dir Services.Workers.Block_validator.state + RPC_directory.register0 dir Shell_services.Workers.Block_validator.state (fun () () -> let w = Block_validator.running_worker () in RPC_answer.return @@ -486,7 +486,7 @@ let build_rpc_directory node = (* Workers : Peer validators *) let dir = - RPC_directory.register1 dir Services.Workers.Peer_validators.list + RPC_directory.register1 dir Shell_services.Workers.Peer_validators.list (fun net_id () () -> RPC_answer.return (List.filter_map @@ -496,7 +496,7 @@ let build_rpc_directory node = else None) (Peer_validator.running_workers ()))) in let dir = - RPC_directory.register2 dir Services.Workers.Peer_validators.state + RPC_directory.register2 dir Shell_services.Workers.Peer_validators.state (fun net_id peer_id () () -> let w = List.assoc (net_id, peer_id) (Peer_validator.running_workers ()) in RPC_answer.return @@ -508,14 +508,14 @@ let build_rpc_directory node = (* Workers : Net validators *) let dir = - RPC_directory.register0 dir Services.Workers.Net_validators.list + RPC_directory.register0 dir Shell_services.Workers.Net_validators.list (fun () () -> RPC_answer.return (List.map (fun (id, w) -> (id, Net_validator.status w)) (Net_validator.running_workers ()))) in let dir = - RPC_directory.register1 dir Services.Workers.Net_validators.state + RPC_directory.register1 dir Shell_services.Workers.Net_validators.state (fun net_id () () -> let w = List.assoc net_id (Net_validator.running_workers ()) in RPC_answer.return diff --git a/src/lib_node_shell/tezos-node-shell.opam b/src/lib_node_shell/tezos-node-shell.opam index 0467071d1..288ba0a57 100644 --- a/src/lib_node_shell/tezos-node-shell.opam +++ b/src/lib_node_shell/tezos-node-shell.opam @@ -10,10 +10,10 @@ depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } "tezos-base" - "tezos-storage" - "tezos-node-services" + "tezos-rpc-http" "tezos-p2p-services" "tezos-p2p" + "tezos-shell-services" "tezos-node-updater" ] build: [ diff --git a/src/lib_node_shell_base/tezos-node-shell-base.opam b/src/lib_node_shell_base/tezos-node-shell-base.opam deleted file mode 100644 index c8bfdf9bf..000000000 --- a/src/lib_node_shell_base/tezos-node-shell-base.opam +++ /dev/null @@ -1,23 +0,0 @@ -opam-version: "1.2" -version: "dev" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "https://gitlab.com/tezos/tezos.git" -license: "unreleased" -depends: [ - "ocamlfind" { build } - "jbuilder" { build & >= "1.0+beta15" } - "base-bigarray" - "mtime" - "ocplib-resto-cohttp" - "tezos-base" - "tezos-p2p-services" -] -build: [ - [ "jbuilder" "build" "-p" name "-j" jobs ] -] -build-test: [ - [ "jbuilder" "runtest" "-p" name "-j" jobs ] -] diff --git a/src/lib_node_updater/jbuild b/src/lib_node_updater/jbuild index e433b96d9..1583f740c 100644 --- a/src/lib_node_updater/jbuild +++ b/src/lib_node_updater/jbuild @@ -9,7 +9,7 @@ tezos-storage tezos-rpc-http tezos-p2p-services - tezos-node-services + tezos-shell-services dynlink)) (flags (:standard -w -9+27-30-32-40@8 -safe-string @@ -19,7 +19,7 @@ -open Tezos_storage -open Tezos_rpc_http -open Tezos_p2p_services - -open Tezos_node_services)))) + -open Tezos_shell_services)))) (alias ((name runtest_indent) diff --git a/src/lib_node_updater/tezos-node-updater.opam b/src/lib_node_updater/tezos-node-updater.opam index f1a0215d3..65140d5a2 100644 --- a/src/lib_node_updater/tezos-node-updater.opam +++ b/src/lib_node_updater/tezos-node-updater.opam @@ -15,7 +15,7 @@ depends: [ "tezos-storage" "tezos-rpc-http" "tezos-p2p-services" - "tezos-node-services" + "tezos-shell-services" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/src/lib_rpc_http/jbuild b/src/lib_rpc_http/jbuild index 8b970fba7..db8713afb 100644 --- a/src/lib_rpc_http/jbuild +++ b/src/lib_rpc_http/jbuild @@ -4,14 +4,12 @@ ((name tezos_rpc_http) (public_name tezos-rpc-http) (libraries (tezos-base - tezos-node-services ocplib-resto-directory ocplib-resto-cohttp)) (flags (:standard -w -9+27-30-32-40@8 -safe-string -open Tezos_base__TzPervasives - -open Tezos_rpc - -open Tezos_node_services)))) + -open Tezos_rpc)))) (alias ((name runtest_indent) diff --git a/src/lib_rpc_http/tezos-rpc-http.opam b/src/lib_rpc_http/tezos-rpc-http.opam index ffcde779f..de173f4f6 100644 --- a/src/lib_rpc_http/tezos-rpc-http.opam +++ b/src/lib_rpc_http/tezos-rpc-http.opam @@ -10,7 +10,6 @@ depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } "tezos-base" - "tezos-node-services" "ocplib-resto-directory" "ocplib-resto-cohttp" ] diff --git a/src/lib_node_shell_base/block_validator_errors.ml b/src/lib_shell_services/block_validator_errors.ml similarity index 100% rename from src/lib_node_shell_base/block_validator_errors.ml rename to src/lib_shell_services/block_validator_errors.ml diff --git a/src/lib_node_shell_base/block_validator_errors.mli b/src/lib_shell_services/block_validator_errors.mli similarity index 100% rename from src/lib_node_shell_base/block_validator_errors.mli rename to src/lib_shell_services/block_validator_errors.mli diff --git a/src/lib_node_shell_base/block_validator_worker_state.ml b/src/lib_shell_services/block_validator_worker_state.ml similarity index 100% rename from src/lib_node_shell_base/block_validator_worker_state.ml rename to src/lib_shell_services/block_validator_worker_state.ml diff --git a/src/lib_node_shell_base/block_validator_worker_state.mli b/src/lib_shell_services/block_validator_worker_state.mli similarity index 100% rename from src/lib_node_shell_base/block_validator_worker_state.mli rename to src/lib_shell_services/block_validator_worker_state.mli diff --git a/src/lib_node_shell_base/jbuild b/src/lib_shell_services/jbuild similarity index 60% rename from src/lib_node_shell_base/jbuild rename to src/lib_shell_services/jbuild index abb916874..c7abaa88b 100644 --- a/src/lib_node_shell_base/jbuild +++ b/src/lib_shell_services/jbuild @@ -1,11 +1,13 @@ (jbuild_version 1) (library - ((name tezos_node_shell_base) - (public_name tezos-node-shell-base) + ((name tezos_shell_services) + (public_name tezos-shell-services) (libraries (tezos-base tezos-p2p-services)) - (flags (:standard -open Tezos_base__TzPervasives + (flags (:standard -w -9+27-30-32-40@8 + -safe-string + -open Tezos_base__TzPervasives -open Tezos_p2p_services)))) (alias diff --git a/src/lib_node_shell_base/net_validator_worker_state.ml b/src/lib_shell_services/net_validator_worker_state.ml similarity index 100% rename from src/lib_node_shell_base/net_validator_worker_state.ml rename to src/lib_shell_services/net_validator_worker_state.ml diff --git a/src/lib_node_shell_base/net_validator_worker_state.mli b/src/lib_shell_services/net_validator_worker_state.mli similarity index 100% rename from src/lib_node_shell_base/net_validator_worker_state.mli rename to src/lib_shell_services/net_validator_worker_state.mli diff --git a/src/lib_node_shell_base/peer_validator_worker_state.ml b/src/lib_shell_services/peer_validator_worker_state.ml similarity index 100% rename from src/lib_node_shell_base/peer_validator_worker_state.ml rename to src/lib_shell_services/peer_validator_worker_state.ml diff --git a/src/lib_node_shell_base/peer_validator_worker_state.mli b/src/lib_shell_services/peer_validator_worker_state.mli similarity index 100% rename from src/lib_node_shell_base/peer_validator_worker_state.mli rename to src/lib_shell_services/peer_validator_worker_state.mli diff --git a/src/lib_node_shell_base/prevalidator_worker_state.ml b/src/lib_shell_services/prevalidator_worker_state.ml similarity index 100% rename from src/lib_node_shell_base/prevalidator_worker_state.ml rename to src/lib_shell_services/prevalidator_worker_state.ml diff --git a/src/lib_node_shell_base/prevalidator_worker_state.mli b/src/lib_shell_services/prevalidator_worker_state.mli similarity index 100% rename from src/lib_node_shell_base/prevalidator_worker_state.mli rename to src/lib_shell_services/prevalidator_worker_state.mli diff --git a/src/lib_node_services/node_rpc_services.ml b/src/lib_shell_services/shell_services.ml similarity index 99% rename from src/lib_node_services/node_rpc_services.ml rename to src/lib_shell_services/shell_services.ml index 9189de1e2..100a9346a 100644 --- a/src/lib_node_services/node_rpc_services.ml +++ b/src/lib_shell_services/shell_services.ml @@ -640,7 +640,6 @@ module Workers = struct end - let forge_block_header = RPC_service.post_service ~description: "Forge a block header" diff --git a/src/lib_node_services/node_rpc_services.mli b/src/lib_shell_services/shell_services.mli similarity index 100% rename from src/lib_node_services/node_rpc_services.mli rename to src/lib_shell_services/shell_services.mli diff --git a/src/lib_node_services/tezos-node-services.opam b/src/lib_shell_services/tezos-shell-services.opam similarity index 92% rename from src/lib_node_services/tezos-node-services.opam rename to src/lib_shell_services/tezos-shell-services.opam index 0cf858edc..428d8be2e 100644 --- a/src/lib_node_services/tezos-node-services.opam +++ b/src/lib_shell_services/tezos-shell-services.opam @@ -10,8 +10,6 @@ depends: [ "ocamlfind" { build } "jbuilder" { build & >= "1.0+beta15" } "tezos-base" - "tezos-p2p-services" - "ocplib-resto" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/src/lib_node_shell_base/worker_types.ml b/src/lib_shell_services/worker_types.ml similarity index 100% rename from src/lib_node_shell_base/worker_types.ml rename to src/lib_shell_services/worker_types.ml diff --git a/src/lib_node_shell_base/worker_types.mli b/src/lib_shell_services/worker_types.mli similarity index 100% rename from src/lib_node_shell_base/worker_types.mli rename to src/lib_shell_services/worker_types.mli diff --git a/src/proto_alpha/lib_client_alpha/client_proto_rpcs.ml b/src/proto_alpha/lib_client_alpha/client_proto_rpcs.ml index 648a418ab..ffe7c9231 100644 --- a/src/proto_alpha/lib_client_alpha/client_proto_rpcs.ml +++ b/src/proto_alpha/lib_client_alpha/client_proto_rpcs.ml @@ -18,10 +18,10 @@ let handle_error (cctxt : #Client_commands.logger) = function let call_service0 cctxt s block = Client_rpcs.call_service0 cctxt - (s Node_rpc_services.Blocks.proto_path) block + (s Shell_services.Blocks.proto_path) block let call_service1 cctxt s block a1 = Client_rpcs.call_service1 cctxt - (s Node_rpc_services.Blocks.proto_path) block a1 + (s Shell_services.Blocks.proto_path) block a1 let call_error_service1 cctxt s block a1 = call_service1 cctxt s block a1 >>= function | Ok (Error _ as err) -> Lwt.return (Environment.wrap_error err) @@ -29,14 +29,14 @@ let call_error_service1 cctxt s block a1 = | Error _ as err -> Lwt.return err let call_service2 cctxt s block a1 a2 = Client_rpcs.call_service2 cctxt - (s Node_rpc_services.Blocks.proto_path) block a1 a2 + (s Shell_services.Blocks.proto_path) block a1 a2 let call_error_service2 cctxt s block a1 a2 = call_service2 cctxt s block a1 a2 >>= function | Ok (Error _ as err) -> Lwt.return (Environment.wrap_error err) | Ok (Ok v) -> return v | Error _ as err -> Lwt.return err -type block = Node_rpc_services.Blocks.block +type block = Shell_services.Blocks.block let header cctxt block = call_error_service1 cctxt Services.header block () diff --git a/src/proto_alpha/lib_client_alpha/client_proto_rpcs.mli b/src/proto_alpha/lib_client_alpha/client_proto_rpcs.mli index 7fc5edfa2..bad173545 100644 --- a/src/proto_alpha/lib_client_alpha/client_proto_rpcs.mli +++ b/src/proto_alpha/lib_client_alpha/client_proto_rpcs.mli @@ -10,7 +10,7 @@ val string_of_errors: error list -> string val handle_error: Client_commands.full_context -> 'a tzresult -> 'a Lwt.t -type block = Node_rpc_services.Blocks.block +type block = Shell_services.Blocks.block val header: #Client_rpcs.ctxt -> block -> Block_header.t tzresult Lwt.t diff --git a/src/proto_alpha/lib_client_alpha/jbuild b/src/proto_alpha/lib_client_alpha/jbuild index 29ba8ba36..f756d5002 100644 --- a/src/proto_alpha/lib_client_alpha/jbuild +++ b/src/proto_alpha/lib_client_alpha/jbuild @@ -6,7 +6,7 @@ (libraries (tezos-base tezos-embedded-protocol-alpha tezos-embedded-protocol-alpha.raw - tezos-node-services + tezos-shell-services tezos-client-base)) (library_flags (:standard -linkall)) (flags (:standard -w -9+27-30-32-40@8 @@ -14,7 +14,7 @@ -open Tezos_base__TzPervasives -open Tezos_embedded_protocol_environment_alpha -open Tezos_embedded_raw_protocol_alpha - -open Tezos_node_services + -open Tezos_shell_services -open Tezos_client_base -open Tezos_context)))) diff --git a/src/proto_alpha/lib_client_alpha/tezos-embedded-client-alpha.opam b/src/proto_alpha/lib_client_alpha/tezos-embedded-client-alpha.opam index 5d0008261..3a7af083a 100644 --- a/src/proto_alpha/lib_client_alpha/tezos-embedded-client-alpha.opam +++ b/src/proto_alpha/lib_client_alpha/tezos-embedded-client-alpha.opam @@ -11,7 +11,7 @@ depends: [ "jbuilder" { build & >= "1.0+beta15" } "tezos-base" "tezos-embedded-protocol-alpha" - "tezos-node-services" + "tezos-shell-services" "tezos-client-base" ] build: [ diff --git a/src/proto_demo/lib_client_demo/client_proto_rpcs.ml b/src/proto_demo/lib_client_demo/client_proto_rpcs.ml index c428e9da5..df5a6f58a 100644 --- a/src/proto_demo/lib_client_demo/client_proto_rpcs.ml +++ b/src/proto_demo/lib_client_demo/client_proto_rpcs.ml @@ -9,7 +9,7 @@ let call_service1 cctxt s block a1 = Client_rpcs.call_service1 cctxt - (s Node_rpc_services.Blocks.proto_path) block a1 + (s Shell_services.Blocks.proto_path) block a1 let call_error_service1 cctxt s block a1 = call_service1 cctxt s block a1 >>= function | Ok (Error _ as err) -> Lwt.return (Environment.wrap_error err) diff --git a/src/proto_demo/lib_client_demo/client_proto_rpcs.mli b/src/proto_demo/lib_client_demo/client_proto_rpcs.mli index dd0c9a4a6..20ea87152 100644 --- a/src/proto_demo/lib_client_demo/client_proto_rpcs.mli +++ b/src/proto_demo/lib_client_demo/client_proto_rpcs.mli @@ -7,7 +7,7 @@ (* *) (**************************************************************************) -open Node_rpc_services +open Shell_services val echo: Client_rpcs.config -> diff --git a/src/proto_genesis/lib_client_genesis/client_proto_main.ml b/src/proto_genesis/lib_client_genesis/client_proto_main.ml index 1b891e943..838dd66b3 100644 --- a/src/proto_genesis/lib_client_genesis/client_proto_main.ml +++ b/src/proto_genesis/lib_client_genesis/client_proto_main.ml @@ -15,7 +15,7 @@ let protocol = let call_service1 rpc_config s block a1 = Client_rpcs.call_service1 rpc_config - (s Node_rpc_services.Blocks.proto_path) block a1 + (s Shell_services.Blocks.proto_path) block a1 let call_error_service1 rpc_config s block a1 = call_service1 rpc_config s block a1 >>= function diff --git a/src/proto_genesis/lib_client_genesis/jbuild b/src/proto_genesis/lib_client_genesis/jbuild index 8ba564eac..9d25b1a55 100644 --- a/src/proto_genesis/lib_client_genesis/jbuild +++ b/src/proto_genesis/lib_client_genesis/jbuild @@ -8,7 +8,7 @@ tezos-embedded-protocol-genesis.raw tezos-embedded-protocol-alpha.environment tezos-embedded-protocol-alpha.raw - tezos-node-services + tezos-shell-services tezos-client-base)) (library_flags (:standard -linkall)) (flags (:standard -w -9+27-30-32-40@8 @@ -16,7 +16,7 @@ -open Tezos_base__TzPervasives -open Tezos_embedded_protocol_environment_genesis -open Tezos_embedded_raw_protocol_genesis - -open Tezos_node_services + -open Tezos_shell_services -open Tezos_client_base)))) (alias diff --git a/src/proto_genesis/lib_client_genesis/tezos-embedded-client-genesis.opam b/src/proto_genesis/lib_client_genesis/tezos-embedded-client-genesis.opam index f19a57bae..7e5d18bf0 100644 --- a/src/proto_genesis/lib_client_genesis/tezos-embedded-client-genesis.opam +++ b/src/proto_genesis/lib_client_genesis/tezos-embedded-client-genesis.opam @@ -12,7 +12,7 @@ depends: [ "tezos-base" "tezos-embedded-protocol-genesis" "tezos-embedded-protocol-alpha" - "tezos-node-services" + "tezos-shell-services" "tezos-client-base" ] build: [