From de050bfee1cfbc8aac0b271042b14d9d064fd57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Mon, 27 Feb 2017 22:25:22 +0100 Subject: [PATCH] Shell: `tezos-node identity` should read the configuration file --- src/node/main/node_identity_command.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/node/main/node_identity_command.ml b/src/node/main/node_identity_command.ml index 4480c81bb..756d458f6 100644 --- a/src/node/main/node_identity_command.ml +++ b/src/node/main/node_identity_command.ml @@ -24,7 +24,7 @@ let generate { Node_config_file.data_dir ; net } = fail (Node_identity_file.Existent_identity_file identity_file) else let target = Crypto_box.make_target net.expected_pow in - Format.eprintf "Generating a new identity... " ; + Format.eprintf "Generating a new identity... (level: %.2f) " net.expected_pow ; let id = P2p.Identity.generate_with_animation Format.err_formatter target in Node_identity_file.write identity_file id >>=? fun () -> @@ -52,7 +52,12 @@ module Term = struct begin match data_dir, config_file with | None, None -> - return Node_config_file.default_config + let default_config = + Node_config_file.default_data_dir // "config.json" in + if Sys.file_exists default_config then + Node_config_file.read default_config + else + return Node_config_file.default_config | None, Some config_file -> Node_config_file.read config_file | Some data_dir, None ->