Merge branch 'dev' into stratum
This commit is contained in:
@@ -169,7 +169,7 @@ bool AppInit(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
fprintf(stderr, "%s reading config file\n", __FUNCTION__);
|
fprintf(stderr, "%s reading config file\n", __FUNCTION__);
|
||||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||||
} catch (const missing_zcash_conf& e) {
|
} catch (const missing_hush_conf& e) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
(_("Before starting hushd, you need to create a configuration file:\n"
|
(_("Before starting hushd, you need to create a configuration file:\n"
|
||||||
"%s\n"
|
"%s\n"
|
||||||
|
|||||||
@@ -1792,7 +1792,10 @@ void hush_args(char *argv0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
name = GetArg("-ac_name","HUSH3");
|
name = GetArg("-ac_name","HUSH3");
|
||||||
|
fprintf(stderr,".oO Starting %s Full Node (Extreme Privacy!) with genproc=%d notary=%d\n",name.c_str(),HUSH_MININGTHREADS, IS_HUSH_NOTARY);
|
||||||
|
|
||||||
if ( argv0 != 0 )
|
if ( argv0 != 0 )
|
||||||
{
|
{
|
||||||
len = (int32_t)strlen(argv0);
|
len = (int32_t)strlen(argv0);
|
||||||
@@ -1807,10 +1810,18 @@ void hush_args(char *argv0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> HUSH_nodes= {"node1.hush.is","node2.hush.is","node3.hush.is",
|
vector<string> HUSH_nodes= {"node1.hush.is","node2.hush.is","node3.hush.is",
|
||||||
"node4.hush.is","node5.hush.is","node6.hush.is",
|
"node4.hush.is","node5.hush.is","node6.hush.is",
|
||||||
"node7.hush.is","node8.hush.is"};
|
"node7.hush.is","node8.hush.is"};
|
||||||
mapMultiArgs["-addnode"] = HUSH_nodes;
|
vector<string> more_nodes = mapMultiArgs["-addnode"];
|
||||||
|
if (more_nodes.size() > 0) {
|
||||||
|
fprintf(stderr,"%s: Adding %lu more nodes via custom -addnode arguments\n", __func__, more_nodes.size() );
|
||||||
|
}
|
||||||
|
// Add default HUSH nodes after custom addnodes
|
||||||
|
more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() );
|
||||||
|
|
||||||
|
mapMultiArgs["-addnode"] = more_nodes;
|
||||||
HUSH_STOPAT = GetArg("-stopat",0);
|
HUSH_STOPAT = GetArg("-stopat",0);
|
||||||
MAX_REORG_LENGTH = GetArg("-maxreorg",MAX_REORG_LENGTH);
|
MAX_REORG_LENGTH = GetArg("-maxreorg",MAX_REORG_LENGTH);
|
||||||
WITNESS_CACHE_SIZE = MAX_REORG_LENGTH+10;
|
WITNESS_CACHE_SIZE = MAX_REORG_LENGTH+10;
|
||||||
@@ -1823,7 +1834,6 @@ void hush_args(char *argv0)
|
|||||||
HUSH_SNAPSHOT_INTERVAL = GetArg("-ac_snapshot",0);
|
HUSH_SNAPSHOT_INTERVAL = GetArg("-ac_snapshot",0);
|
||||||
Split(GetArg("-ac_nk",""), sizeof(ASSETCHAINS_NK)/sizeof(*ASSETCHAINS_NK), ASSETCHAINS_NK, 0);
|
Split(GetArg("-ac_nk",""), sizeof(ASSETCHAINS_NK)/sizeof(*ASSETCHAINS_NK), ASSETCHAINS_NK, 0);
|
||||||
|
|
||||||
fprintf(stderr,".oO Starting HUSH Full Node (Extreme Privacy!) with genproc=%d notary=%d\n",HUSH_MININGTHREADS, IS_HUSH_NOTARY);
|
|
||||||
|
|
||||||
// -ac_ccactivateht=evalcode,height,evalcode,height,evalcode,height....
|
// -ac_ccactivateht=evalcode,height,evalcode,height,evalcode,height....
|
||||||
Split(GetArg("-ac_ccactivateht",""), sizeof(ccEnablesHeight)/sizeof(*ccEnablesHeight), ccEnablesHeight, 0);
|
Split(GetArg("-ac_ccactivateht",""), sizeof(ccEnablesHeight)/sizeof(*ccEnablesHeight), ccEnablesHeight, 0);
|
||||||
|
|||||||
@@ -16,15 +16,14 @@ def def_credentials(chain):
|
|||||||
rpcport = '';
|
rpcport = '';
|
||||||
operating_system = platform.system()
|
operating_system = platform.system()
|
||||||
if operating_system == 'Darwin':
|
if operating_system == 'Darwin':
|
||||||
ac_dir = os.environ['HOME'] + '/Library/Application Support/Komodo'
|
ac_dir = os.environ['HOME'] + '/Library/Application Support/Hush'
|
||||||
elif operating_system == 'Linux':
|
elif operating_system == 'Linux':
|
||||||
ac_dir = os.environ['HOME'] + '/.komodo'
|
ac_dir = os.environ['HOME'] + '/.hush'
|
||||||
elif operating_system == 'Windows':
|
elif operating_system == 'Windows':
|
||||||
ac_dir = '%s/komodo/' % os.environ['APPDATA']
|
ac_dir = '%s/hush/' % os.environ['APPDATA']
|
||||||
if chain == 'KMD':
|
|
||||||
coin_config_file = str(ac_dir + '/komodo.conf')
|
coin_config_file = str(ac_dir + '/' + chain + '/' + chain + '.conf')
|
||||||
else:
|
|
||||||
coin_config_file = str(ac_dir + '/' + chain + '/' + chain + '.conf')
|
|
||||||
with open(coin_config_file, 'r') as f:
|
with open(coin_config_file, 'r') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
l = line.rstrip()
|
l = line.rstrip()
|
||||||
@@ -35,8 +34,8 @@ def def_credentials(chain):
|
|||||||
elif re.search('rpcport', l):
|
elif re.search('rpcport', l):
|
||||||
rpcport = l.replace('rpcport=', '')
|
rpcport = l.replace('rpcport=', '')
|
||||||
if len(rpcport) == 0:
|
if len(rpcport) == 0:
|
||||||
if chain == 'KMD':
|
if chain == 'HUSH3':
|
||||||
rpcport = 7771
|
rpcport = 18031
|
||||||
else:
|
else:
|
||||||
print("rpcport not in conf file, exiting")
|
print("rpcport not in conf file, exiting")
|
||||||
print("check " + coin_config_file)
|
print("check " + coin_config_file)
|
||||||
|
|||||||
@@ -722,14 +722,14 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
|
|||||||
{
|
{
|
||||||
boost::filesystem::ifstream streamConfig(GetConfigFile());
|
boost::filesystem::ifstream streamConfig(GetConfigFile());
|
||||||
if (!streamConfig.good())
|
if (!streamConfig.good())
|
||||||
throw missing_zcash_conf();
|
throw missing_hush_conf();
|
||||||
|
|
||||||
set<string> setOptions;
|
set<string> setOptions;
|
||||||
setOptions.insert("*");
|
setOptions.insert("*");
|
||||||
|
|
||||||
for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)
|
for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)
|
||||||
{
|
{
|
||||||
// Don't overwrite existing settings so command line settings override komodo.conf
|
// Don't overwrite existing settings so command line settings override HUSH3.conf
|
||||||
string strKey = string("-") + it->string_key;
|
string strKey = string("-") + it->string_key;
|
||||||
if (mapSettingsRet.count(strKey) == 0)
|
if (mapSettingsRet.count(strKey) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -145,9 +145,9 @@ boost::filesystem::path GetConfigFile();
|
|||||||
boost::filesystem::path GetPidFile();
|
boost::filesystem::path GetPidFile();
|
||||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
||||||
#endif
|
#endif
|
||||||
class missing_zcash_conf : public std::runtime_error {
|
class missing_hush_conf : public std::runtime_error {
|
||||||
public:
|
public:
|
||||||
missing_zcash_conf() : std::runtime_error("Missing komodo.conf") { }
|
missing_hush_conf() : std::runtime_error(strprintf("Missing %s",GetConfigFile().string() )) { }
|
||||||
};
|
};
|
||||||
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|||||||
Reference in New Issue
Block a user