Validating hpfs and hpws binary paths on startup (#178)

This commit is contained in:
Chalith Desaman
2020-12-01 10:43:00 +05:30
committed by GitHub
parent 12335d09c4
commit 48cde30de6

View File

@@ -563,14 +563,16 @@ namespace conf
*/
int validate_contract_dir_paths()
{
const std::string paths[7] = {
const std::string paths[9] = {
ctx.contract_dir,
ctx.config_file,
ctx.hist_dir,
ctx.full_hist_dir,
ctx.state_dir,
ctx.tls_key_file,
ctx.tls_cert_file};
ctx.tls_cert_file,
ctx.hpfs_exe_path,
ctx.hpws_exe_path};
for (const std::string &path : paths)
{
@@ -582,6 +584,10 @@ namespace conf
<< "openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout tlskey.pem -out tlscert.pem\n"
<< "and add it to " + ctx.config_dir << std::endl;
}
else if (path == ctx.hpfs_exe_path || path == ctx.hpws_exe_path)
{
std::cout << path << " binary does not exist.\n";
}
else
{
std::cout << path << " does not exist.\n";