v5.5.5: Auto-bootstrap for new nodes - zero config required
Build All Platforms / test-linux-unit (push) Failing after 40s
Build All Platforms / build-linux-qt (push) Failing after 40s
Build All Platforms / build-linux-daemon (push) Failing after 40s
Build All Platforms / build-windows-qt (push) Has been cancelled
Build All Platforms / build-windows-daemon (push) Has been cancelled
Build All Platforms / build-macos (push) Has been cancelled
Build All Platforms / release (push) Has been cancelled

- Daemon: automatically downloads blockchain snapshot when no data exists
  No -bootstrap flag needed. Use -nobootstrap to skip.
- Qt wallet: auto-bootstraps on first run (no question asked)
  Existing users still get the optional re-download prompt.
- New users just install and run - blockchain downloads automatically
- Works on all platforms (Windows, Linux, macOS, ARM64)
This commit is contained in:
Krystie
2026-04-03 16:18:31 -07:00
parent cfaf742053
commit fb4c0708bf
3 changed files with 36 additions and 5 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
// These need to be macros, as version.cpp's and triangles-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 5
#define CLIENT_VERSION_MINOR 5
#define CLIENT_VERSION_REVISION 4
#define CLIENT_VERSION_REVISION 5
#define CLIENT_VERSION_BUILD 0
// Converts the parameter X to a string after macro replacement on X has been performed.
+16 -1
View File
@@ -834,8 +834,22 @@ bool AppInit2()
StartupPerfLog("network_init", GetTimeMillis() - nStart, strprintf("listen=%d seednodes=%" PRIszu, !fNoListen, mapMultiArgs["-seednode"].size()));
// ********************************************************* Step 6b: bootstrap download (daemon)
// Automatic: if data dir has no blockchain, bootstrap without asking.
// Can also be forced with -bootstrap flag, or disabled with -nobootstrap.
#ifndef QT_GUI
if (GetBoolArg("-bootstrap", false))
{
bool wantsBootstrap = GetBoolArg("-bootstrap", false);
bool noBootstrap = GetBoolArg("-nobootstrap", false);
fs::path dataPath = GetDataDir();
bool needsBootstrap = Bootstrap::NeedsBootstrap(dataPath);
if (needsBootstrap && !noBootstrap) {
printf("Bootstrap: no blockchain data found — downloading automatically.\n");
printf("Bootstrap: (use -nobootstrap to skip)\n");
wantsBootstrap = true;
}
if (wantsBootstrap)
{
int64_t nBootstrapStart = GetTimeMillis();
fs::path dataPath = GetDataDir();
@@ -871,6 +885,7 @@ bool AppInit2()
StartupPerfLog("bootstrap_download", GetTimeMillis() - nBootstrapStart,
strprintf("host=%s success=%d", host.c_str(), success));
}
} // end bootstrap scope
#endif
// ********************************************************* Step 7: load blockchain
+19 -3
View File
@@ -225,9 +225,22 @@ bool IntroDialog::pickDataDirectory()
return false;
}
// Offer bootstrap download on each startup (unless user checked "don't ask again")
// Auto-bootstrap: if no blockchain data exists, download automatically.
// If data exists, offer optional re-download (unless user checked "don't ask again").
fs::path dataDirPath(dataDir.toStdString());
if (!settings.value("bootstrapDontAsk", false).toBool())
bool needsBootstrap = Bootstrap::NeedsBootstrap(dataDirPath);
bool userWantsBootstrap = false;
if (needsBootstrap)
{
// No blockchain data — bootstrap automatically, just inform the user
QMessageBox::information(0, "Triangles",
"No blockchain data found.\n\n"
"Downloading the latest blockchain snapshot automatically.\n"
"This will only take a few minutes.");
userWantsBootstrap = true;
}
else if (!settings.value("bootstrapDontAsk", false).toBool())
{
QMessageBox msgBox;
msgBox.setWindowTitle("Triangles");
@@ -247,7 +260,10 @@ bool IntroDialog::pickDataDirectory()
if (dontAskBox->isChecked())
settings.setValue("bootstrapDontAsk", true);
if (ret == QMessageBox::Yes)
userWantsBootstrap = (ret == QMessageBox::Yes);
}
if (userWantsBootstrap)
{
std::string host = Bootstrap::DEFAULT_HOST;
std::string strError;