mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Support external hpfs process. (#239)
This commit is contained in:
23
src/conf.cpp
23
src/conf.cpp
@@ -172,7 +172,7 @@ namespace conf
|
||||
const std::string tls_command = "openssl req -newkey rsa:2048 -new -nodes -x509 -days 365 -keyout " +
|
||||
ctx.config_dir + "/tlskey.pem" + " -out " + ctx.config_dir + "/tlscert.pem " +
|
||||
"-subj \"/C=HP/ST=HP/L=HP/O=HP/CN=" + cfg.node.public_key_hex + ".hotpocket.contract\" > /dev/null 2>&1";
|
||||
|
||||
|
||||
// We don't mind if this command fails, because when running the contract we'll check and inform the user that
|
||||
// tls key files are missing, so they can create them manually.
|
||||
system(tls_command.c_str());
|
||||
@@ -422,6 +422,20 @@ namespace conf
|
||||
}
|
||||
}
|
||||
|
||||
// hpfs
|
||||
{
|
||||
try
|
||||
{
|
||||
const jsoncons::ojson &hpfs = d["hpfs"];
|
||||
cfg.hpfs.external = hpfs["external"].as<bool>();
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr << "Required hpfs config field " << extract_missing_field(e.what()) << " missing at " << ctx.config_file << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// log
|
||||
{
|
||||
try
|
||||
@@ -518,6 +532,13 @@ namespace conf
|
||||
d.insert_or_assign("user", user_config);
|
||||
}
|
||||
|
||||
// hpfs configs
|
||||
{
|
||||
jsoncons::ojson hpfs_config;
|
||||
hpfs_config.insert_or_assign("external", cfg.hpfs.external);
|
||||
d.insert_or_assign("hpfs", hpfs_config);
|
||||
}
|
||||
|
||||
// Log configs.
|
||||
{
|
||||
jsoncons::ojson log_config;
|
||||
|
||||
Reference in New Issue
Block a user