Rename hush→dragonx across wallet codebase

- Rename RESOURCE_HUSHD/HUSH_CLI/HUSH_TX to RESOURCE_DRAGONXD/DRAGONX_CLI/DRAGONX_TX
- Remove unused .bat resource constants (DRAGONXD_BAT, DRAGONX_CLI_BAT)
- Update INCBIN symbols: g_hushd_exe → g_dragonxd_exe, etc.
- Update daemon search paths, removing hush-arrakis-chain fallbacks
- Update process detection (Windows findProcessByName, Linux /proc/comm, macOS pgrep)
- Update build.sh: embed dragonxd.exe/dragonx-cli.exe/dragonx-tx.exe
- Overhaul setup.sh: fix binary names, release paths, add -j passthrough
- Update getDaemonPath/needsDaemonExtraction/hasDaemonAvailable for new names
This commit is contained in:
dan_s
2026-03-04 03:17:32 -06:00
parent 386cc857b0
commit 7fb1f1de9d
16 changed files with 416 additions and 195 deletions

View File

@@ -34,11 +34,9 @@ static const EmbeddedResource s_resources[] = {
{ g_sapling_output_params_data, g_sapling_output_params_size, RESOURCE_SAPLING_OUTPUT },
{ g_asmap_dat_data, g_asmap_dat_size, RESOURCE_ASMAP },
#ifdef HAS_EMBEDDED_DAEMON
{ g_hushd_exe_data, g_hushd_exe_size, RESOURCE_HUSHD },
{ g_hush_cli_exe_data, g_hush_cli_exe_size, RESOURCE_HUSH_CLI },
{ g_hush_tx_exe_data, g_hush_tx_exe_size, RESOURCE_HUSH_TX },
{ g_dragonxd_bat_data, g_dragonxd_bat_size, RESOURCE_DRAGONXD_BAT },
{ g_dragonx_cli_bat_data, g_dragonx_cli_bat_size, RESOURCE_DRAGONX_CLI_BAT },
{ g_dragonxd_exe_data, g_dragonxd_exe_size, RESOURCE_DRAGONXD },
{ g_dragonx_cli_exe_data, g_dragonx_cli_exe_size, RESOURCE_DRAGONX_CLI },
{ g_dragonx_tx_exe_data, g_dragonx_tx_exe_size, RESOURCE_DRAGONX_TX },
#endif
#ifdef HAS_EMBEDDED_XMRIG
{ g_xmrig_exe_data, g_xmrig_exe_size, RESOURCE_XMRIG },
@@ -177,7 +175,7 @@ bool needsParamsExtraction()
return false;
}
// Check daemon directory (hush3/) — the only extraction target
// Check daemon directory (dragonx/) — the only extraction target
std::string daemonDir = getDaemonDirectory();
std::string spendPath = daemonDir +
#ifdef _WIN32
@@ -246,10 +244,10 @@ bool extractEmbeddedResources()
const char pathSep = '/';
#endif
// All files go to <ObsidianDragonDir>/hush3/
// All files go to <ObsidianDragonDir>/dragonx/
std::string daemonDir = getDaemonDirectory();
// Extract Sapling params to daemon directory alongside hushd
// Extract Sapling params to daemon directory alongside dragonxd
const EmbeddedResource* spendRes = getEmbeddedResource(RESOURCE_SAPLING_SPEND);
if (spendRes) {
std::string dest = daemonDir + pathSep + RESOURCE_SAPLING_SPEND;
@@ -285,65 +283,43 @@ bool extractEmbeddedResources()
}
// Extract daemon binaries — NOT the data directory.
// Running hushd.exe from inside the data directory (where it writes blockchain
// Running dragonxd.exe from inside the data directory (where it writes blockchain
// data, debug.log, lock files, etc.) causes crashes on some Windows machines.
#ifdef HAS_EMBEDDED_DAEMON
DEBUG_LOGF("[INFO] Daemon extraction directory: %s\n", daemonDir.c_str());
const EmbeddedResource* hushdRes = getEmbeddedResource(RESOURCE_HUSHD);
if (hushdRes) {
std::string dest = daemonDir + pathSep + RESOURCE_HUSHD;
const EmbeddedResource* daemonRes = getEmbeddedResource(RESOURCE_DRAGONXD);
if (daemonRes) {
std::string dest = daemonDir + pathSep + RESOURCE_DRAGONXD;
if (!std::filesystem::exists(dest)) {
DEBUG_LOGF("[INFO] Extracting hushd.exe (%zu MB)...\n", hushdRes->size / (1024*1024));
if (!extractResource(hushdRes, dest)) {
DEBUG_LOGF("[INFO] Extracting dragonxd.exe (%zu MB)...\n", daemonRes->size / (1024*1024));
if (!extractResource(daemonRes, dest)) {
success = false;
}
}
}
const EmbeddedResource* cliRes = getEmbeddedResource(RESOURCE_HUSH_CLI);
const EmbeddedResource* cliRes = getEmbeddedResource(RESOURCE_DRAGONX_CLI);
if (cliRes) {
std::string dest = daemonDir + pathSep + RESOURCE_HUSH_CLI;
std::string dest = daemonDir + pathSep + RESOURCE_DRAGONX_CLI;
if (!std::filesystem::exists(dest)) {
DEBUG_LOGF("[INFO] Extracting hush-cli.exe (%zu MB)...\n", cliRes->size / (1024*1024));
DEBUG_LOGF("[INFO] Extracting dragonx-cli.exe (%zu MB)...\n", cliRes->size / (1024*1024));
if (!extractResource(cliRes, dest)) {
success = false;
}
}
}
const EmbeddedResource* batRes = getEmbeddedResource(RESOURCE_DRAGONXD_BAT);
if (batRes) {
std::string dest = daemonDir + pathSep + RESOURCE_DRAGONXD_BAT;
if (!std::filesystem::exists(dest)) {
DEBUG_LOGF("[INFO] Extracting dragonxd.bat...\n");
if (!extractResource(batRes, dest)) {
success = false;
}
}
}
const EmbeddedResource* txRes = getEmbeddedResource(RESOURCE_HUSH_TX);
const EmbeddedResource* txRes = getEmbeddedResource(RESOURCE_DRAGONX_TX);
if (txRes) {
std::string dest = daemonDir + pathSep + RESOURCE_HUSH_TX;
std::string dest = daemonDir + pathSep + RESOURCE_DRAGONX_TX;
if (!std::filesystem::exists(dest)) {
DEBUG_LOGF("[INFO] Extracting hush-tx.exe (%zu MB)...\n", txRes->size / (1024*1024));
DEBUG_LOGF("[INFO] Extracting dragonx-tx.exe (%zu MB)...\n", txRes->size / (1024*1024));
if (!extractResource(txRes, dest)) {
success = false;
}
}
}
const EmbeddedResource* cliBatRes = getEmbeddedResource(RESOURCE_DRAGONX_CLI_BAT);
if (cliBatRes) {
std::string dest = daemonDir + pathSep + RESOURCE_DRAGONX_CLI_BAT;
if (!std::filesystem::exists(dest)) {
DEBUG_LOGF("[INFO] Extracting dragonx-cli.bat...\n");
if (!extractResource(cliBatRes, dest)) {
success = false;
}
}
}
#endif
#ifdef HAS_EMBEDDED_XMRIG
@@ -364,14 +340,14 @@ bool extractEmbeddedResources()
std::string getDaemonDirectory()
{
// Daemon binaries live in %APPDATA%/ObsidianDragon/hush3/ (Windows) or
// ~/.config/ObsidianDragon/hush3/ (Linux) — separate from the blockchain
// Daemon binaries live in %APPDATA%/ObsidianDragon/dragonx/ (Windows) or
// ~/.config/ObsidianDragon/dragonx/ (Linux) — separate from the blockchain
// data directory to avoid lock-file conflicts.
std::string obsidianDir = util::Platform::getObsidianDragonDir();
#ifdef _WIN32
return obsidianDir + "\\hush3";
return obsidianDir + "\\dragonx";
#else
return obsidianDir + "/hush3";
return obsidianDir + "/dragonx";
#endif
}
@@ -380,11 +356,11 @@ bool needsDaemonExtraction()
#ifdef HAS_EMBEDDED_DAEMON
std::string daemonDir = getDaemonDirectory();
#ifdef _WIN32
std::string hushdPath = daemonDir + "\\hushd.exe";
std::string daemonPath = daemonDir + "\\dragonxd.exe";
#else
std::string hushdPath = daemonDir + "/hushd";
std::string daemonPath = daemonDir + "/dragonxd";
#endif
return !std::filesystem::exists(hushdPath);
return !std::filesystem::exists(daemonPath);
#else
return false;
#endif
@@ -397,9 +373,9 @@ bool hasDaemonAvailable()
#else
// Check if daemon exists alongside the executable
#ifdef _WIN32
return std::filesystem::exists("hushd.exe") || std::filesystem::exists("dragonxd.bat");
return std::filesystem::exists("dragonxd.exe");
#else
return std::filesystem::exists("hushd") || std::filesystem::exists("dragonxd");
return std::filesystem::exists("dragonxd");
#endif
#endif
}
@@ -409,10 +385,10 @@ std::string getDaemonPath()
std::string daemonDir = getDaemonDirectory();
#ifdef _WIN32
const char pathSep = '\\';
const char* daemonName = "hushd.exe";
const char* daemonName = "dragonxd.exe";
#else
const char pathSep = '/';
const char* daemonName = "hushd";
const char* daemonName = "dragonxd";
#endif
DEBUG_LOGF("[DEBUG] getDaemonPath: daemonDir=%s\n", daemonDir.c_str());