Refactor: Merge lib_node_shell_base/lib_node_services} -> lib_shell_services

This commit is contained in:
Grégoire Henry 2018-01-22 20:08:44 +01:00
parent 552237673e
commit 58388bd304
48 changed files with 67 additions and 109 deletions

View File

@ -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))))

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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) ->

View File

@ -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

View File

@ -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 ->

View File

@ -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

View File

@ -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 -> [>

View File

@ -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

View File

@ -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"

View File

@ -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} ${^}))))

View File

@ -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

View File

@ -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 ;

View File

@ -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 ->

View File

@ -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

View File

@ -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: [

View File

@ -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 ]
]

View File

@ -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)

View File

@ -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 ]

View File

@ -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)

View File

@ -10,7 +10,6 @@ depends: [
"ocamlfind" { build }
"jbuilder" { build & >= "1.0+beta15" }
"tezos-base"
"tezos-node-services"
"ocplib-resto-directory"
"ocplib-resto-cohttp"
]

View File

@ -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

View File

@ -640,7 +640,6 @@ module Workers = struct
end
let forge_block_header =
RPC_service.post_service
~description: "Forge a block header"

View File

@ -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 ]

View File

@ -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 ()

View File

@ -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

View File

@ -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))))

View File

@ -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: [

View File

@ -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)

View File

@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
open Node_rpc_services
open Shell_services
val echo:
Client_rpcs.config ->

View File

@ -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

View File

@ -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

View File

@ -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: [